更新 QyWeChatURLService.java
parent
d0763da3de
commit
58ce53ebe0
|
|
@ -9,7 +9,9 @@ import com.kimgo.wepush.model.QyWeChatURL;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class QyWeChatURLService {
|
||||
private final Logger logger = LoggerFactory.getLogger(QyWeChatURLService.class);
|
||||
@Autowired
|
||||
|
|
@ -22,18 +24,19 @@ public class QyWeChatURLService {
|
|||
|
||||
public String getSendTextCardMessageUrl() {
|
||||
if (sendTextCardMessageUrl == null){
|
||||
queryLRL();
|
||||
queryURL();
|
||||
}
|
||||
return sendTextCardMessageUrl;
|
||||
}
|
||||
private void queryLRL(){
|
||||
private void queryURL(){
|
||||
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");
|
||||
logger.error("queryURL error");
|
||||
}
|
||||
logger.info("queryURL result: {}",result.toString());
|
||||
sendTextCardMessageUrl = result.getSendTextCardMessageUrl();
|
||||
qyWechatGetTokenUrl = result.getQyWechatGetTokenUrl();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue