first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.kimgo.wepush.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.kimgo.wepush.config.UserConfig;
|
||||
import com.kimgo.wepush.mapper.QyWeChatAppInfoMapper;
|
||||
import com.kimgo.wepush.mapper.QyWeChatURLMapper;
|
||||
import com.kimgo.wepush.model.QyWeChatAppInfo;
|
||||
import com.kimgo.wepush.model.QyWeChatURL;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class QyWeChatURLService {
|
||||
private final Logger logger = LoggerFactory.getLogger(QyWeChatURLService.class);
|
||||
@Autowired
|
||||
private QyWeChatURLMapper qyWeChatURLMapper;
|
||||
@Autowired
|
||||
private UserConfig userConfig;
|
||||
private String urlName;
|
||||
private String sendTextCardMessageUrl;
|
||||
private String qyWechatGetTokenUrl;
|
||||
|
||||
public String getSendTextCardMessageUrl() {
|
||||
if (sendTextCardMessageUrl == null){
|
||||
queryLRL();
|
||||
}
|
||||
return sendTextCardMessageUrl;
|
||||
}
|
||||
private void queryLRL(){
|
||||
String phoneNumberToSearch = userConfig.getPhoneNumber();
|
||||
QueryWrapper<QyWeChatURL> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("phone_number", phoneNumberToSearch);
|
||||
QyWeChatURL result = qyWeChatURLMapper.selectOne(wrapper);
|
||||
if (result == null){
|
||||
logger.error("queryLRL error");
|
||||
}
|
||||
sendTextCardMessageUrl = result.getSendTextCardMessageUrl();
|
||||
qyWechatGetTokenUrl = result.getQyWechatGetTokenUrl();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user