更新 SMSService.java
This commit is contained in:
@@ -18,14 +18,13 @@ import java.io.IOException;
|
|||||||
@Service
|
@Service
|
||||||
public class SMSService {
|
public class SMSService {
|
||||||
private final Logger logger = LoggerFactory.getLogger(SMSService.class);
|
private final Logger logger = LoggerFactory.getLogger(SMSService.class);
|
||||||
@Autowired
|
|
||||||
private UserConfig userConfig;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApiSettingService apiSettingService;
|
private ApiSettingService apiSettingService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private URLConfig urlConfig;
|
private QyWeChatURLService qyWeChatURLService;
|
||||||
|
|
||||||
public ServerResponseEntity getSMSInfo(String accessToken, SMSInfo smsInfo){
|
public ServerResponseEntity getSMSInfo(String accessToken, SMSInfo smsInfo){
|
||||||
String correctAccessToken = tokenService.getApiAccessToken();
|
String correctAccessToken = tokenService.getApiAccessToken();
|
||||||
@@ -43,7 +42,7 @@ public class SMSService {
|
|||||||
|
|
||||||
public QyWeChatSendMessageApiResponse requestWithOkhttp(String accessToken,SMSInfo smsInfo){
|
public QyWeChatSendMessageApiResponse requestWithOkhttp(String accessToken,SMSInfo smsInfo){
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
String url = urlConfig.getSendTextCardMessageUrl() + accessToken;
|
String url = qyWeChatURLService.getSendTextCardMessageUrl() + "?access_token=" + accessToken;
|
||||||
|
|
||||||
TextCardMessage textCardMessage = setTextCardMessage(smsInfo);
|
TextCardMessage textCardMessage = setTextCardMessage(smsInfo);
|
||||||
// 使用Jackson进行序列化
|
// 使用Jackson进行序列化
|
||||||
|
|||||||
Reference in New Issue
Block a user