From 5e8136f6481581b606d053e84f624bf7f919c310 Mon Sep 17 00:00:00 2001 From: fhx <308050795@qq.com> Date: 星期四, 06 四月 2023 10:50:56 +0800 Subject: [PATCH] 1.增加生成小程序连接方法 --- src/main/java/com/hx/mp/util/MpUtil.java | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/mp/util/MpUtil.java b/src/main/java/com/hx/mp/util/MpUtil.java index cad3924..1c64291 100644 --- a/src/main/java/com/hx/mp/util/MpUtil.java +++ b/src/main/java/com/hx/mp/util/MpUtil.java @@ -1,5 +1,6 @@ package com.hx.mp.util; +import com.hx.util.HttpMethodUtil; import com.hx.util.StringUtils; import net.sf.json.JSONException; import net.sf.json.JSONObject; @@ -14,6 +15,8 @@ import java.sql.Timestamp; import java.text.MessageFormat; import java.util.Date; +import java.util.HashMap; +import java.util.Map; /** * 寰俊灏忕▼搴忓伐鍏风被 @@ -354,4 +357,21 @@ return qrStr; } + /** + * 鑾峰彇灏忕▼搴忛摼鎺� + * @param token 灏忕▼搴弔oken + * @param path 灏忕▼搴忛〉闈㈣矾寰� + * @param query 浼犲�煎弬鏁� + * @param env_version + * @return 瑕佹墦寮�鐨勫皬绋嬪簭鐗堟湰銆傛寮忕増涓� "release"锛屼綋楠岀増涓�"trial"锛屽紑鍙戠増涓�"develop"锛屼粎鍦ㄥ井淇″鎵撳紑鏃剁敓鏁� + */ + public static String getAooLetUrl(String token, String path, String query, String env_version) { + Map<String, Object> map = new HashMap<>(); + map.put("access_token", token); + JSONObject data = new JSONObject(); + data.put("path", path); + data.put("query", query); + data.put("env_version", env_version); + return HttpMethodUtil.HttpURLUtilJson("https://api.weixin.qq.com/wxa/generate_urllink", data.toString(), map, null, "POST"); + } } -- Gitblit v1.8.0