From 4a23baabe49e00346e6e53731abbd8a980b2bd8f Mon Sep 17 00:00:00 2001 From: ANDRU-PC\Andru <769883346@qq.com> Date: 星期二, 16 五月 2023 14:25:25 +0800 Subject: [PATCH] 添加获取企业微信客户列表方法 --- src/main/java/com/hx/mp/util/CorpMpClientUtil.java | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hx/mp/util/CorpMpClientUtil.java b/src/main/java/com/hx/mp/util/CorpMpClientUtil.java index cf6c742..8009df7 100644 --- a/src/main/java/com/hx/mp/util/CorpMpClientUtil.java +++ b/src/main/java/com/hx/mp/util/CorpMpClientUtil.java @@ -43,6 +43,10 @@ */ public static final String RELATION_TAG = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/mark_tag?access_token="; + /** + * 鑾峰彇鍛樺伐瀹㈡埛鍒楄〃url + */ + public static final String EXTERNAL_CONTACT_LIST = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/list"; /** * 鐢熸垚浼佷笟鎴愬憳鑱旂郴鎴戠殑id-鍗曚汉 @@ -76,6 +80,16 @@ } /** + * 鑾峰彇瀹㈡埛鍒楄〃 + * @param accessToken 浼佷笟鐨刟ccessToken + * @param userId 浼佷笟鎴愬憳鐨剈serId + * @return 杩斿洖 + */ + public static JSONObject getExternalContactList(String accessToken, String userId) { + return HttpURLUtil(EXTERNAL_CONTACT_LIST + "?access_token=" + accessToken + "&userid=" + userId, null); + } + + /** * 鑾峰彇浼佷笟瀹㈡埛璇︽儏淇℃伅 * * @param accessToken 浼佷笟鐨刟ccessToken @@ -83,7 +97,6 @@ * @return 杩斿洖 */ public static JSONObject getClientData(String accessToken, String externalUserId) { - return HttpURLUtil(GET_CLIENT_DETAIL_URL + "?access_token=" + accessToken + "&external_userid=" + externalUserId, null); } @@ -179,7 +192,6 @@ return HttpURLUtil(RELATION_TAG + accessToken, data.toString()); } - /** * 璇锋眰http鍗忚 鑾峰彇淇℃伅宸ュ叿 **/ @@ -233,10 +245,9 @@ * @param scene 鍦烘櫙锛�1-鍦ㄥ皬绋嬪簭涓仈绯伙紝2-閫氳繃浜岀淮鐮佽仈绯� * @param state 浼佷笟鑷畾涔夌殑state鍙傛暟锛岀敤浜庡尯鍒嗕笉鍚岀殑娣诲姞娓犻亾锛屽湪璋冪敤鈥滆幏鍙栧閮ㄨ仈绯讳汉璇︽儏鈥濇椂浼氳繑鍥炶鍙傛暟鍊硷紝涓嶈秴杩�30涓瓧绗� * @param remark 鑱旂郴鏂瑰紡鐨勫娉ㄤ俊鎭紝鐢ㄤ簬鍔╄锛屼笉瓒呰繃30涓瓧绗� - * @return + * @return 杩斿洖 */ public static JSONObject createContactId(String accessToken,String userId,int scene,String state,String remark){ - String configId = null; JSONObject data = new JSONObject(); data.put("type",1); -- Gitblit v1.8.0