From f8bd1c406ef31027967c0cfa8c2f5f097ae93ec9 Mon Sep 17 00:00:00 2001 From: fwq <582742538@qq.com> Date: 星期二, 07 十一月 2023 16:19:33 +0800 Subject: [PATCH] 群联系方式配置管理 --- src/main/java/com/hx/mp/util/CorpMpClientUtil.java | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/mp/util/CorpMpClientUtil.java b/src/main/java/com/hx/mp/util/CorpMpClientUtil.java index 5e89e85..40fb01c 100644 --- a/src/main/java/com/hx/mp/util/CorpMpClientUtil.java +++ b/src/main/java/com/hx/mp/util/CorpMpClientUtil.java @@ -78,6 +78,24 @@ */ public static final String GROUP_SENT_EMAIL = "https://qyapi.weixin.qq.com/cgi-bin/exmail/app/compose_send?access_token="; + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶆煡鐪� + */ + public static final String GROUP_JOIN_WAY_SEE = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/get_join_way?access_token="; + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶆柊澧� + * 浼佷笟鍙皟鐢ㄦ鎺ュ彛鏉ョ敓鎴愬苟閰嶇疆銆屽姞鍏ョ兢鑱娿�嶇殑浜岀淮鐮佹垨鑰呭皬绋嬪簭鎸夐挳 + * 瀹㈡埛閫氳繃鎵弿浜岀淮鐮佹垨鐐瑰嚮灏忕▼搴忎笂鐨勬寜閽紝鍗冲彲鍔犲叆鐗瑰畾鐨勫鎴风兢 + */ + public static final String GROUP_JOIN_WAY_ADD = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/add_join_way?access_token="; + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶄慨鏀� + */ + public static final String GROUP_JOIN_WAY_EDIT = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/update_join_way?access_token="; + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶅垹闄� + */ + public static final String GROUP_JOIN_WAY_EDL= "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/del_join_way?access_token="; /** @@ -420,4 +438,73 @@ public static JSONObject sentEmail(String accessToken, JSONObject bodyData) { return HttpURLUtil(GROUP_SENT_EMAIL + accessToken, bodyData.toString()); } + + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶆煡鐪嬭鎯� + * @param config_id 鑱旂郴鏂瑰紡閰嶇疆ID + * */ + public static HttpHzResponse groupJoinSee(String accessToken, String config_id) { + JSONObject bodyData = new JSONObject(); + bodyData.put("config_id", config_id); + return HttpHzUtil.HttpURLUtilJson(GROUP_JOIN_WAY_SEE + accessToken, bodyData.toString(), null, null, "POST", null); + } + + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶆柊澧� + * @param scene 鍦烘櫙銆�1 - 缇ょ殑灏忕▼搴忔彃浠�, 2 - 缇ょ殑浜岀淮鐮佹彃浠� + * @param remark 鑱旂郴鏂瑰紡鐨勫娉ㄤ俊鎭紝鐢ㄤ簬鍔╄锛岃秴杩�30涓瓧绗﹀皢琚埅鏂� + * @param auto_create_room 褰撶兢婊′簡鍚庯紝鏄惁鑷姩鏂板缓缇ゃ��0-鍚︼紱1-鏄�� 榛樿涓�1 + * @param room_base_name 鑷姩寤虹兢鐨勭兢鍚嶅墠缂�锛屽綋auto_create_room涓�1鏃舵湁鏁堛�傛渶闀�40涓猽tf8瀛楃 + * @param room_base_id 鑷姩寤虹兢鐨勭兢璧峰搴忓彿锛屽綋auto_create_room涓�1鏃舵湁鏁� + * @param chat_id_list 浣跨敤璇ラ厤缃殑瀹㈡埛缇D鍒楄〃锛屾渶澶氭敮鎸�5涓� + * */ + public static HttpHzResponse groupJoinAdd(String accessToken, Integer scene, String remark + ,Integer auto_create_room,String room_base_name,String room_base_id,List<String> chat_id_list,String state) { + JSONObject bodyData = new JSONObject(); + bodyData.put("scene", scene); + bodyData.put("remark", remark); + bodyData.put("auto_create_room", auto_create_room); + bodyData.put("room_base_name", room_base_name); + bodyData.put("room_base_id", room_base_id); + bodyData.put("chat_id_list", chat_id_list); + bodyData.put("state", state); + return HttpHzUtil.HttpURLUtilJson(GROUP_JOIN_WAY_ADD + accessToken, bodyData.toString(), null, null, "POST", null); + } + + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶄慨鏀� + * @param config_id 鑱旂郴鏂瑰紡閰嶇疆ID + * @param scene 鍦烘櫙銆�1 - 缇ょ殑灏忕▼搴忔彃浠�, 2 - 缇ょ殑浜岀淮鐮佹彃浠� + * @param remark 鑱旂郴鏂瑰紡鐨勫娉ㄤ俊鎭紝鐢ㄤ簬鍔╄锛岃秴杩�30涓瓧绗﹀皢琚埅鏂� + * @param auto_create_room 褰撶兢婊′簡鍚庯紝鏄惁鑷姩鏂板缓缇ゃ��0-鍚︼紱1-鏄�� 榛樿涓�1 + * @param room_base_name 鑷姩寤虹兢鐨勭兢鍚嶅墠缂�锛屽綋auto_create_room涓�1鏃舵湁鏁堛�傛渶闀�40涓猽tf8瀛楃 + * @param room_base_id 鑷姩寤虹兢鐨勭兢璧峰搴忓彿锛屽綋auto_create_room涓�1鏃舵湁鏁� + * @param chat_id_list 浣跨敤璇ラ厤缃殑瀹㈡埛缇D鍒楄〃锛屾渶澶氭敮鎸�5涓� + * */ + public static HttpHzResponse groupJoinEdit(String accessToken,String config_id, Integer scene, String remark + ,Integer auto_create_room,String room_base_name,String room_base_id,List<String> chat_id_list,String state) { + JSONObject bodyData = new JSONObject(); + bodyData.put("config_id", config_id); + bodyData.put("scene", scene); + bodyData.put("remark", remark); + bodyData.put("auto_create_room", auto_create_room); + bodyData.put("room_base_name", room_base_name); + bodyData.put("room_base_id", room_base_id); + bodyData.put("chat_id_list", chat_id_list); + bodyData.put("state", state); + return HttpHzUtil.HttpURLUtilJson(GROUP_JOIN_WAY_EDIT + accessToken, bodyData.toString(), null, null, "POST", null); + } + + /** + * 瀹㈡埛缇ゃ�屽姞鍏ョ兢鑱娿�嶅垹闄� + * @param config_id 鑱旂郴鏂瑰紡閰嶇疆ID + * */ + public static HttpHzResponse groupJoinDel(String accessToken, String config_id) { + JSONObject bodyData = new JSONObject(); + bodyData.put("config_id", config_id); + return HttpHzUtil.HttpURLUtilJson(GROUP_JOIN_WAY_EDL + accessToken, bodyData.toString(), null, null, "POST", null); + } + + + } -- Gitblit v1.8.0