From 55697aaa2e4974d5b443e731581e4c50609946b7 Mon Sep 17 00:00:00 2001
From: guang <guang@guang.com>
Date: 星期五, 28 七月 2023 11:13:30 +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