File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
main/java/me/chanjar/weixin/cp/api
test/java/me/chanjar/weixin/cp/api/impl Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,12 @@ public interface WxCpKfService {
47
47
48
48
/**
49
49
* 获取客服帐号列表,包括所有的客服帐号的客服ID、名称和头像。
50
- *
50
+ * @param offset 分页,偏移量, 默认为0
51
+ * @param limit 分页,预期请求的数据量,默认为100,取值范围 1 ~ 100
51
52
* @return 客服帐号列表
52
53
* @throws WxErrorException 异常
53
54
*/
54
- WxCpKfAccountListResp listAccount () throws WxErrorException ;
55
+ WxCpKfAccountListResp listAccount (Integer offset , Integer limit ) throws WxErrorException ;
55
56
56
57
/**
57
58
* 企业可通过此接口获取带有不同参数的客服链接,不同客服帐号对应不同的客服链接。获取后,企业可将链接嵌入到网页等场景中,
Original file line number Diff line number Diff line change @@ -49,9 +49,16 @@ public WxCpBaseResp delAccount(WxCpKfAccountDel del) throws WxErrorException {
49
49
}
50
50
51
51
@ Override
52
- public WxCpKfAccountListResp listAccount () throws WxErrorException {
52
+ public WxCpKfAccountListResp listAccount (Integer offset , Integer limit ) throws WxErrorException {
53
53
String url = cpService .getWxCpConfigStorage ().getApiUrl (ACCOUNT_LIST );
54
- String responseContent = cpService .post (url , "{}" );
54
+ JsonObject json = new JsonObject ();
55
+ if (offset != null ) {
56
+ json .addProperty ("offset" , offset );
57
+ }
58
+ if (limit != null ) {
59
+ json .addProperty ("limit" , limit );
60
+ }
61
+ String responseContent = cpService .post (url , json .toString ());
55
62
return WxCpKfAccountListResp .fromJson (responseContent );
56
63
}
57
64
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public void testAccountUpd() throws Exception {
58
58
59
59
@ Test (priority = 3 )
60
60
public void testAccountList () throws Exception {
61
- WxCpKfAccountListResp resp = this .wxService .getKfService ().listAccount ();
61
+ WxCpKfAccountListResp resp = this .wxService .getKfService ().listAccount (0 , 10 );
62
62
System .out .println (resp );
63
63
}
64
64
You can’t perform that action at this time.
0 commit comments