mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 18:46:10 +08:00 
			
		
		
		
	🆕 #1950 【企业微信】第三方应用增加获取应用的管理员列表的接口
This commit is contained in:
		| @ -0,0 +1,47 @@ | ||||
| package me.chanjar.weixin.cp.bean; | ||||
|  | ||||
| import com.google.gson.annotations.SerializedName; | ||||
| import lombok.Data; | ||||
| import lombok.Getter; | ||||
| import lombok.Setter; | ||||
| import me.chanjar.weixin.common.util.json.WxGsonBuilder; | ||||
| import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 应用的管理员 | ||||
|  * @author huangxiaoming | ||||
|  */ | ||||
| @Data | ||||
| public class WxCpTpAdmin extends WxCpBaseResp { | ||||
|  | ||||
|   private static final long serialVersionUID = -5028321625140879571L; | ||||
|  | ||||
|   @SerializedName("admin") | ||||
|   private List<Admin> admin; | ||||
|  | ||||
|   @Getter | ||||
|   @Setter | ||||
|   public static class Admin { | ||||
|  | ||||
|     @SerializedName("userid") | ||||
|     private String userId; | ||||
|  | ||||
|     @SerializedName("auth_type") | ||||
|     private Integer authType; | ||||
|  | ||||
|     public String toJson() { | ||||
|       return WxGsonBuilder.create().toJson(this); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   public static WxCpTpAdmin fromJson(String json) { | ||||
|     return WxCpGsonBuilder.create().fromJson(json, WxCpTpAdmin.class); | ||||
|   } | ||||
|  | ||||
|   public String toJson() { | ||||
|     return WxCpGsonBuilder.create().toJson(this); | ||||
|   } | ||||
|  | ||||
| } | ||||
| @ -156,6 +156,8 @@ public final class WxCpApiPathConsts { | ||||
|  | ||||
|  | ||||
|     public static final String CONTACT_SEARCH = "/cgi-bin/service/contact/search"; | ||||
|     public static final String GET_ADMIN_LIST = "/cgi-bin/service/get_admin_list"; | ||||
|  | ||||
|   } | ||||
|  | ||||
|   @UtilityClass | ||||
|  | ||||
| @ -387,4 +387,15 @@ public interface WxCpTpService { | ||||
|    * @param wxCpTpUserService the set user service | ||||
|    */ | ||||
|   void setWxCpTpUserService(WxCpTpUserService wxCpTpUserService); | ||||
|  | ||||
|   /** | ||||
|    * 获取应用的管理员列表 | ||||
|    * @param authCorpId | ||||
|    * @param agentId | ||||
|    * @return | ||||
|    */ | ||||
|   WxCpTpAdmin getAdminList(String authCorpId,Integer agentId) throws WxErrorException; | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -476,4 +476,14 @@ public abstract class BaseWxCpTpServiceImpl<H, P> implements WxCpTpService, Requ | ||||
|   public void setWxCpTpUserService(WxCpTpUserService wxCpTpUserService) { | ||||
|     this.wxCpTpUserService = wxCpTpUserService; | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public WxCpTpAdmin getAdminList(String authCorpId,Integer agentId) throws WxErrorException{ | ||||
|     JsonObject jsonObject = new JsonObject(); | ||||
|     jsonObject.addProperty("auth_corpid", authCorpId); | ||||
|     jsonObject.addProperty("agentid", agentId); | ||||
|     String result = post(configStorage.getApiUrl(GET_ADMIN_LIST), jsonObject.toString()); | ||||
|     return WxCpTpAdmin.fromJson(result); | ||||
|   } | ||||
|  | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 huangxm129
					huangxm129