src/main/java/com/hx/corp/util/WxCorpPayUtil.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/hx/mp/util/CorpMpUtil.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/hx/util/corp/CorpMpUtil.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/hx/util/corp/entity/AppLetInfo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/hx/corp/util/WxCorpPayUtil.java
@@ -1,10 +1,12 @@ package com.hx.corp.util; import com.alibaba.fastjson.JSON; import com.hx.util.corp.entity.AppLetInfo; import com.hx.corp.entity.CorpPayRequest; import com.hx.corp.entity.CorpPayResponse; import com.hx.exception.ServiceException; import com.hx.mp.util.*; import com.hx.util.HttpMethodUtil; import com.hx.util.SimpleTool; import com.hx.util.StringUtils; import net.sf.json.JSONObject; src/main/java/com/hx/mp/util/CorpMpUtil.java
@@ -1,13 +1,12 @@ package com.hx.mp.util; import com.hx.corp.entity.AppLetInfo; import com.hx.util.corp.entity.AppLetInfo; import com.hx.exception.TipsException; import com.hx.util.HttpMethodUtil; import com.hx.util.StringUtils; import net.sf.json.JSONException; import net.sf.json.JSONObject; import org.apache.commons.io.IOUtils; import org.apache.poi.util.SystemOutLogger; import java.io.OutputStream; import java.net.HttpURLConnection; @@ -43,8 +42,7 @@ public static final String URL_INFO_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={0}&userid={1}"; /**发送消息*/ public static final String URL_MESSAGE_SEND = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="; /*生成小程序链接*/ public static final String URL_LINK = "https://api.weixin.qq.com/wxa/generate_urllink"; /** * 添加工作人员 @@ -346,25 +344,4 @@ return obj; } /** * 生成小程序链接 * @param path 通过 URL Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query 。path 为空时会跳转小程序主页 * @param token 接口调用凭证,该参数为 URL 参数,非 Body 参数。使用getAccessToken 或者 * @param env_version 默认值"release"。要打开的小程序版本。正式版为 "release",体验版为"trial",开发版为"develop",仅在微信外打开时生效。 * @param query 通过 URL Link 进入小程序时的query,最大1024个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~% * @return appLetInfo */ public static AppLetInfo getAppLetUrl(String path, String token, String env_version, String query) { Map<String, Object> map = new HashMap(); map.put("access_token", token); com.alibaba.fastjson.JSONObject data = new com.alibaba.fastjson.JSONObject(); data.put("path", path); data.put("env_version", env_version); if (!StringUtils.isEmpty(query)){ data.put("query", query); } String datas = HttpMethodUtil.HttpURLUtilJson(URL_LINK, data.toString(), map, (Map)null, "POST"); AppLetInfo appLetInfo = com.alibaba.fastjson.JSONObject.parseObject(datas, AppLetInfo.class); return appLetInfo; } } src/main/java/com/hx/util/corp/CorpMpUtil.java
@@ -2,6 +2,8 @@ import com.alibaba.fastjson.JSONObject; import com.hx.util.HttpMethodUtil; import com.hx.util.StringUtils; import com.hx.util.corp.entity.AppLetInfo; import com.hx.util.corp.entity.OpenIdAUserId; import com.hx.util.corp.entity.WeiXinInfo; import org.slf4j.Logger; @@ -29,7 +31,7 @@ public static final String URL_USERID_TO_OPENID = "https://qyapi.weixin.qq.com/cgi-bin/user/convert_to_openid"; /**获取小程序链接*/ public static final String URL_USERID_TO_APPLET = "https://api.weixin.qq.com/wxa/generate_urllink"; public static final String URL_LINK = "https://api.weixin.qq.com/wxa/generate_urllink"; /** @@ -83,4 +85,17 @@ return weiXinInfo; } public static AppLetInfo getAppLetUrl(String path, String token, String env_version, String query) { Map<String, Object> map = new HashMap(); map.put("access_token", token); com.alibaba.fastjson.JSONObject data = new com.alibaba.fastjson.JSONObject(); data.put("path", path); data.put("env_version", env_version); if (!StringUtils.isEmpty(query)){ data.put("query", query); } String datas = HttpMethodUtil.HttpURLUtilJson(URL_LINK, data.toString(), map, (Map)null, "POST"); AppLetInfo appLetInfo = com.alibaba.fastjson.JSONObject.parseObject(datas, AppLetInfo.class); return appLetInfo; } } src/main/java/com/hx/util/corp/entity/AppLetInfo.java
File was renamed from src/main/java/com/hx/corp/entity/AppLetInfo.java @@ -1,4 +1,4 @@ package com.hx.corp.entity; package com.hx.util.corp.entity; import com.alibaba.fastjson.annotation.JSONField; import lombok.Data;