File tree Expand file tree Collapse file tree 4 files changed +70
-0
lines changed
weixin-java-cp/src/main/java/me/chanjar/weixin/cp Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ package me .chanjar .weixin .cp .bean ;
2+
3+ import com .google .gson .annotations .SerializedName ;
4+ import lombok .Data ;
5+ import lombok .Getter ;
6+ import lombok .Setter ;
7+ import me .chanjar .weixin .common .util .json .WxGsonBuilder ;
8+ import me .chanjar .weixin .cp .util .json .WxCpGsonBuilder ;
9+
10+ import java .util .List ;
11+
12+ /**
13+ * 应用的管理员
14+ * @author huangxiaoming
15+ */
16+ @ Data
17+ public class WxCpTpAdmin extends WxCpBaseResp {
18+
19+ private static final long serialVersionUID = -5028321625140879571L ;
20+
21+ @ SerializedName ("admin" )
22+ private List <Admin > admin ;
23+
24+ @ Getter
25+ @ Setter
26+ public static class Admin {
27+
28+ @ SerializedName ("userid" )
29+ private String userId ;
30+
31+ @ SerializedName ("auth_type" )
32+ private Integer authType ;
33+
34+ public String toJson () {
35+ return WxGsonBuilder .create ().toJson (this );
36+ }
37+ }
38+
39+ public static WxCpTpAdmin fromJson (String json ) {
40+ return WxCpGsonBuilder .create ().fromJson (json , WxCpTpAdmin .class );
41+ }
42+
43+ public String toJson () {
44+ return WxCpGsonBuilder .create ().toJson (this );
45+ }
46+
47+ }
Original file line number Diff line number Diff line change @@ -156,6 +156,8 @@ public static class Tp {
156156
157157
158158 public static final String CONTACT_SEARCH = "/cgi-bin/service/contact/search" ;
159+ public static final String GET_ADMIN_LIST = "/cgi-bin/service/get_admin_list" ;
160+
159161 }
160162
161163 @ UtilityClass
Original file line number Diff line number Diff line change @@ -387,4 +387,15 @@ public interface WxCpTpService {
387387 * @param wxCpTpUserService the set user service
388388 */
389389 void setWxCpTpUserService (WxCpTpUserService wxCpTpUserService );
390+
391+ /**
392+ * 获取应用的管理员列表
393+ * @param authCorpId
394+ * @param agentId
395+ * @return
396+ */
397+ WxCpTpAdmin getAdminList (String authCorpId ,Integer agentId ) throws WxErrorException ;
398+
399+
400+
390401}
Original file line number Diff line number Diff line change @@ -476,4 +476,14 @@ public void setWxCpTpOAService(WxCpTpOAService wxCpTpOAService) {
476476 public void setWxCpTpUserService (WxCpTpUserService wxCpTpUserService ) {
477477 this .wxCpTpUserService = wxCpTpUserService ;
478478 }
479+
480+ @ Override
481+ public WxCpTpAdmin getAdminList (String authCorpId ,Integer agentId ) throws WxErrorException {
482+ JsonObject jsonObject = new JsonObject ();
483+ jsonObject .addProperty ("auth_corpid" , authCorpId );
484+ jsonObject .addProperty ("agentid" , agentId );
485+ String result = post (configStorage .getApiUrl (GET_ADMIN_LIST ), jsonObject .toString ());
486+ return WxCpTpAdmin .fromJson (result );
487+ }
488+
479489}
You can’t perform that action at this time.
0 commit comments