-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Expand file tree
/
Copy pathWxMaKefuService.java
More file actions
128 lines (117 loc) · 5.07 KB
/
WxMaKefuService.java
File metadata and controls
128 lines (117 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.kefu.WxMaKfInfo;
import cn.binarywang.wx.miniapp.bean.kefu.WxMaKfList;
import cn.binarywang.wx.miniapp.bean.kefu.WxMaKfSession;
import cn.binarywang.wx.miniapp.bean.kefu.WxMaKfSessionList;
import cn.binarywang.wx.miniapp.bean.kefu.request.WxMaKfAccountRequest;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* <pre>
* 小程序客服管理接口.
* 不同于 WxMaCustomserviceWorkService (企业微信客服绑定) 和 WxMaMsgService.sendKefuMsg (发送客服消息),
* 此接口专门处理小程序客服账号管理、会话管理等功能。
*
* 注意:小程序客服管理接口与公众号客服管理接口在API端点和功能上有所不同。
* </pre>
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
public interface WxMaKefuService {
/**
* <pre>
* 获取客服基本信息
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.getContactList.html">获取客服基本信息</a>
* 接口url格式:https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token=ACCESS_TOKEN
* </pre>
*
* @return 客服列表
* @throws WxErrorException 异常
*/
WxMaKfList kfList() throws WxErrorException;
/**
* <pre>
* 添加客服账号
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.addKfAccount.html">添加客服账号</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/add?access_token=ACCESS_TOKEN
* </pre>
*
* @param request 客服账号信息
* @return 是否成功
* @throws WxErrorException 异常
*/
boolean kfAccountAdd(WxMaKfAccountRequest request) throws WxErrorException;
/**
* <pre>
* 修改客服账号
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.updateKfAccount.html">修改客服账号</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/update?access_token=ACCESS_TOKEN
* </pre>
*
* @param request 客服账号信息
* @return 是否成功
* @throws WxErrorException 异常
*/
boolean kfAccountUpdate(WxMaKfAccountRequest request) throws WxErrorException;
/**
* <pre>
* 删除客服账号
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.deleteKfAccount.html">删除客服账号</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
* </pre>
*
* @param kfAccount 客服账号
* @return 是否成功
* @throws WxErrorException 异常
*/
boolean kfAccountDel(String kfAccount) throws WxErrorException;
/**
* <pre>
* 创建会话
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.createSession.html">创建会话</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfsession/create?access_token=ACCESS_TOKEN
* </pre>
*
* @param openid 用户openid
* @param kfAccount 客服账号
* @return 是否成功
* @throws WxErrorException 异常
*/
boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException;
/**
* <pre>
* 关闭会话
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.closeSession.html">关闭会话</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfsession/close?access_token=ACCESS_TOKEN
* </pre>
*
* @param openid 用户openid
* @param kfAccount 客服账号
* @return 是否成功
* @throws WxErrorException 异常
*/
boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException;
/**
* <pre>
* 获取客户的会话状态
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.getSession.html">获取客户的会话状态</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfsession/getsession?access_token=ACCESS_TOKEN&openid=OPENID
* </pre>
*
* @param openid 用户openid
* @return 会话信息
* @throws WxErrorException 异常
*/
WxMaKfSession kfSessionGet(String openid) throws WxErrorException;
/**
* <pre>
* 获取客服的会话列表
* 详情请见:<a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-service/customerServiceMessage.getSessionList.html">获取客服的会话列表</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfsession/getsessionlist?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
* </pre>
*
* @param kfAccount 客服账号
* @return 会话列表
* @throws WxErrorException 异常
*/
WxMaKfSessionList kfSessionList(String kfAccount) throws WxErrorException;
}