|
@@ -41,8 +41,8 @@ public class WechatCustomerComponents {
|
|
|
return insCrawlerOrderComponents.request(url, "wechatCustomer", wechatCustomer.getDesc(), requestBody, responseType, httpHeaders);
|
|
return insCrawlerOrderComponents.request(url, "wechatCustomer", wechatCustomer.getDesc(), requestBody, responseType, httpHeaders);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public WxCryptUtil getWxCryptUtil(){
|
|
|
|
|
- return new WxCryptUtil(wechatCustomerProperties.getToken(), wechatCustomerProperties.getEncodingAesKey(), wechatCustomerProperties.getCorpId());
|
|
|
|
|
|
|
+ public WxCryptUtil getWxCryptUtil() {
|
|
|
|
|
+ return new WxCryptUtil(wechatCustomerProperties.getToken(), wechatCustomerProperties.getEncodingAesKey(), wechatCustomerProperties.getCorpId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -53,7 +53,7 @@ public class WechatCustomerComponents {
|
|
|
private String getToken() {
|
|
private String getToken() {
|
|
|
return redissonUtils.getFromRedis(() -> {
|
|
return redissonUtils.getFromRedis(() -> {
|
|
|
CustomerGetTokenRequest customerGetTokenRequest = new CustomerGetTokenRequest(wechatCustomerProperties.getCorpId(), wechatCustomerProperties.getSecret());
|
|
CustomerGetTokenRequest customerGetTokenRequest = new CustomerGetTokenRequest(wechatCustomerProperties.getCorpId(), wechatCustomerProperties.getSecret());
|
|
|
- String url = WechatCustomerEnum.URL + customerGetTokenRequest.getUrlParams();
|
|
|
|
|
|
|
+ String url = WechatCustomerEnum.URL + WechatCustomerEnum.GET_ACCESS_TOKEN.getUri() + customerGetTokenRequest.getUrlParams();
|
|
|
CustomerGetTokenResponse customerGetTokenResponse = restTemplate.getForObject(url, CustomerGetTokenResponse.class);
|
|
CustomerGetTokenResponse customerGetTokenResponse = restTemplate.getForObject(url, CustomerGetTokenResponse.class);
|
|
|
AssertionUtils.isEmpty(customerGetTokenResponse, "获取调用凭证access_token异常");
|
|
AssertionUtils.isEmpty(customerGetTokenResponse, "获取调用凭证access_token异常");
|
|
|
String accessToken = customerGetTokenResponse.getAccessToken();
|
|
String accessToken = customerGetTokenResponse.getAccessToken();
|
|
@@ -62,7 +62,6 @@ public class WechatCustomerComponents {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取客服账号列表
|
|
* 获取客服账号列表
|
|
|
*
|
|
*
|
|
@@ -70,7 +69,7 @@ public class WechatCustomerComponents {
|
|
|
* @return 客服账号列表
|
|
* @return 客服账号列表
|
|
|
*/
|
|
*/
|
|
|
public CustomerListResponse list(CustomerListRequest customerListRequest) {
|
|
public CustomerListResponse list(CustomerListRequest customerListRequest) {
|
|
|
- return request(WechatCustomerEnum.LIST, customerListRequest, CustomerListResponse.class, HttpHeaders.EMPTY);
|
|
|
|
|
|
|
+ return request(WechatCustomerEnum.LIST, customerListRequest, CustomerListResponse.class, new HttpHeaders());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -80,7 +79,7 @@ public class WechatCustomerComponents {
|
|
|
* @return 客服账号链接
|
|
* @return 客服账号链接
|
|
|
*/
|
|
*/
|
|
|
public CustomerAddContactWayResponse addContactWay(CustomerAddContactWayRequest customerAddContactWayRequest) {
|
|
public CustomerAddContactWayResponse addContactWay(CustomerAddContactWayRequest customerAddContactWayRequest) {
|
|
|
- return request(WechatCustomerEnum.ADD_CONTACT_WAY, customerAddContactWayRequest, CustomerAddContactWayResponse.class, HttpHeaders.EMPTY);
|
|
|
|
|
|
|
+ return request(WechatCustomerEnum.ADD_CONTACT_WAY, customerAddContactWayRequest, CustomerAddContactWayResponse.class, new HttpHeaders());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -90,7 +89,7 @@ public class WechatCustomerComponents {
|
|
|
* @return 消息信息
|
|
* @return 消息信息
|
|
|
*/
|
|
*/
|
|
|
public CustomerSendMsgOnEventResponse sendMsgOnEvent(CustomerSendMsgOnEventRequest customerSendMsgOnEventRequest) {
|
|
public CustomerSendMsgOnEventResponse sendMsgOnEvent(CustomerSendMsgOnEventRequest customerSendMsgOnEventRequest) {
|
|
|
- return request(WechatCustomerEnum.LIST, customerSendMsgOnEventRequest, CustomerSendMsgOnEventResponse.class, HttpHeaders.EMPTY);
|
|
|
|
|
|
|
+ return request(WechatCustomerEnum.SEND_MSG_ON_EVENT, customerSendMsgOnEventRequest, CustomerSendMsgOnEventResponse.class, new HttpHeaders());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -100,7 +99,7 @@ public class WechatCustomerComponents {
|
|
|
* @return 成功失败
|
|
* @return 成功失败
|
|
|
*/
|
|
*/
|
|
|
public CustomerSyncMsgResponse syncMsg(CustomerSyncMsgRequest customerSyncMsgRequest) {
|
|
public CustomerSyncMsgResponse syncMsg(CustomerSyncMsgRequest customerSyncMsgRequest) {
|
|
|
- return request(WechatCustomerEnum.SYNC_MSG, customerSyncMsgRequest, CustomerSyncMsgResponse.class, HttpHeaders.EMPTY);
|
|
|
|
|
|
|
+ return request(WechatCustomerEnum.SYNC_MSG, customerSyncMsgRequest, CustomerSyncMsgResponse.class, new HttpHeaders());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|