mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-04 12:47:46 +08:00
简化优化客服相关接口代码
This commit is contained in:
parent
244df15d83
commit
f9022814fd
@ -1,15 +0,0 @@
|
||||
package me.chanjar.weixin.mp.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Binary Wang
|
||||
*
|
||||
*/
|
||||
|
||||
public interface WxMpBaseChildService {
|
||||
/**
|
||||
* 设置WxMpService对象
|
||||
* @return
|
||||
*/
|
||||
void setWxMpService(WxMpService wxMpService);
|
||||
}
|
@ -15,7 +15,7 @@ import me.chanjar.weixin.mp.bean.customerservice.result.WxMpKfOnlineList;
|
||||
* @author Binary Wang
|
||||
*
|
||||
*/
|
||||
public interface WxMpKefuService extends WxMpBaseChildService {
|
||||
public interface WxMpKefuService {
|
||||
/**
|
||||
* <pre>
|
||||
* 获取客服基本信息
|
||||
|
@ -23,6 +23,7 @@ import me.chanjar.weixin.common.util.http.*;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
||||
import me.chanjar.weixin.mp.api.impl.WxMpKefuServiceImpl;
|
||||
import me.chanjar.weixin.mp.bean.*;
|
||||
import me.chanjar.weixin.mp.bean.result.*;
|
||||
import me.chanjar.weixin.mp.util.http.*;
|
||||
@ -75,7 +76,7 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
|
||||
protected WxMpConfigStorage wxMpConfigStorage;
|
||||
|
||||
protected WxMpKefuService kefuService;
|
||||
protected WxMpKefuService kefuService = new WxMpKefuServiceImpl(this);
|
||||
|
||||
protected CloseableHttpClient httpClient;
|
||||
|
||||
@ -1377,8 +1378,4 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
return this.kefuService;
|
||||
}
|
||||
|
||||
public void setKefuService(WxMpKefuService kefuService) {
|
||||
this.kefuService = kefuService;
|
||||
this.kefuService.setWxMpService(this);
|
||||
}
|
||||
}
|
||||
|
@ -20,19 +20,10 @@ import me.chanjar.weixin.mp.bean.customerservice.result.WxMpKfOnlineList;
|
||||
public class WxMpKefuServiceImpl implements WxMpKefuService {
|
||||
private WxMpService wxMpService;
|
||||
|
||||
public WxMpKefuServiceImpl(){
|
||||
|
||||
}
|
||||
|
||||
public WxMpKefuServiceImpl(WxMpService wxMpService) {
|
||||
this.wxMpService = wxMpService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWxMpService(WxMpService wxMpService) {
|
||||
this.wxMpService = wxMpService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxMpKfList kfList() throws WxErrorException {
|
||||
String url = "https://api.weixin.qq.com/cgi-bin/customservice/getkflist";
|
||||
|
@ -24,9 +24,6 @@ public class ApiTestModule implements Module {
|
||||
WxMpServiceImpl wxService = new WxMpServiceImpl();
|
||||
wxService.setWxMpConfigStorage(config);
|
||||
|
||||
WxMpKefuService kefuService = new WxMpKefuServiceImpl();
|
||||
wxService.setKefuService(kefuService);
|
||||
|
||||
binder.bind(WxMpServiceImpl.class).toInstance(wxService);
|
||||
binder.bind(WxMpConfigStorage.class).toInstance(config);
|
||||
} catch (IOException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user