diff --git a/hl-wechat/pom.xml b/hl-wechat/pom.xml
new file mode 100644
index 0000000..62bab8f
--- /dev/null
+++ b/hl-wechat/pom.xml
@@ -0,0 +1,19 @@
+
+
+
+ ruoyi
+ com.ruoyi
+ 3.8.1
+
+ 4.0.0
+
+ hl-wechat
+
+
+ 8
+ 8
+
+
+
\ No newline at end of file
diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/config/VideoConfig.java b/hl-wechat/src/main/java/com/ruoyi/hl/config/VideoConfig.java
new file mode 100644
index 0000000..dc4f51e
--- /dev/null
+++ b/hl-wechat/src/main/java/com/ruoyi/hl/config/VideoConfig.java
@@ -0,0 +1,10 @@
+package com.ruoyi.system.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+
+@Data
+public class VideoConfig {
+ @Value("video.baseUrl")
+ private String baseUrl;
+}
diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/config/WxConfig.java b/hl-wechat/src/main/java/com/ruoyi/hl/config/WxConfig.java
new file mode 100644
index 0000000..27229b6
--- /dev/null
+++ b/hl-wechat/src/main/java/com/ruoyi/hl/config/WxConfig.java
@@ -0,0 +1,58 @@
+package com.ruoyi.system.config;
+
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WxConfig {
+
+ @Value("${wx.public.secret}")
+ @Getter
+ @Setter
+ private String publicSecret;
+
+ @Value("${wx.public.appid}")
+ @Getter
+ @Setter
+ private String publicAppid;
+
+
+ @Value("${wx.public.redirect_uri}")
+ @Getter
+ @Setter
+ private String redirectUrl;
+
+ @Getter
+ private String authUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect";
+
+
+
+
+
+
+ public enum SignType {
+ MD5, HMACSHA256;
+ }
+ public enum ResultCode{
+ FAIL,SUCCESS
+ }
+
+ public static final String HMACSHA256 = "HMAC-SHA256";
+ public static final String MD5 = "MD5";
+
+ public static final String FIELD_SIGN = "sign";
+ public static final String FIELD_SIGN_TYPE = "sign_type";
+
+
+ //获取程序码的请求接口
+ public static final int UNLIMITED_TYPE_IMAGE=1;//byte[]
+ public static final int UNLIMITED_TYPE_FAIL=3;//错误
+ public static final int UNLIMITED_TYPE_JSON=2;//json
+
+
+
+
+}
diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/controller/WxController.java b/hl-wechat/src/main/java/com/ruoyi/hl/controller/WxController.java
new file mode 100644
index 0000000..9a31f18
--- /dev/null
+++ b/hl-wechat/src/main/java/com/ruoyi/hl/controller/WxController.java
@@ -0,0 +1,44 @@
+package com.ruoyi.system.controller;
+
+import cn.hutool.core.util.StrUtil;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.config.WxConfig;
+import com.ruoyi.system.forest.clients.MiniWeChatClients;
+import com.ruoyi.system.forest.ptoto.WxPublicCode2UserInfoRes;
+import com.ruoyi.system.service.WxService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/wx")
+public class WxController {
+
+ @Autowired
+ private MiniWeChatClients weChatClients;
+
+ @Autowired
+ private WxService wxService;
+
+ @Autowired
+ private WxConfig wxConfig;
+
+
+ @RequestMapping("/getAuth/{id}")
+ public AjaxResult open(@PathVariable String id){
+ return AjaxResult.success(String.format(wxConfig.getAuthUrl(),wxConfig.getPublicAppid(),wxConfig.getRedirectUrl(),id ));
+ }
+
+ /*@RequestMapping("/code2videourl/{code}/{id}")
+ public AjaxResult code2videourl(@PathVariable String id,@PathVariable String code){
+ String openid="a";
+ WxPublicCode2UserInfoRes wxPublicCode2UserInfoRes=weChatClients.code2userinfo(wxConfig.getPublicAppid(),wxConfig.getPublicSecret(),code);
+ if (wxPublicCode2UserInfoRes.getErrcode()!=0){
+ return AjaxResult.error("获取openid错误");
+ }
+ openid=wxPublicCode2UserInfoRes.getOpenid();
+ return wxService.getOwnVideo(id,openid);
+ }*/
+}
diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java
new file mode 100644
index 0000000..3defbea
--- /dev/null
+++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java
@@ -0,0 +1,76 @@
+package com.ruoyi.system.forest.clients;
+
+
+import com.dtflys.forest.annotation.*;
+import com.ruoyi.system.forest.interceptor.UnlimitedInterceptor;
+import com.ruoyi.system.forest.interceptor.WriteLogInterceptor;
+import com.ruoyi.system.forest.ptoto.WxMiniCode2SessionRes;
+import com.ruoyi.system.forest.ptoto.WxMiniTokenRes;
+import com.ruoyi.system.forest.ptoto.WxPublicCode2UserInfoRes;
+import com.ruoyi.system.forest.ptoto.WxUserInfoRes;
+
+import java.util.Map;
+
+@BaseRequest(baseURL = "${wechat_clients_url}")
+public interface MiniWeChatClients {
+
+ /**
+ * 获取access_token
+ * @param appid
+ * @param secret
+ * @return
+ */
+ @GetRequest(url = "/cgi-bin/token?grant_type=client_credential&appid=${appid}&secret=${secret}",
+ dataType ="json",interceptor = WriteLogInterceptor.class
+ )
+ WxMiniTokenRes token(@Var("appid") String appid, @Var("secret") String secret);
+
+ /**
+ * 获取信息
+ *
+ * @return
+ */
+ @GetRequest(url = "/cgi-bin/user/info?access_token=${token}&openid=${openid}&lang=zh_CN",
+ dataType ="json",interceptor = WriteLogInterceptor.class
+ )
+ WxUserInfoRes userInfo(@Var("token") String token, @Var("openid") String openid);
+
+
+ /**
+ * 获取用户信息
+ * @param appid
+ * @param secret
+ * @param code
+ * @return
+ */
+ @GetRequest(
+ url = "/sns/jscode2session?appid=${appid}&secret=${secret}&js_code=${code}&grant_type=authorization_code",
+ interceptor = WriteLogInterceptor.class,dataType = "json"
+ )
+ WxMiniCode2SessionRes code2session(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code);
+
+ /**
+ * 获取公众号用户信息
+ * @param appid
+ * @param secret
+ * @param code
+ * @return
+ */
+ @GetRequest(
+ url = "/sns/oauth2/access_token?appid=${appid}&secret=${secret}&code=${code}&grant_type=authorization_code",
+ interceptor = WriteLogInterceptor.class,dataType = "json"
+ )
+ WxPublicCode2UserInfoRes code2userinfo(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code);
+
+
+ /**
+ * 获取分享码
+ * @param token
+ * @param params
+ */
+ @PostRequest(url = "/wxa/getwxacodeunlimit?access_token=${token}",
+ contentType = "application/json",
+ interceptor = UnlimitedInterceptor.class)
+ byte[] getUnlimited(@Var("token")String token, @Body Map params);
+
+}
diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java
new file mode 100644
index 0000000..f3bdaff
--- /dev/null
+++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java
@@ -0,0 +1,38 @@
+package com.ruoyi.system.forest.interceptor;
+
+
+import com.dtflys.forest.exceptions.ForestRuntimeException;
+import com.dtflys.forest.http.ForestRequest;
+import com.dtflys.forest.http.ForestResponse;
+import com.dtflys.forest.interceptor.Interceptor;
+
+
+import com.ruoyi.common.utils.BytesUtil;
+import com.ruoyi.system.config.WxConfig;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class UnlimitedInterceptor implements Interceptor