From ca3f24a94f908ae2c5fca25e6d78cdca00c69e85 Mon Sep 17 00:00:00 2001 From: nolan <799753704@qq.com> Date: Mon, 21 Mar 2022 18:21:49 +0800 Subject: [PATCH] first commit --- hl-wechat/pom.xml | 19 + .../java/com/ruoyi/hl/config/VideoConfig.java | 10 + .../java/com/ruoyi/hl/config/WxConfig.java | 58 +++ .../com/ruoyi/hl/controller/WxController.java | 44 +++ .../hl/forest/clients/MiniWeChatClients.java | 76 ++++ .../interceptor/UnlimitedInterceptor.java | 38 ++ .../interceptor/WriteLogInterceptor.java | 29 ++ .../hl/forest/ptoto/WxAuthAccessTokenRes.java | 13 + .../hl/forest/ptoto/WxGetUnlimitedRes.java | 9 + .../forest/ptoto/WxMiniCode2SessionRes.java | 17 + .../ruoyi/hl/forest/ptoto/WxMiniTokenRes.java | 10 + .../ptoto/WxPublicCode2UserInfoRes.java | 17 + .../hl/forest/ptoto/WxPublickTokenRes.java | 10 + .../java/com/ruoyi/hl/forest/ptoto/WxRes.java | 13 + .../hl/forest/ptoto/WxSendTemplateRes.java | 9 + .../ruoyi/hl/forest/ptoto/WxUserInfoRes.java | 26 ++ .../java/com/ruoyi/hl/service/WxService.java | 48 +++ .../com/ruoyi/hl/service/WxTokenService.java | 111 ++++++ hl-wechat/src/main/resources/application.yml | 123 +++++++ .../java/com/ruoyi/hl/config/VideoConfig.java | 10 + .../java/com/ruoyi/hl/config/WxConfig.java | 58 +++ .../com/ruoyi/hl/controller/WxController.java | 41 +++ .../hl/forest/clients/MiniWeChatClients.java | 76 ++++ .../interceptor/UnlimitedInterceptor.java | 37 ++ .../interceptor/WriteLogInterceptor.java | 29 ++ .../hl/forest/ptoto/WxAuthAccessTokenRes.java | 13 + .../hl/forest/ptoto/WxGetUnlimitedRes.java | 9 + .../forest/ptoto/WxMiniCode2SessionRes.java | 17 + .../ruoyi/hl/forest/ptoto/WxMiniTokenRes.java | 10 + .../ptoto/WxPublicCode2UserInfoRes.java | 17 + .../hl/forest/ptoto/WxPublickTokenRes.java | 10 + .../java/com/ruoyi/hl/forest/ptoto/WxRes.java | 13 + .../hl/forest/ptoto/WxSendTemplateRes.java | 9 + .../ruoyi/hl/forest/ptoto/WxUserInfoRes.java | 26 ++ .../java/com/ruoyi/hl/service/WxService.java | 43 +++ .../com/ruoyi/hl/service/WxTokenService.java | 108 ++++++ .../controller/ilisteners/PutProcessData.java | 10 + .../ruoyi/web/controller/mapper/FileDao.java | 2 + .../ruoyi/web/controller/mapper/VideoDao.java | 12 + .../controller/upload/BFileController.java | 104 ++++++ .../upload/BVideoAllowController.java | 104 ++++++ .../controller/upload/BVideosController.java | 104 ++++++ .../upload/ShortLinkController.java | 44 +++ .../controller/upload/VideosController.java | 2 + .../com/ruoyi/web/serveice/UploadService.java | 2 + .../common/config/CloudStorageConfig.java | 237 ++++++++++++ .../com/ruoyi/common/config/ToolConfig.java | 50 +++ .../com/ruoyi/common/utils/BytesUtil.java | 78 ++++ .../ilisteners/PutObjectProgressListener.java | 79 ++++ .../web/ilisteners/PutProcessData.java | 10 + .../framework/web/service/AliOSSService.java | 2 + .../java/com/ruoyi/system/domain/BFile.java | 81 +++++ .../com/ruoyi/system/domain/BVideoAllow.java | 109 ++++++ .../java/com/ruoyi/system/domain/BVideos.java | 137 +++++++ .../com/ruoyi/system/mapper/BFileMapper.java | 61 ++++ .../system/mapper/BVideoAllowMapper.java | 61 ++++ .../ruoyi/system/mapper/BVideosMapper.java | 61 ++++ .../ruoyi/system/service/IBFileService.java | 61 ++++ .../system/service/IBVideoAllowService.java | 61 ++++ .../ruoyi/system/service/IBVideosService.java | 61 ++++ .../system/service/impl/BFileServiceImpl.java | 93 +++++ .../service/impl/BVideoAllowServiceImpl.java | 93 +++++ .../service/impl/BVideosServiceImpl.java | 93 +++++ .../resources/mapper/system/BFileMapper.xml | 66 ++++ .../mapper/system/BVideoAllowMapper.xml | 76 ++++ .../resources/mapper/system/BVideosMapper.xml | 86 +++++ ruoyi-ui/src/api/system/allow.js | 44 +++ ruoyi-ui/src/api/system/file.js | 44 +++ ruoyi-ui/src/api/system/videos.js | 44 +++ ruoyi-ui/src/views/system/allow/index.vue | 310 ++++++++++++++++ ruoyi-ui/src/views/system/file/index.vue | 282 ++++++++++++++ ruoyi-ui/src/views/system/manage/files.vue | 279 ++++++++++++++ .../src/views/system/manage/selectFiles.vue | 343 ++++++++++++++++++ ruoyi-ui/src/views/system/videos/index.vue | 336 +++++++++++++++++ 74 files changed, 4928 insertions(+) create mode 100644 hl-wechat/pom.xml create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/config/VideoConfig.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/config/WxConfig.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/controller/WxController.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/service/WxService.java create mode 100644 hl-wechat/src/main/java/com/ruoyi/hl/service/WxTokenService.java create mode 100644 hl-wechat/src/main/resources/application.yml create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/config/VideoConfig.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/config/WxConfig.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/controller/WxController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxTokenService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/ilisteners/PutProcessData.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/FileDao.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/VideoDao.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BFileController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideoAllowController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideosController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/ShortLinkController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/VideosController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/serveice/UploadService.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/config/CloudStorageConfig.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/config/ToolConfig.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/BytesUtil.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutObjectProgressListener.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutProcessData.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AliOSSService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/BFile.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideoAllow.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideos.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/BFileMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideoAllowMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideosMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IBFileService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideoAllowService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideosService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BFileServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideoAllowServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideosServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/BFileMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/system/BVideoAllowMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/system/BVideosMapper.xml create mode 100644 ruoyi-ui/src/api/system/allow.js create mode 100644 ruoyi-ui/src/api/system/file.js create mode 100644 ruoyi-ui/src/api/system/videos.js create mode 100644 ruoyi-ui/src/views/system/allow/index.vue create mode 100644 ruoyi-ui/src/views/system/file/index.vue create mode 100644 ruoyi-ui/src/views/system/manage/files.vue create mode 100644 ruoyi-ui/src/views/system/manage/selectFiles.vue create mode 100644 ruoyi-ui/src/views/system/videos/index.vue 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 { + + @Override + public void onError(ForestRuntimeException e, ForestRequest forestRequest, ForestResponse forestResponse) { + log.error("---> UnlimitedInterceptor error: ",e); + int type= WxConfig.UNLIMITED_TYPE_FAIL; + byte[] bytes= BytesUtil.typeAndPayloadMerger(BytesUtil.int2Bytes(type),new byte[0]); + forestResponse.setResult(bytes); + } + + + @Override + public void onSuccess(Object s, ForestRequest forestRequest, ForestResponse forestResponse) { + int type= WxConfig.UNLIMITED_TYPE_FAIL; + if (forestResponse.getContentType().isApplication()&&forestResponse.getContentType().isJson()){ + type=WxConfig.UNLIMITED_TYPE_JSON; + }else if (forestResponse.getContentType().isImage()){ + type=WxConfig.UNLIMITED_TYPE_IMAGE; + } + byte[] bytes=BytesUtil.typeAndPayloadMerger(BytesUtil.int2Bytes(type),(byte[])s);//设定前4(含)位是返回内容格式,后4位是内容 + forestResponse.setResult(bytes); + + } +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java new file mode 100644 index 0000000..4919b4e --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.forest.interceptor; + +import com.alibaba.fastjson.JSONObject; +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 lombok.extern.slf4j.Slf4j; + +@Slf4j +public class WriteLogInterceptor implements Interceptor { + + + @Override + public void onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) { + log.error("forest error",ex); + } + + @Override + public void onSuccess(Object data, ForestRequest request, ForestResponse response) { + try { + + log.debug("forest result content:{}", JSONObject.toJSONString(data)); + }catch (Exception e){ + log.warn("forest parse json fail"); + } + + } +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java new file mode 100644 index 0000000..58b3acf --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.Data; + +@Data +public class WxAuthAccessTokenRes extends WxRes{ + private String openid; + private String scope; + private String refreshToken; + private String accessToken; + private Long expiresIn; + +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java new file mode 100644 index 0000000..58ec41e --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java @@ -0,0 +1,9 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.Data; + +@Data +public class WxGetUnlimitedRes extends WxRes{ + private String contentType; + private byte[] buffer; +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java new file mode 100644 index 0000000..31504a9 --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java @@ -0,0 +1,17 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class WxMiniCode2SessionRes extends WxRes{ + private String openid; + private String sessionKey; + private String unionid; + + + + public WxMiniCode2SessionRes() { + } +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java new file mode 100644 index 0000000..09354fb --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java @@ -0,0 +1,10 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.Data; + +@Data +public class WxMiniTokenRes extends WxRes{ + private String accessToken; + private Long expiresIn; + +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java new file mode 100644 index 0000000..c2c86dd --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java @@ -0,0 +1,17 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class WxPublicCode2UserInfoRes extends WxRes{ + private String openid;//用户唯一标识 + private String refreshToken;//用户刷新access_token + private String accessToken;//网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同 + private String scope;//用户授权的作用域,使用逗号(,)分隔 + private Long expiresIn;//access_token接口调用凭证超时时间,单位(秒) + + public WxPublicCode2UserInfoRes() { + } +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java new file mode 100644 index 0000000..3153424 --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java @@ -0,0 +1,10 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.Data; + +@Data +public class WxPublickTokenRes extends WxRes{ + private String accessToken; + private Long expiresIn; + +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java new file mode 100644 index 0000000..361d683 --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.Data; + +@Data +public class WxRes { + private String errmsg; + private Integer errcode; + + public boolean isSuccess(){ + return this.errcode!=null&&this.errcode==0; + } +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java new file mode 100644 index 0000000..159658c --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java @@ -0,0 +1,9 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.Data; + +@Data +public class WxSendTemplateRes extends WxRes{ + + private String msgId; +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java new file mode 100644 index 0000000..caff0b5 --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.forest.ptoto; + +import lombok.Data; + +import java.util.List; + +@Data +public class WxUserInfoRes{ + private int subscribe; + private String openid; + private String nickname; + private String headimgurl; + private int sex; + private String language; + private String city; + private String province; + private String country; + private long subscribeTime; + private String unionid; + private String remark; + private int groupid; + private List tagidList; + private String subscribeScene; + private long qrScene; + private String qrSceneStr; +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/service/WxService.java b/hl-wechat/src/main/java/com/ruoyi/hl/service/WxService.java new file mode 100644 index 0000000..ed77657 --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/service/WxService.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.service; + +import cn.hutool.core.util.StrUtil; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class WxService { + + /*@Autowired + private IBVideoAllowService ibVideoAllowService; + + @Autowired + private IBVideosService videosService; + + @Autowired + private VideoConfig videoConfig; + + + public synchronized AjaxResult getOwnVideo(String id, String openid){ + + BVideoAllow bVideoAllow =new BVideoAllow(); + bVideoAllow.setAllowId(id); + List list= ibVideoAllowService.selectBVideoAllowList(bVideoAllow); + if (list==null||list.size()==0){ + return AjaxResult.error(404,"未找到链接"); + } + BVideoAllow allow=list.get(0);//允许对象 + + String loadOpenid=allow.getWxOpenid(); + if (StrUtil.isBlankIfStr(loadOpenid)){ + allow.setWxOpenid(openid); + ibVideoAllowService.updateBVideoAllow(allow); + + }else if (!loadOpenid.equals(openid)){ + return AjaxResult.error(401,"视频已被绑定"); + } + BVideos videos=videosService.selectBVideosById(allow.getVideoId()); + if (videos==null){ + return AjaxResult.error(404,"未找到视频"); + } + + return AjaxResult.success(id+"----"+openid); + }*/ +} diff --git a/hl-wechat/src/main/java/com/ruoyi/hl/service/WxTokenService.java b/hl-wechat/src/main/java/com/ruoyi/hl/service/WxTokenService.java new file mode 100644 index 0000000..e8815c5 --- /dev/null +++ b/hl-wechat/src/main/java/com/ruoyi/hl/service/WxTokenService.java @@ -0,0 +1,111 @@ +package com.ruoyi.system.service; + + +import cn.hutool.core.util.StrUtil; + +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.system.config.WxConfig; +import com.ruoyi.system.forest.clients.MiniWeChatClients; +import com.ruoyi.system.forest.ptoto.WxMiniTokenRes; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + + +import java.util.concurrent.TimeUnit; + +@Service +@Slf4j +public class WxTokenService implements CommandLineRunner { + + private static String pTokenK = "k_wx_public_token_29"; + + + + @Autowired + private MiniWeChatClients miniWeChatClients; + + + //@Autowired + private RedisCache redisCache; + + @Autowired + private WxConfig wxConfig; + + @Override + public void run(String... args) throws Exception { + //refreshToken();//刷新token + } + + + public String getPublickToken() { + String pToken = redisCache.getCacheObject(pTokenK); + if (StrUtil.isBlankIfStr(pToken)) { + log.info("---> expire, refresh token"); + return refreshPublicToken(); + } + return pToken; + } + + + /** + * 每分钟检测redis里的token是否到期 + */ + //@Scheduled(cron = "0 * * * * ?") + public void refreshToken() { + String pToken = redisCache.getCacheObject(pTokenK); + if (pToken == null || pToken.equals("token")) { + refreshPublicToken(); + } + } + + /** + * 刷新公众号token + */ + public synchronized String refreshPublicToken() { + String pToken = redisCache.getCacheObject(pTokenK); + if (!StrUtil.isBlankIfStr(pToken)) { + log.info("---> valid token"); + return pToken; + } + + + + String token=null; + try { + log.info("--> refreshPublicToken refresh start"); + + String publicSecret= wxConfig.getPublicSecret(); + String publicAppid= wxConfig.getPublicAppid(); + if (StrUtil.isBlank(publicSecret) || StrUtil.isBlank(publicAppid)) { + log.info("---> pSecretV or pAppidV is empty"); + return token; + } + + WxMiniTokenRes wxMiniTokenRes = miniWeChatClients.token(publicAppid, publicSecret); + if (wxMiniTokenRes.getAccessToken() != null && wxMiniTokenRes.getExpiresIn() != null) { + token = wxMiniTokenRes.getAccessToken(); + Long expireTime = wxMiniTokenRes.getExpiresIn() - (wxMiniTokenRes.getExpiresIn() / 4);//redis超时时间是原时间的3/4 + + + + redisCache.setCacheObject(pTokenK, token, expireTime.intValue(), TimeUnit.SECONDS); + //stringRedisTemplate.opsForValue().set(pTokenK, token, expireTime, TimeUnit.SECONDS);//token存放到redis,设置超时时间 + + log.info("---> public expireTime:{}, token:{}", expireTime, token); + } else { + log.info("---> refresh public token fail, msg:{}, code:{}", wxMiniTokenRes.getErrmsg(), wxMiniTokenRes.getErrcode()); + } + log.info("--> refreshPublicToken refresh end"); + } catch (Exception e) { + e.printStackTrace(); + log.error("---> refreshPublicToken() exception, ", e); + } + return token; + } + + +} diff --git a/hl-wechat/src/main/resources/application.yml b/hl-wechat/src/main/resources/application.yml new file mode 100644 index 0000000..141698b --- /dev/null +++ b/hl-wechat/src/main/resources/application.yml @@ -0,0 +1,123 @@ +#微信配置 + +wx: + public: + redirect_uri: http://asdf.com + appid: aa + secret: bb + +video: + baseUrl: +forest: + variables: + wechat_clients_url: https://api.weixin.qq.com + wechat_mch_clients_url: https://api.mch.weixin.qq.com + ## 日志总开关,打开/关闭Forest请求/响应日志 + log-enabled: true + ## 打开/关闭Forest请求日志 + log-request: false + ## 打开/关闭Forest响应状态日志 + log-response-status: true + ## 打开/关闭Forest响应内容日志 + log-response-content: true + + + + +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8081 + port: 8081 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # 连接数满后的排队数,默认为100 + accept-count: 1000 + threads: + # tomcat最大线程数,默认为200 + max: 800 + # Tomcat启动初始化的线程数,默认值10 + min-spare: 100 + +# 日志配置 +logging: + level: + com.ruoyi: debug + org.springframework: warn + +# Spring配置 +spring: + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: druid + # 文件上传 + servlet: + multipart: + # 单个文件大小 + max-file-size: 10MB + # 设置总上传的文件大小 + max-request-size: 20MB + # 服务模块 + devtools: + restart: + # 热部署开关 + enabled: true + # redis 配置 + redis: + # 地址 + host: 192.168.1.182 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码 + password: + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + +# MyBatis配置 +mybatis: + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mapper/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml + +# PageHelper分页插件 +pagehelper: + helperDialect: mysql + supportMethodsArguments: true + params: count=countSql + +# Swagger配置 +swagger: + # 是否开启swagger + enabled: true + # 请求前缀 + pathMapping: /wechat + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: /system/notice + # 匹配链接 + urlPatterns: /system/*,/monitor/*,/tool/* diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/config/VideoConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/config/VideoConfig.java new file mode 100644 index 0000000..e5d0567 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/config/VideoConfig.java @@ -0,0 +1,10 @@ +package hl.config; + +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; + +@Data +public class VideoConfig { + @Value("video.baseUrl") + private String baseUrl; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/config/WxConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/config/WxConfig.java new file mode 100644 index 0000000..f193cab --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/config/WxConfig.java @@ -0,0 +1,58 @@ +package hl.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/ruoyi-admin/src/main/java/com/ruoyi/hl/controller/WxController.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/controller/WxController.java new file mode 100644 index 0000000..a1c973c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/controller/WxController.java @@ -0,0 +1,41 @@ +package hl.controller; + +import com.ruoyi.common.core.domain.AjaxResult; +import hl.config.WxConfig; +import hl.forest.clients.MiniWeChatClients; +import hl.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/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java new file mode 100644 index 0000000..d06eb0a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/clients/MiniWeChatClients.java @@ -0,0 +1,76 @@ +package hl.forest.clients; + + +import com.dtflys.forest.annotation.*; +import hl.forest.interceptor.UnlimitedInterceptor; +import hl.forest.interceptor.WriteLogInterceptor; +import hl.forest.ptoto.WxMiniCode2SessionRes; +import hl.forest.ptoto.WxMiniTokenRes; +import hl.forest.ptoto.WxPublicCode2UserInfoRes; +import hl.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/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java new file mode 100644 index 0000000..02d2d87 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/UnlimitedInterceptor.java @@ -0,0 +1,37 @@ +package hl.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 hl.config.WxConfig; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class UnlimitedInterceptor implements Interceptor { + + @Override + public void onError(ForestRuntimeException e, ForestRequest forestRequest, ForestResponse forestResponse) { + log.error("---> UnlimitedInterceptor error: ",e); + int type= WxConfig.UNLIMITED_TYPE_FAIL; + byte[] bytes= BytesUtil.typeAndPayloadMerger(BytesUtil.int2Bytes(type),new byte[0]); + forestResponse.setResult(bytes); + } + + + @Override + public void onSuccess(Object s, ForestRequest forestRequest, ForestResponse forestResponse) { + int type= WxConfig.UNLIMITED_TYPE_FAIL; + if (forestResponse.getContentType().isApplication()&&forestResponse.getContentType().isJson()){ + type=WxConfig.UNLIMITED_TYPE_JSON; + }else if (forestResponse.getContentType().isImage()){ + type=WxConfig.UNLIMITED_TYPE_IMAGE; + } + byte[] bytes=BytesUtil.typeAndPayloadMerger(BytesUtil.int2Bytes(type),(byte[])s);//设定前4(含)位是返回内容格式,后4位是内容 + forestResponse.setResult(bytes); + + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java new file mode 100644 index 0000000..bdfbe54 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/interceptor/WriteLogInterceptor.java @@ -0,0 +1,29 @@ +package hl.forest.interceptor; + +import com.alibaba.fastjson.JSONObject; +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 lombok.extern.slf4j.Slf4j; + +@Slf4j +public class WriteLogInterceptor implements Interceptor { + + + @Override + public void onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) { + log.error("forest error",ex); + } + + @Override + public void onSuccess(Object data, ForestRequest request, ForestResponse response) { + try { + + log.debug("forest result content:{}", JSONObject.toJSONString(data)); + }catch (Exception e){ + log.warn("forest parse json fail"); + } + + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java new file mode 100644 index 0000000..35144a6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxAuthAccessTokenRes.java @@ -0,0 +1,13 @@ +package hl.forest.ptoto; + +import lombok.Data; + +@Data +public class WxAuthAccessTokenRes extends WxRes { + private String openid; + private String scope; + private String refreshToken; + private String accessToken; + private Long expiresIn; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java new file mode 100644 index 0000000..d36ae6e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxGetUnlimitedRes.java @@ -0,0 +1,9 @@ +package hl.forest.ptoto; + +import lombok.Data; + +@Data +public class WxGetUnlimitedRes extends WxRes { + private String contentType; + private byte[] buffer; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java new file mode 100644 index 0000000..4041541 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniCode2SessionRes.java @@ -0,0 +1,17 @@ +package hl.forest.ptoto; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class WxMiniCode2SessionRes extends WxRes { + private String openid; + private String sessionKey; + private String unionid; + + + + public WxMiniCode2SessionRes() { + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java new file mode 100644 index 0000000..5397367 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxMiniTokenRes.java @@ -0,0 +1,10 @@ +package hl.forest.ptoto; + +import lombok.Data; + +@Data +public class WxMiniTokenRes extends WxRes { + private String accessToken; + private Long expiresIn; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java new file mode 100644 index 0000000..99fd2e7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublicCode2UserInfoRes.java @@ -0,0 +1,17 @@ +package hl.forest.ptoto; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class WxPublicCode2UserInfoRes extends WxRes{ + private String openid;//用户唯一标识 + private String refreshToken;//用户刷新access_token + private String accessToken;//网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同 + private String scope;//用户授权的作用域,使用逗号(,)分隔 + private Long expiresIn;//access_token接口调用凭证超时时间,单位(秒) + + public WxPublicCode2UserInfoRes() { + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java new file mode 100644 index 0000000..7677246 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxPublickTokenRes.java @@ -0,0 +1,10 @@ +package hl.forest.ptoto; + +import lombok.Data; + +@Data +public class WxPublickTokenRes extends WxRes{ + private String accessToken; + private Long expiresIn; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java new file mode 100644 index 0000000..d7e0a8c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxRes.java @@ -0,0 +1,13 @@ +package hl.forest.ptoto; + +import lombok.Data; + +@Data +public class WxRes { + private String errmsg; + private Integer errcode; + + public boolean isSuccess(){ + return this.errcode!=null&&this.errcode==0; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java new file mode 100644 index 0000000..1c9edd3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxSendTemplateRes.java @@ -0,0 +1,9 @@ +package hl.forest.ptoto; + +import lombok.Data; + +@Data +public class WxSendTemplateRes extends WxRes { + + private String msgId; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java new file mode 100644 index 0000000..e9be302 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/forest/ptoto/WxUserInfoRes.java @@ -0,0 +1,26 @@ +package hl.forest.ptoto; + +import lombok.Data; + +import java.util.List; + +@Data +public class WxUserInfoRes{ + private int subscribe; + private String openid; + private String nickname; + private String headimgurl; + private int sex; + private String language; + private String city; + private String province; + private String country; + private long subscribeTime; + private String unionid; + private String remark; + private int groupid; + private List tagidList; + private String subscribeScene; + private long qrScene; + private String qrSceneStr; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxService.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxService.java new file mode 100644 index 0000000..07225c6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxService.java @@ -0,0 +1,43 @@ +package hl.service; + +import org.springframework.stereotype.Service; + +@Service +public class WxService { + + /*@Autowired + private IBVideoAllowService ibVideoAllowService; + + @Autowired + private IBVideosService videosService; + + @Autowired + private VideoConfig videoConfig; + + + public synchronized AjaxResult getOwnVideo(String id, String openid){ + + BVideoAllow bVideoAllow =new BVideoAllow(); + bVideoAllow.setAllowId(id); + List list= ibVideoAllowService.selectBVideoAllowList(bVideoAllow); + if (list==null||list.size()==0){ + return AjaxResult.error(404,"未找到链接"); + } + BVideoAllow allow=list.get(0);//允许对象 + + String loadOpenid=allow.getWxOpenid(); + if (StrUtil.isBlankIfStr(loadOpenid)){ + allow.setWxOpenid(openid); + ibVideoAllowService.updateBVideoAllow(allow); + + }else if (!loadOpenid.equals(openid)){ + return AjaxResult.error(401,"视频已被绑定"); + } + BVideos videos=videosService.selectBVideosById(allow.getVideoId()); + if (videos==null){ + return AjaxResult.error(404,"未找到视频"); + } + + return AjaxResult.success(id+"----"+openid); + }*/ +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxTokenService.java b/ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxTokenService.java new file mode 100644 index 0000000..530724e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hl/service/WxTokenService.java @@ -0,0 +1,108 @@ +package hl.service; + + +import cn.hutool.core.util.StrUtil; +import com.ruoyi.common.core.redis.RedisCache; + +import hl.config.WxConfig; +import hl.forest.clients.MiniWeChatClients; +import hl.forest.ptoto.WxMiniTokenRes; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Service; + +import java.util.concurrent.TimeUnit; + +@Service +@Slf4j +public class WxTokenService implements CommandLineRunner { + + private static String pTokenK = "k_wx_public_token_29"; + + + + @Autowired + private MiniWeChatClients miniWeChatClients; + + + //@Autowired + private RedisCache redisCache; + + @Autowired + private WxConfig wxConfig; + + @Override + public void run(String... args) throws Exception { + //refreshToken();//刷新token + } + + + public String getPublickToken() { + String pToken = redisCache.getCacheObject(pTokenK); + if (StrUtil.isBlankIfStr(pToken)) { + log.info("---> expire, refresh token"); + return refreshPublicToken(); + } + return pToken; + } + + + /** + * 每分钟检测redis里的token是否到期 + */ + //@Scheduled(cron = "0 * * * * ?") + public void refreshToken() { + String pToken = redisCache.getCacheObject(pTokenK); + if (pToken == null || pToken.equals("token")) { + refreshPublicToken(); + } + } + + /** + * 刷新公众号token + */ + public synchronized String refreshPublicToken() { + String pToken = redisCache.getCacheObject(pTokenK); + if (!StrUtil.isBlankIfStr(pToken)) { + log.info("---> valid token"); + return pToken; + } + + + + String token=null; + try { + log.info("--> refreshPublicToken refresh start"); + + String publicSecret= wxConfig.getPublicSecret(); + String publicAppid= wxConfig.getPublicAppid(); + if (StrUtil.isBlank(publicSecret) || StrUtil.isBlank(publicAppid)) { + log.info("---> pSecretV or pAppidV is empty"); + return token; + } + + WxMiniTokenRes wxMiniTokenRes = miniWeChatClients.token(publicAppid, publicSecret); + if (wxMiniTokenRes.getAccessToken() != null && wxMiniTokenRes.getExpiresIn() != null) { + token = wxMiniTokenRes.getAccessToken(); + Long expireTime = wxMiniTokenRes.getExpiresIn() - (wxMiniTokenRes.getExpiresIn() / 4);//redis超时时间是原时间的3/4 + + + + redisCache.setCacheObject(pTokenK, token, expireTime.intValue(), TimeUnit.SECONDS); + //stringRedisTemplate.opsForValue().set(pTokenK, token, expireTime, TimeUnit.SECONDS);//token存放到redis,设置超时时间 + + log.info("---> public expireTime:{}, token:{}", expireTime, token); + } else { + log.info("---> refresh public token fail, msg:{}, code:{}", wxMiniTokenRes.getErrmsg(), wxMiniTokenRes.getErrcode()); + } + log.info("--> refreshPublicToken refresh end"); + } catch (Exception e) { + e.printStackTrace(); + log.error("---> refreshPublicToken() exception, ", e); + } + return token; + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ilisteners/PutProcessData.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ilisteners/PutProcessData.java new file mode 100644 index 0000000..83bd45b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ilisteners/PutProcessData.java @@ -0,0 +1,10 @@ +package com.ruoyi.web.controller.listener; + +import lombok.Data; + +@Data +public class PutProcessData { + private Long id; + private String process; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/FileDao.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/FileDao.java new file mode 100644 index 0000000..f532c0a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/FileDao.java @@ -0,0 +1,2 @@ +package com.ruoyi.web.controller.mapper;public class FileDao { +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/VideoDao.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/VideoDao.java new file mode 100644 index 0000000..eac121d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/mapper/VideoDao.java @@ -0,0 +1,12 @@ +package com.ruoyi.web.controller.mapper; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@Mapper +public interface Dao { + @Select("select file_id from b_video where parent_id= #{id}") + List findByParentId(long id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BFileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BFileController.java new file mode 100644 index 0000000..6f396a8 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BFileController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BFile; +import com.ruoyi.system.service.IBFileService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 【请填写功能名称】Controller + * + * @author ruoyi + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/system/file") +public class BFileController extends BaseController +{ + @Autowired + private IBFileService bFileService; + + /** + * 查询【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:file:list')") + @GetMapping("/list") + public TableDataInfo list(BFile bFile) + { + startPage(); + List list = bFileService.selectBFileList(bFile); + return getDataTable(list); + } + + /** + * 导出【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:file:export')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BFile bFile) + { + List list = bFileService.selectBFileList(bFile); + ExcelUtil util = new ExcelUtil(BFile.class); + util.exportExcel(response, list, "【请填写功能名称】数据"); + } + + /** + * 获取【请填写功能名称】详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:file:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(bFileService.selectBFileById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:file:add')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BFile bFile) + { + return toAjax(bFileService.insertBFile(bFile)); + } + + /** + * 修改【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:file:edit')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BFile bFile) + { + return toAjax(bFileService.updateBFile(bFile)); + } + + /** + * 删除【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:file:remove')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(bFileService.deleteBFileByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideoAllowController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideoAllowController.java new file mode 100644 index 0000000..9b6139b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideoAllowController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BVideoAllow; +import com.ruoyi.system.service.IBVideoAllowService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 允许列Controller + * + * @author ruoyi + * @date 2022-03-10 + */ +@RestController +@RequestMapping("/system/allow") +public class BVideoAllowController extends BaseController +{ + @Autowired + private IBVideoAllowService bVideoAllowService; + + /** + * 查询允许列列表 + */ + @PreAuthorize("@ss.hasPermi('system:allow:list')") + @GetMapping("/list") + public TableDataInfo list(BVideoAllow bVideoAllow) + { + startPage(); + List list = bVideoAllowService.selectBVideoAllowList(bVideoAllow); + return getDataTable(list); + } + + /** + * 导出允许列列表 + */ + @PreAuthorize("@ss.hasPermi('system:allow:export')") + @Log(title = "允许列", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BVideoAllow bVideoAllow) + { + List list = bVideoAllowService.selectBVideoAllowList(bVideoAllow); + ExcelUtil util = new ExcelUtil(BVideoAllow.class); + util.exportExcel(response, list, "允许列数据"); + } + + /** + * 获取允许列详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:allow:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(bVideoAllowService.selectBVideoAllowById(id)); + } + + /** + * 新增允许列 + */ + @PreAuthorize("@ss.hasPermi('system:allow:add')") + @Log(title = "允许列", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BVideoAllow bVideoAllow) + { + return toAjax(bVideoAllowService.insertBVideoAllow(bVideoAllow)); + } + + /** + * 修改允许列 + */ + @PreAuthorize("@ss.hasPermi('system:allow:edit')") + @Log(title = "允许列", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BVideoAllow bVideoAllow) + { + return toAjax(bVideoAllowService.updateBVideoAllow(bVideoAllow)); + } + + /** + * 删除允许列 + */ + @PreAuthorize("@ss.hasPermi('system:allow:remove')") + @Log(title = "允许列", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(bVideoAllowService.deleteBVideoAllowByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideosController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideosController.java new file mode 100644 index 0000000..228550c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/BVideosController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BVideos; +import com.ruoyi.system.service.IBVideosService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 视频信息Controller + * + * @author ruoyi + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/system/videos") +public class BVideosController extends BaseController +{ + @Autowired + private IBVideosService bVideosService; + + /** + * 查询视频信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:videos:list')") + @GetMapping("/list") + public TableDataInfo list(BVideos bVideos) + { + startPage(); + List list = bVideosService.selectBVideosList(bVideos); + return getDataTable(list); + } + + /** + * 导出视频信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:videos:export')") + @Log(title = "视频信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BVideos bVideos) + { + List list = bVideosService.selectBVideosList(bVideos); + ExcelUtil util = new ExcelUtil(BVideos.class); + util.exportExcel(response, list, "视频信息数据"); + } + + /** + * 获取视频信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:videos:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(bVideosService.selectBVideosById(id)); + } + + /** + * 新增视频信息 + */ + @PreAuthorize("@ss.hasPermi('system:videos:add')") + @Log(title = "视频信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BVideos bVideos) + { + return toAjax(bVideosService.insertBVideos(bVideos)); + } + + /** + * 修改视频信息 + */ + @PreAuthorize("@ss.hasPermi('system:videos:edit')") + @Log(title = "视频信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BVideos bVideos) + { + return toAjax(bVideosService.updateBVideos(bVideos)); + } + + /** + * 删除视频信息 + */ + @PreAuthorize("@ss.hasPermi('system:videos:remove')") + @Log(title = "视频信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(bVideosService.deleteBVideosByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/ShortLinkController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/ShortLinkController.java new file mode 100644 index 0000000..6303176 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/ShortLinkController.java @@ -0,0 +1,44 @@ +package com.ruoyi.web.controller.upload; + +import cn.hutool.core.util.RandomUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.system.domain.BVideoAllow; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.view.RedirectView; + +import static com.ruoyi.framework.datasource.DynamicDataSourceContextHolder.log; + +@Slf4j +@Controller +@RequestMapping("/s") +public class ShortController { + + @Autowired + private RedisCache redisCache; + + + /** + * 查询允许列列表 + */ + + @GetMapping("/{code}") + public ModelAndView list(@PathVariable("code") String code) + { + + String completeUrl=redisCache.getCacheObject(BVideoAllowController.short_link_code_key+code); + + log.info("jump to completeUrl:{}",completeUrl); + ModelAndView downloadView = new ModelAndView(new RedirectView(completeUrl)); + + return downloadView; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/VideosController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/VideosController.java new file mode 100644 index 0000000..3c738cd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/upload/VideosController.java @@ -0,0 +1,2 @@ +package com.ruoyi.web.controller.upload;public class UploadFileController { +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/serveice/UploadService.java b/ruoyi-admin/src/main/java/com/ruoyi/web/serveice/UploadService.java new file mode 100644 index 0000000..bdd2085 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/serveice/UploadService.java @@ -0,0 +1,2 @@ +package com.ruoyi.web.serveice;public class UploadService { +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/CloudStorageConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/CloudStorageConfig.java new file mode 100644 index 0000000..dfaf595 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/CloudStorageConfig.java @@ -0,0 +1,237 @@ +/* + * + * * Copyright (C) 2018 the sun<463540703@qq.com> + * + * * AG-Enterprise 企业版源码 + * * 郑重声明: + * * 如果你从其他途径获取到,请告知老A传播人,奖励1000。 + * * 老A将追究授予人和传播人的法律责任! + * + * * This program is free software; you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation; either version 2 of the License, or + * * (at your option) any later version. + * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * + * * You should have received a copy of the GNU General Public License along + * * with this program; if not, write to the Free Software Foundation, Inc., + * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +package com.ruoyi.common.config; + +import org.hibernate.validator.constraints.Range; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.io.Serializable; + +/** + * 云存储配置信息 + * @author ace + */ +@Configuration +@ConfigurationProperties(prefix = "oss") +public class CloudStorageConfig implements Serializable { + private static final long serialVersionUID = 1L; + + //类型 1:七牛 2:阿里云 3:腾讯云 + @Range(min=1, max=3, message = "类型错误") + private Integer type; + + //七牛绑定的域名 + private String qiniuDomain; + //七牛路径前缀 + private String qiniuPrefix; + //七牛ACCESS_KEY + private String qiniuAccessKey; + //七牛SECRET_KEY + private String qiniuSecretKey; + //七牛存储空间名 + private String qiniuBucketName; + + //阿里云绑定的域名 + private String aliyunDomain; + //阿里云路径前缀 + private String aliyunPrefix; + //阿里云EndPoint + private String aliyunEndPoint; + //阿里云AccessKeyId + private String aliyunAccessKeyId; + //阿里云AccessKeySecret + private String aliyunAccessKeySecret; + //阿里云BucketName + private String aliyunBucketName; + + //腾讯云绑定的域名 + private String qcloudDomain; + //腾讯云路径前缀 + private String qcloudPrefix; + //腾讯云AppId + private Integer qcloudAppId; + //腾讯云SecretId + private String qcloudSecretId; + //腾讯云SecretKey + private String qcloudSecretKey; + //腾讯云BucketName + private String qcloudBucketName; + //腾讯云COS所属地区 + private String qcloudRegion; + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getQiniuDomain() { + return qiniuDomain; + } + + public void setQiniuDomain(String qiniuDomain) { + this.qiniuDomain = qiniuDomain; + } + + public String getQiniuAccessKey() { + return qiniuAccessKey; + } + + public void setQiniuAccessKey(String qiniuAccessKey) { + this.qiniuAccessKey = qiniuAccessKey; + } + + public String getQiniuSecretKey() { + return qiniuSecretKey; + } + + public void setQiniuSecretKey(String qiniuSecretKey) { + this.qiniuSecretKey = qiniuSecretKey; + } + + public String getQiniuBucketName() { + return qiniuBucketName; + } + + public void setQiniuBucketName(String qiniuBucketName) { + this.qiniuBucketName = qiniuBucketName; + } + + public String getQiniuPrefix() { + return qiniuPrefix; + } + + public void setQiniuPrefix(String qiniuPrefix) { + this.qiniuPrefix = qiniuPrefix; + } + + public String getAliyunDomain() { + return aliyunDomain; + } + + public void setAliyunDomain(String aliyunDomain) { + this.aliyunDomain = aliyunDomain; + } + + public String getAliyunPrefix() { + return aliyunPrefix; + } + + public void setAliyunPrefix(String aliyunPrefix) { + this.aliyunPrefix = aliyunPrefix; + } + + public String getAliyunEndPoint() { + return aliyunEndPoint; + } + + public void setAliyunEndPoint(String aliyunEndPoint) { + this.aliyunEndPoint = aliyunEndPoint; + } + + public String getAliyunAccessKeyId() { + return aliyunAccessKeyId; + } + + public void setAliyunAccessKeyId(String aliyunAccessKeyId) { + this.aliyunAccessKeyId = aliyunAccessKeyId; + } + + public String getAliyunAccessKeySecret() { + return aliyunAccessKeySecret; + } + + public void setAliyunAccessKeySecret(String aliyunAccessKeySecret) { + this.aliyunAccessKeySecret = aliyunAccessKeySecret; + } + + public String getAliyunBucketName() { + return aliyunBucketName; + } + + public void setAliyunBucketName(String aliyunBucketName) { + this.aliyunBucketName = aliyunBucketName; + } + + public String getQcloudDomain() { + return qcloudDomain; + } + + public void setQcloudDomain(String qcloudDomain) { + this.qcloudDomain = qcloudDomain; + } + + public String getQcloudPrefix() { + return qcloudPrefix; + } + + public void setQcloudPrefix(String qcloudPrefix) { + this.qcloudPrefix = qcloudPrefix; + } + + public Integer getQcloudAppId() { + return qcloudAppId; + } + + public void setQcloudAppId(Integer qcloudAppId) { + this.qcloudAppId = qcloudAppId; + } + + public String getQcloudSecretId() { + return qcloudSecretId; + } + + public void setQcloudSecretId(String qcloudSecretId) { + this.qcloudSecretId = qcloudSecretId; + } + + public String getQcloudSecretKey() { + return qcloudSecretKey; + } + + public void setQcloudSecretKey(String qcloudSecretKey) { + this.qcloudSecretKey = qcloudSecretKey; + } + + public String getQcloudBucketName() { + return qcloudBucketName; + } + + public void setQcloudBucketName(String qcloudBucketName) { + this.qcloudBucketName = qcloudBucketName; + } + + public String getQcloudRegion() { + return qcloudRegion; + } + + public void setQcloudRegion(String qcloudRegion) { + this.qcloudRegion = qcloudRegion; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/ToolConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/ToolConfig.java new file mode 100644 index 0000000..2b66def --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/ToolConfig.java @@ -0,0 +1,50 @@ +/* + * + * * Copyright (C) 2018 the sun<463540703@qq.com> + * + * * AG-Enterprise 企业版源码 + * * 郑重声明: + * * 如果你从其他途径获取到,请告知老A传播人,奖励1000。 + * * 老A将追究授予人和传播人的法律责任! + * + * * This program is free software; you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation; either version 2 of the License, or + * * (at your option) any later version. + * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * + * * You should have received a copy of the GNU General Public License along + * * with this program; if not, write to the Free Software Foundation, Inc., + * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +package com.ruoyi.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.io.Serializable; +import java.util.List; + +/** + * 配置信息 + * @author ace + */ +@Configuration +@ConfigurationProperties(prefix = "tool") +@Data +public class ToolConfig implements Serializable { + + private String ffmpegPath; + + private String saveVideoPath; + + + private List downloadUrls; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/BytesUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/BytesUtil.java new file mode 100644 index 0000000..72ab80c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/BytesUtil.java @@ -0,0 +1,78 @@ +package com.github.wxiaoqi.security.common.util; + +import java.util.Arrays; + +/** + * Created by huangchongguo on 2020/7/1. + * Description:No + */ +public class BytesUtil { + + /*public static R RgetClassObject(Object classObject, byte[] bytes){ + bytes=getContentByBytes(bytes); + Class []classZ=new Class[]{classObject.getClass()}; + return (R)InvokeMethodOpen.invokeMethod(classObject.getClass(),classObject,"parseFrom",classZ,bytes); + }*/ + + //获取类型(ClassType) + public static int getClassTypeByBytes(byte[] bytes){ + return BytesUtil.bytes2Int(Arrays.copyOfRange(bytes,0,4)); + } + + //获取内容(payload) + public static byte[] getContentByBytes(byte[] bytes){ + if (bytes.length<=3){ + throw new RuntimeException("getContentByBytes length is short"); + } + return Arrays.copyOfRange(bytes,4,bytes.length); + } + + //融合classType和实际内容 + public static byte[] typeAndPayloadMerger(byte[] bt1,byte[] bt2){ + + //byte[] bt1=BytesUtil.int2Bytes(classType.getType());//classType + + byte[] bt3 = new byte[bt1.length+bt2.length]; + System.arraycopy(bt1, 0, bt3, 0, bt1.length); + System.arraycopy(bt2, 0, bt3, bt1.length, bt2.length); + + return bt3; + } + + + public static int bytes2Int(byte[] bytes) { + int result = 0; + //将每个byte依次搬运到int相应的位置 + result = bytes[0] & 0xff; + result = result << 8 | bytes[1] & 0xff; + result = result << 8 | bytes[2] & 0xff; + result = result << 8 | bytes[3] & 0xff; + return result; + } + + public static byte[] int2Bytes(int num) { + byte[] bytes = new byte[4]; + //通过移位运算,截取低8位的方式,将int保存到byte数组 + bytes[0] = (byte)(num >>> 24); + bytes[1] = (byte)(num >>> 16); + bytes[2] = (byte)(num >>> 8); + bytes[3] = (byte)num; + return bytes; + } + public static Byte[] byte2Byte(byte[] bytesPrim) { + Byte[] bytes = new Byte[bytesPrim.length]; + + int i = 0; + for (byte b : bytesPrim) bytes[i++] = b; // Autoboxing + + return bytes; + } + public static byte[] Byte2Byte(Byte[] bytesPrim) { + byte[] bytes = new byte[bytesPrim.length]; + + int i = 0; + for (Byte b : bytesPrim) bytes[i++] = b; // Autoboxing + + return bytes; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutObjectProgressListener.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutObjectProgressListener.java new file mode 100644 index 0000000..4422ea0 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutObjectProgressListener.java @@ -0,0 +1,79 @@ +package com.ruoyi.web.controller.ilisteners; + +import com.aliyun.oss.event.ProgressEvent; +import com.aliyun.oss.event.ProgressEventType; +import com.aliyun.oss.event.ProgressListener; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class PutObjectProgressListener implements ProgressListener { + private PutProcessData session; + private long bytesWritten = 0; + private long totalBytes = -1; + private boolean succeed = false; + private int percent = 0; + int sum = 0; + private boolean fail = false; + + // 构造方法中加入session + public PutObjectProgressListener() { + } + + public PutObjectProgressListener(PutProcessData mSession, int sum) { + this.session = mSession; + this.sum = sum; + this.session.setProcess("0 %"); + + log.info("========================{}============================", session.getId()); + + } + + @Override + public void progressChanged(ProgressEvent progressEvent) { + long bytes = progressEvent.getBytes(); + ProgressEventType eventType = progressEvent.getEventType(); + switch (eventType) { + case TRANSFER_STARTED_EVENT: + // logger.info("Start to upload......"); + break; + case REQUEST_CONTENT_LENGTH_EVENT: + this.totalBytes = bytes; + // logger.info(this.totalBytes + + // " bytes in total will be uploaded to OSS"); + break; + case REQUEST_BYTE_TRANSFER_EVENT: + this.bytesWritten += bytes; + if (this.totalBytes != -1) { + percent = (int) (this.bytesWritten * 100.0 / this.totalBytes); + // 将进度percent放入session中 + this.session.setProcess(percent + " %"); + //session.setAttribute("upload_percent", percent); + } else { + + } + break; + case TRANSFER_COMPLETED_EVENT: + this.succeed = true; + + break; + case TRANSFER_FAILED_EVENT: + fail = true; + break; + default: + break; + } + +//控制台打印进度 + log.info("upload process id:{}, percent:{}", session.getId(), percent); + //System.out.println("percent:" + percent); + + } + + public boolean isFail() { + return fail; + } + + public boolean isSucceed() { + return succeed; + } +} \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutProcessData.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutProcessData.java new file mode 100644 index 0000000..2181abd --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/ilisteners/PutProcessData.java @@ -0,0 +1,10 @@ +package com.ruoyi.web.controller.ilisteners; + +import lombok.Data; + +@Data +public class PutProcessData { + private Long id; + private String process; + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AliOSSService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AliOSSService.java new file mode 100644 index 0000000..88287b9 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AliOSSService.java @@ -0,0 +1,2 @@ +package com.ruoyi.system.service;public class AliOSSService { +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BFile.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BFile.java new file mode 100644 index 0000000..f96a2ac --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BFile.java @@ -0,0 +1,81 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 【请填写功能名称】对象 b_file + * + * @author ruoyi + * @date 2022-03-09 + */ +public class BFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 文件id */ + @Excel(name = "文件id") + private String uuid; + + /** 备注 */ + @Excel(name = "备注") + private String memo; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date gmtCreate; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUuid(String uuid) + { + this.uuid = uuid; + } + + public String getUuid() + { + return uuid; + } + public void setMemo(String memo) + { + this.memo = memo; + } + + public String getMemo() + { + return memo; + } + public void setGmtCreate(Date gmtCreate) + { + this.gmtCreate = gmtCreate; + } + + public Date getGmtCreate() + { + return gmtCreate; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("uuid", getUuid()) + .append("memo", getMemo()) + .append("gmtCreate", getGmtCreate()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideoAllow.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideoAllow.java new file mode 100644 index 0000000..7c80ec5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideoAllow.java @@ -0,0 +1,109 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 允许列对象 b_video_allow + * + * @author ruoyi + * @date 2022-03-09 + */ +public class BVideoAllow extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String allowId; + + /** 公众号openid */ + @Excel(name = "公众号openid") + private String wxOpenid; + + /** 微信公众号昵称 */ + @Excel(name = "微信公众号昵称") + private String wxNickname; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date gmtCreate; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long videoId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setAllowId(String allowId) + { + this.allowId = allowId; + } + + public String getAllowId() + { + return allowId; + } + public void setWxOpenid(String wxOpenid) + { + this.wxOpenid = wxOpenid; + } + + public String getWxOpenid() + { + return wxOpenid; + } + public void setWxNickname(String wxNickname) + { + this.wxNickname = wxNickname; + } + + public String getWxNickname() + { + return wxNickname; + } + public void setGmtCreate(Date gmtCreate) + { + this.gmtCreate = gmtCreate; + } + + public Date getGmtCreate() + { + return gmtCreate; + } + public void setVideoId(Long videoId) + { + this.videoId = videoId; + } + + public Long getVideoId() + { + return videoId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("allowId", getAllowId()) + .append("wxOpenid", getWxOpenid()) + .append("wxNickname", getWxNickname()) + .append("gmtCreate", getGmtCreate()) + .append("videoId", getVideoId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideos.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideos.java new file mode 100644 index 0000000..1864520 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BVideos.java @@ -0,0 +1,137 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 视频信息对象 b_videos + * + * @author ruoyi + * @date 2022-03-09 + */ +public class BVideos extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String name; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String path; + + /** 文件类型:1:目录,2:文件,3:链接 */ + @Excel(name = "文件类型:1:目录,2:文件,3:链接") + private Long type; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date gmtModified; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date gmtCreate; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long parentId; + + /** 文件id */ + @Excel(name = "文件id") + private Long fileId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setPath(String path) + { + this.path = path; + } + + public String getPath() + { + return path; + } + public void setType(Long type) + { + this.type = type; + } + + public Long getType() + { + return type; + } + public void setGmtModified(Date gmtModified) + { + this.gmtModified = gmtModified; + } + + public Date getGmtModified() + { + return gmtModified; + } + public void setGmtCreate(Date gmtCreate) + { + this.gmtCreate = gmtCreate; + } + + public Date getGmtCreate() + { + return gmtCreate; + } + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getParentId() + { + return parentId; + } + public void setFileId(Long fileId) + { + this.fileId = fileId; + } + + public Long getFileId() + { + return fileId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("path", getPath()) + .append("type", getType()) + .append("gmtModified", getGmtModified()) + .append("gmtCreate", getGmtCreate()) + .append("parentId", getParentId()) + .append("fileId", getFileId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BFileMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BFileMapper.java new file mode 100644 index 0000000..97ad8ac --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BFileMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BFile; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author ruoyi + * @date 2022-03-09 + */ +public interface BFileMapper +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public BFile selectBFileById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param bFile 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectBFileList(BFile bFile); + + /** + * 新增【请填写功能名称】 + * + * @param bFile 【请填写功能名称】 + * @return 结果 + */ + public int insertBFile(BFile bFile); + + /** + * 修改【请填写功能名称】 + * + * @param bFile 【请填写功能名称】 + * @return 结果 + */ + public int updateBFile(BFile bFile); + + /** + * 删除【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteBFileById(Long id); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBFileByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideoAllowMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideoAllowMapper.java new file mode 100644 index 0000000..e2283fc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideoAllowMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BVideoAllow; + +/** + * 允许列Mapper接口 + * + * @author ruoyi + * @date 2022-03-09 + */ +public interface BVideoAllowMapper +{ + /** + * 查询允许列 + * + * @param id 允许列主键 + * @return 允许列 + */ + public BVideoAllow selectBVideoAllowById(Long id); + + /** + * 查询允许列列表 + * + * @param bVideoAllow 允许列 + * @return 允许列集合 + */ + public List selectBVideoAllowList(BVideoAllow bVideoAllow); + + /** + * 新增允许列 + * + * @param bVideoAllow 允许列 + * @return 结果 + */ + public int insertBVideoAllow(BVideoAllow bVideoAllow); + + /** + * 修改允许列 + * + * @param bVideoAllow 允许列 + * @return 结果 + */ + public int updateBVideoAllow(BVideoAllow bVideoAllow); + + /** + * 删除允许列 + * + * @param id 允许列主键 + * @return 结果 + */ + public int deleteBVideoAllowById(Long id); + + /** + * 批量删除允许列 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBVideoAllowByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideosMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideosMapper.java new file mode 100644 index 0000000..2a95bca --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BVideosMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BVideos; + +/** + * 视频信息Mapper接口 + * + * @author ruoyi + * @date 2022-03-09 + */ +public interface BVideosMapper +{ + /** + * 查询视频信息 + * + * @param id 视频信息主键 + * @return 视频信息 + */ + public BVideos selectBVideosById(Long id); + + /** + * 查询视频信息列表 + * + * @param bVideos 视频信息 + * @return 视频信息集合 + */ + public List selectBVideosList(BVideos bVideos); + + /** + * 新增视频信息 + * + * @param bVideos 视频信息 + * @return 结果 + */ + public int insertBVideos(BVideos bVideos); + + /** + * 修改视频信息 + * + * @param bVideos 视频信息 + * @return 结果 + */ + public int updateBVideos(BVideos bVideos); + + /** + * 删除视频信息 + * + * @param id 视频信息主键 + * @return 结果 + */ + public int deleteBVideosById(Long id); + + /** + * 批量删除视频信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBVideosByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBFileService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBFileService.java new file mode 100644 index 0000000..b139860 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBFileService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BFile; + +/** + * 【请填写功能名称】Service接口 + * + * @author ruoyi + * @date 2022-03-09 + */ +public interface IBFileService +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public BFile selectBFileById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param bFile 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectBFileList(BFile bFile); + + /** + * 新增【请填写功能名称】 + * + * @param bFile 【请填写功能名称】 + * @return 结果 + */ + public int insertBFile(BFile bFile); + + /** + * 修改【请填写功能名称】 + * + * @param bFile 【请填写功能名称】 + * @return 结果 + */ + public int updateBFile(BFile bFile); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键集合 + * @return 结果 + */ + public int deleteBFileByIds(Long[] ids); + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteBFileById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideoAllowService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideoAllowService.java new file mode 100644 index 0000000..978df50 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideoAllowService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BVideoAllow; + +/** + * 允许列Service接口 + * + * @author ruoyi + * @date 2022-03-09 + */ +public interface IBVideoAllowService +{ + /** + * 查询允许列 + * + * @param id 允许列主键 + * @return 允许列 + */ + public BVideoAllow selectBVideoAllowById(Long id); + + /** + * 查询允许列列表 + * + * @param bVideoAllow 允许列 + * @return 允许列集合 + */ + public List selectBVideoAllowList(BVideoAllow bVideoAllow); + + /** + * 新增允许列 + * + * @param bVideoAllow 允许列 + * @return 结果 + */ + public int insertBVideoAllow(BVideoAllow bVideoAllow); + + /** + * 修改允许列 + * + * @param bVideoAllow 允许列 + * @return 结果 + */ + public int updateBVideoAllow(BVideoAllow bVideoAllow); + + /** + * 批量删除允许列 + * + * @param ids 需要删除的允许列主键集合 + * @return 结果 + */ + public int deleteBVideoAllowByIds(Long[] ids); + + /** + * 删除允许列信息 + * + * @param id 允许列主键 + * @return 结果 + */ + public int deleteBVideoAllowById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideosService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideosService.java new file mode 100644 index 0000000..4480304 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBVideosService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BVideos; + +/** + * 视频信息Service接口 + * + * @author ruoyi + * @date 2022-03-09 + */ +public interface IBVideosService +{ + /** + * 查询视频信息 + * + * @param id 视频信息主键 + * @return 视频信息 + */ + public BVideos selectBVideosById(Long id); + + /** + * 查询视频信息列表 + * + * @param bVideos 视频信息 + * @return 视频信息集合 + */ + public List selectBVideosList(BVideos bVideos); + + /** + * 新增视频信息 + * + * @param bVideos 视频信息 + * @return 结果 + */ + public int insertBVideos(BVideos bVideos); + + /** + * 修改视频信息 + * + * @param bVideos 视频信息 + * @return 结果 + */ + public int updateBVideos(BVideos bVideos); + + /** + * 批量删除视频信息 + * + * @param ids 需要删除的视频信息主键集合 + * @return 结果 + */ + public int deleteBVideosByIds(Long[] ids); + + /** + * 删除视频信息信息 + * + * @param id 视频信息主键 + * @return 结果 + */ + public int deleteBVideosById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BFileServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BFileServiceImpl.java new file mode 100644 index 0000000..83fbfad --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BFileServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BFileMapper; +import com.ruoyi.system.domain.BFile; +import com.ruoyi.system.service.IBFileService; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author ruoyi + * @date 2022-03-09 + */ +@Service +public class BFileServiceImpl implements IBFileService +{ + @Autowired + private BFileMapper bFileMapper; + + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + @Override + public BFile selectBFileById(Long id) + { + return bFileMapper.selectBFileById(id); + } + + /** + * 查询【请填写功能名称】列表 + * + * @param bFile 【请填写功能名称】 + * @return 【请填写功能名称】 + */ + @Override + public List selectBFileList(BFile bFile) + { + return bFileMapper.selectBFileList(bFile); + } + + /** + * 新增【请填写功能名称】 + * + * @param bFile 【请填写功能名称】 + * @return 结果 + */ + @Override + public int insertBFile(BFile bFile) + { + return bFileMapper.insertBFile(bFile); + } + + /** + * 修改【请填写功能名称】 + * + * @param bFile 【请填写功能名称】 + * @return 结果 + */ + @Override + public int updateBFile(BFile bFile) + { + return bFileMapper.updateBFile(bFile); + } + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteBFileByIds(Long[] ids) + { + return bFileMapper.deleteBFileByIds(ids); + } + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteBFileById(Long id) + { + return bFileMapper.deleteBFileById(id); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideoAllowServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideoAllowServiceImpl.java new file mode 100644 index 0000000..13a0678 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideoAllowServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BVideoAllowMapper; +import com.ruoyi.system.domain.BVideoAllow; +import com.ruoyi.system.service.IBVideoAllowService; + +/** + * 允许列Service业务层处理 + * + * @author ruoyi + * @date 2022-03-09 + */ +@Service +public class BVideoAllowServiceImpl implements IBVideoAllowService +{ + @Autowired + private BVideoAllowMapper bVideoAllowMapper; + + /** + * 查询允许列 + * + * @param id 允许列主键 + * @return 允许列 + */ + @Override + public BVideoAllow selectBVideoAllowById(Long id) + { + return bVideoAllowMapper.selectBVideoAllowById(id); + } + + /** + * 查询允许列列表 + * + * @param bVideoAllow 允许列 + * @return 允许列 + */ + @Override + public List selectBVideoAllowList(BVideoAllow bVideoAllow) + { + return bVideoAllowMapper.selectBVideoAllowList(bVideoAllow); + } + + /** + * 新增允许列 + * + * @param bVideoAllow 允许列 + * @return 结果 + */ + @Override + public int insertBVideoAllow(BVideoAllow bVideoAllow) + { + return bVideoAllowMapper.insertBVideoAllow(bVideoAllow); + } + + /** + * 修改允许列 + * + * @param bVideoAllow 允许列 + * @return 结果 + */ + @Override + public int updateBVideoAllow(BVideoAllow bVideoAllow) + { + return bVideoAllowMapper.updateBVideoAllow(bVideoAllow); + } + + /** + * 批量删除允许列 + * + * @param ids 需要删除的允许列主键 + * @return 结果 + */ + @Override + public int deleteBVideoAllowByIds(Long[] ids) + { + return bVideoAllowMapper.deleteBVideoAllowByIds(ids); + } + + /** + * 删除允许列信息 + * + * @param id 允许列主键 + * @return 结果 + */ + @Override + public int deleteBVideoAllowById(Long id) + { + return bVideoAllowMapper.deleteBVideoAllowById(id); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideosServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideosServiceImpl.java new file mode 100644 index 0000000..962fa82 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BVideosServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BVideosMapper; +import com.ruoyi.system.domain.BVideos; +import com.ruoyi.system.service.IBVideosService; + +/** + * 视频信息Service业务层处理 + * + * @author ruoyi + * @date 2022-03-09 + */ +@Service +public class BVideosServiceImpl implements IBVideosService +{ + @Autowired + private BVideosMapper bVideosMapper; + + /** + * 查询视频信息 + * + * @param id 视频信息主键 + * @return 视频信息 + */ + @Override + public BVideos selectBVideosById(Long id) + { + return bVideosMapper.selectBVideosById(id); + } + + /** + * 查询视频信息列表 + * + * @param bVideos 视频信息 + * @return 视频信息 + */ + @Override + public List selectBVideosList(BVideos bVideos) + { + return bVideosMapper.selectBVideosList(bVideos); + } + + /** + * 新增视频信息 + * + * @param bVideos 视频信息 + * @return 结果 + */ + @Override + public int insertBVideos(BVideos bVideos) + { + return bVideosMapper.insertBVideos(bVideos); + } + + /** + * 修改视频信息 + * + * @param bVideos 视频信息 + * @return 结果 + */ + @Override + public int updateBVideos(BVideos bVideos) + { + return bVideosMapper.updateBVideos(bVideos); + } + + /** + * 批量删除视频信息 + * + * @param ids 需要删除的视频信息主键 + * @return 结果 + */ + @Override + public int deleteBVideosByIds(Long[] ids) + { + return bVideosMapper.deleteBVideosByIds(ids); + } + + /** + * 删除视频信息信息 + * + * @param id 视频信息主键 + * @return 结果 + */ + @Override + public int deleteBVideosById(Long id) + { + return bVideosMapper.deleteBVideosById(id); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/BFileMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BFileMapper.xml new file mode 100644 index 0000000..32e5be8 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/BFileMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + select id, uuid, memo, gmt_create from b_file + + + + + + + + insert into b_file + + uuid, + memo, + gmt_create, + + + #{uuid}, + #{memo}, + #{gmtCreate}, + + + + + update b_file + + uuid = #{uuid}, + memo = #{memo}, + gmt_create = #{gmtCreate}, + + where id = #{id} + + + + delete from b_file where id = #{id} + + + + delete from b_file where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/BVideoAllowMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BVideoAllowMapper.xml new file mode 100644 index 0000000..08eab66 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/BVideoAllowMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + select id, allow_id, wx_openid, wx_nickname, gmt_create, video_id from b_video_allow + + + + + + + + insert into b_video_allow + + allow_id, + wx_openid, + wx_nickname, + gmt_create, + video_id, + + + #{allowId}, + #{wxOpenid}, + #{wxNickname}, + #{gmtCreate}, + #{videoId}, + + + + + update b_video_allow + + allow_id = #{allowId}, + wx_openid = #{wxOpenid}, + wx_nickname = #{wxNickname}, + gmt_create = #{gmtCreate}, + video_id = #{videoId}, + + where id = #{id} + + + + delete from b_video_allow where id = #{id} + + + + delete from b_video_allow where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/BVideosMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BVideosMapper.xml new file mode 100644 index 0000000..27b1bef --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/BVideosMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + select id, name, path, type, gmt_modified, gmt_create, parent_id, file_id from b_videos + + + + + + + + insert into b_videos + + name, + path, + type, + gmt_modified, + gmt_create, + parent_id, + file_id, + + + #{name}, + #{path}, + #{type}, + #{gmtModified}, + #{gmtCreate}, + #{parentId}, + #{fileId}, + + + + + update b_videos + + name = #{name}, + path = #{path}, + type = #{type}, + gmt_modified = #{gmtModified}, + gmt_create = #{gmtCreate}, + parent_id = #{parentId}, + file_id = #{fileId}, + + where id = #{id} + + + + delete from b_videos where id = #{id} + + + + delete from b_videos where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/allow.js b/ruoyi-ui/src/api/system/allow.js new file mode 100644 index 0000000..dab32f9 --- /dev/null +++ b/ruoyi-ui/src/api/system/allow.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询允许列列表 +export function listAllow(query) { + return request({ + url: '/system/allow/list', + method: 'get', + params: query + }) +} + +// 查询允许列详细 +export function getAllow(id) { + return request({ + url: '/system/allow/' + id, + method: 'get' + }) +} + +// 新增允许列 +export function addAllow(data) { + return request({ + url: '/system/allow', + method: 'post', + data: data + }) +} + +// 修改允许列 +export function updateAllow(data) { + return request({ + url: '/system/allow', + method: 'put', + data: data + }) +} + +// 删除允许列 +export function delAllow(id) { + return request({ + url: '/system/allow/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/file.js b/ruoyi-ui/src/api/system/file.js new file mode 100644 index 0000000..9595c84 --- /dev/null +++ b/ruoyi-ui/src/api/system/file.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询【请填写功能名称】列表 +export function listFile(query) { + return request({ + url: '/system/file/list', + method: 'get', + params: query + }) +} + +// 查询【请填写功能名称】详细 +export function getFile(id) { + return request({ + url: '/system/file/' + id, + method: 'get' + }) +} + +// 新增【请填写功能名称】 +export function addFile(data) { + return request({ + url: '/system/file', + method: 'post', + data: data + }) +} + +// 修改【请填写功能名称】 +export function updateFile(data) { + return request({ + url: '/system/file', + method: 'put', + data: data + }) +} + +// 删除【请填写功能名称】 +export function delFile(id) { + return request({ + url: '/system/file/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/videos.js b/ruoyi-ui/src/api/system/videos.js new file mode 100644 index 0000000..2bbfbf0 --- /dev/null +++ b/ruoyi-ui/src/api/system/videos.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询视频信息列表 +export function listVideos(query) { + return request({ + url: '/system/videos/list', + method: 'get', + params: query + }) +} + +// 查询视频信息详细 +export function getVideos(id) { + return request({ + url: '/system/videos/' + id, + method: 'get' + }) +} + +// 新增视频信息 +export function addVideos(data) { + return request({ + url: '/system/videos', + method: 'post', + data: data + }) +} + +// 修改视频信息 +export function updateVideos(data) { + return request({ + url: '/system/videos', + method: 'put', + data: data + }) +} + +// 删除视频信息 +export function delVideos(id) { + return request({ + url: '/system/videos/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/system/allow/index.vue b/ruoyi-ui/src/views/system/allow/index.vue new file mode 100644 index 0000000..8de5e75 --- /dev/null +++ b/ruoyi-ui/src/views/system/allow/index.vue @@ -0,0 +1,310 @@ + + + diff --git a/ruoyi-ui/src/views/system/file/index.vue b/ruoyi-ui/src/views/system/file/index.vue new file mode 100644 index 0000000..8b3700a --- /dev/null +++ b/ruoyi-ui/src/views/system/file/index.vue @@ -0,0 +1,282 @@ + + + diff --git a/ruoyi-ui/src/views/system/manage/files.vue b/ruoyi-ui/src/views/system/manage/files.vue new file mode 100644 index 0000000..950e0c5 --- /dev/null +++ b/ruoyi-ui/src/views/system/manage/files.vue @@ -0,0 +1,279 @@ + + + diff --git a/ruoyi-ui/src/views/system/manage/selectFiles.vue b/ruoyi-ui/src/views/system/manage/selectFiles.vue new file mode 100644 index 0000000..0922860 --- /dev/null +++ b/ruoyi-ui/src/views/system/manage/selectFiles.vue @@ -0,0 +1,343 @@ + + diff --git a/ruoyi-ui/src/views/system/videos/index.vue b/ruoyi-ui/src/views/system/videos/index.vue new file mode 100644 index 0000000..7696fc1 --- /dev/null +++ b/ruoyi-ui/src/views/system/videos/index.vue @@ -0,0 +1,336 @@ + + +