From 55334da20cff4dac840c320eda1d0ca53ba27eda Mon Sep 17 00:00:00 2001 From: fwq <582742538@qq.com> Date: 星期一, 23 九月 2024 14:26:36 +0800 Subject: [PATCH] Merge branch 'master-stander' into master-xlk --- src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java | 33 ++++++++++++++++++++++++++++++--- 1 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java b/src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java index f1be76e..90fe3d4 100644 --- a/src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java +++ b/src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java @@ -3,6 +3,8 @@ import com.hx.util.OSSUtil; import com.hx.util.SimpleTool; import com.hx.util.StringUtils; +import com.hz.util.http.HttpHzUtil; +import com.hz.util.http.dto.HttpHzResponse; import net.sf.json.JSONException; import net.sf.json.JSONObject; import org.apache.commons.codec.binary.Base64; @@ -14,6 +16,7 @@ import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.text.MessageFormat; import java.text.SimpleDateFormat; import java.util.Date; @@ -34,12 +37,16 @@ private static final String JSCODE2SESSION_URL = "https://api.weixin.qq.com/sns/jscode2session?"; /**鍙戦�佽闃呮秷鎭�氱煡閾炬帴*/ private static final String SEND_SUBSCRIBE_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="; - //鐢熸垚灏忕▼搴忎簩缁寸爜鍦板潃锛堟柟褰級 + /**鐢熸垚灏忕▼搴忎簩缁寸爜鍦板潃锛堟柟褰級*/ public static final String MAKE_TWOCODE_SQUARE_URL = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token="; - //鐢熸垚灏忕▼搴忎簩缁寸爜鍦板潃锛堝渾褰級 + /**鐢熸垚灏忕▼搴忎簩缁寸爜鍦板潃锛堝渾褰級*/ public static final String MAKE_TWOCODE_ROUND_URL = "https://api.weixin.qq.com/wxa/getwxacode?access_token={0}"; - //鐢熸垚鏃犻檺浜岀淮鐮� + /**鐢熸垚鏃犻檺浜岀淮鐮�*/ public static final String URL_UNLIMIT_SQUARE = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={0}"; + /**鑾峰彇灏忕▼搴忚闃呬釜浜烘ā鏉垮垪琛�*/ + private static final String GET_APP_TEMPLATE = "https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token="; + /**鑾峰彇鍏紬鍙锋ā鏉垮垪琛�*/ + private static final String GET_GZH_TEMPLATE = "https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token="; ////////////////////////////////////////////////// /** (灏忕▼搴�)閫氳繃code鎹㈠彇缃戦〉鎺堟潈access_token/濡傛灉鏄痵nsapi_base妯″紡鐨勬巿鏉冿紝杩欓噷灏卞彲浠ユ嬁鍒皁penId浜� ***/ @@ -740,6 +747,10 @@ obj.put("line_color", lineColor); obj.put("is_hyaline", isHyaline); obj.put("env_version", env_version); + //浣撻獙鐗堟椂锛屽彲涓嶆鏌ラ〉闈㈡槸鍚﹀瓨鍦� + if("trial".equals(env_version)){ + obj.put("check_path", false); + } // 鍒涘缓url璧勬簮 URL url = new URL(StringUtils.format(URL_UNLIMIT_SQUARE, at)); // 寤虹珛http杩炴帴 @@ -812,4 +823,20 @@ return file; } + /** + * 鑾峰彇灏忕▼搴忚闃呮ā鏉� + * @param accessToken token + * **/ + public static HttpHzResponse appTemplateList(String accessToken) { + return HttpHzUtil.HttpURLUtilJson(GET_APP_TEMPLATE + accessToken, null,null,null,"GET",null); + } + + /** + * 鍏紬鍙疯闃呮ā鏉� + * @param accessToken token + * **/ + public static HttpHzResponse gzhTemplateList(String accessToken) { + return HttpHzUtil.HttpURLUtilJson(GET_GZH_TEMPLATE+accessToken, null,null,null,"GET",null); + } + } -- Gitblit v1.8.0