From 4ecf4cf260a41c532b40cebd353893845ae716f8 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 16 四月 2025 14:44:45 +0800
Subject: [PATCH] 代码初始化
---
server/src/main/java/com/doumee/core/utils/qiyeweixin/QywxUtil.java | 40 ++++++++++++++++++++++++++++++++++------
1 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/server/src/main/java/com/doumee/core/utils/qiyeweixin/QywxUtil.java b/server/src/main/java/com/doumee/core/utils/qiyeweixin/QywxUtil.java
index 18bd4b9..95c7b95 100644
--- a/server/src/main/java/com/doumee/core/utils/qiyeweixin/QywxUtil.java
+++ b/server/src/main/java/com/doumee/core/utils/qiyeweixin/QywxUtil.java
@@ -81,13 +81,18 @@
return null;
}
public static QywxSendMsgResponse sendMsg(String token, QywxSendMsgRequest param) {
- String[] interfaceUrl = QywxConstant.SEND_MSG;
- String url = interfaceUrl[0].replace("${accesstoken}",token);
- QywxSendMsgResponse response = sendHttpRequestSingle(url,interfaceUrl[1],JSONObject.toJSONString(param)
- ,new TypeReference<QywxSendMsgResponse>(){});
- if(response.getErrcode()!=null && response.getErrcode() ==0){
- return response;
+ try{
+ String[] interfaceUrl = QywxConstant.SEND_MSG;
+ String url = interfaceUrl[0].replace("${accesstoken}",token);
+ QywxSendMsgResponse response = sendHttpRequestSingle(url,interfaceUrl[1],JSONObject.toJSONString(param)
+ ,new TypeReference<QywxSendMsgResponse>(){});
+ if(response.getErrcode()!=null && response.getErrcode() ==0){
+ return response;
+ }
+ }catch (Exception e){
+
}
+
return null;
}
public static List<QywxUserListResponse> getUserList(String token,String depatId) {
@@ -114,6 +119,29 @@
}
return null;
}
+ public static QywxBaseResponse<String> getUserInfoByCode(String token,String code) {
+ String[] interfaceUrl = QywxConstant.GET_USER_BY_AUTH_CODE;
+ String url = interfaceUrl[0].replace("${accesstoken}",token).replace("${code}",code);
+ QywxBaseResponse<String> response = sendHttpRequest(url,interfaceUrl[1],""
+ ,new TypeReference<QywxBaseResponse<String>>(){});
+ if(response.getErrcode()!=null && response.getErrcode() ==0){
+ return response;
+ }
+ return null;
+ }
+
+
+ public static String getJsApiTicket(String token) {
+ String[] interfaceUrl = QywxConstant.GET_JSAPI_TICKET;
+ String url = interfaceUrl[0].replace("${accesstoken}",token);
+ QywxBaseResponse<String> response = sendHttpRequest(url,interfaceUrl[1],""
+ ,new TypeReference<QywxBaseResponse<String>>(){});
+ if(response.getErrcode()!=null && response.getErrcode() ==0){
+ return response.getJsapi_ticket();
+ }
+ return null;
+ }
+
/**
* 鍙戣捣wms鎺ュ彛璇锋眰
--
Gitblit v1.9.3