浏览代码

update:修改mall.security包名

liujunchi 3 年之前
父节点
当前提交
bbc5dc16e5
共有 17 个文件被更改,包括 120 次插入118 次删除
  1. 2 2
      cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/config/MallSecurityConfig.java
  2. 97 97
      cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/UmsResourceController.java
  3. 1 1
      cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/impl/UmsAdminServiceImpl.java
  4. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/annotation/CacheException.java
  5. 2 2
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/aspect/RedisCacheAspect.java
  6. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicAccessDecisionManager.java
  7. 2 2
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicSecurityFilter.java
  8. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicSecurityMetadataSource.java
  9. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicSecurityService.java
  10. 2 2
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/JwtAuthenticationTokenFilter.java
  11. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/RestAuthenticationEntryPoint.java
  12. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/RestfulAccessDeniedHandler.java
  13. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/config/IgnoreUrlsConfig.java
  14. 3 3
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/config/SecurityConfig.java
  15. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/util/JwtTokenUtil.java
  16. 1 1
      cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/util/SpringUtil.java
  17. 2 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/MusicTagSaveDto.java

+ 2 - 2
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/config/MallSecurityConfig.java

@@ -1,8 +1,8 @@
 package com.yonge.cooleshow.admin.config;
 
 import com.yonge.cooleshow.mbg.model.UmsResource;
-import com.macro.mall.security.component.DynamicSecurityService;
-import com.macro.mall.security.config.SecurityConfig;
+import com.yonge.cooleshow.mall.security.component.DynamicSecurityService;
+import com.yonge.cooleshow.mall.security.config.SecurityConfig;
 import com.yonge.cooleshow.admin.service.UmsAdminService;
 import com.yonge.cooleshow.admin.service.UmsResourceService;
 import org.springframework.beans.factory.annotation.Autowired;

+ 97 - 97
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/UmsResourceController.java

@@ -1,97 +1,97 @@
-// package com.yonge.cooleshow.admin.controller;
-//
-// import com.yonge.cooleshow.mall.common.api.CommonPage;
-// import com.yonge.cooleshow.mall.common.api.CommonResult;
-// import com.yonge.cooleshow.mbg.model.UmsResource;
-// import com.macro.mall.security.component.DynamicSecurityMetadataSource;
-// import com.yonge.cooleshow.admin.service.UmsResourceService;
-// import io.swagger.annotations.Api;
-// import io.swagger.annotations.ApiOperation;
-// import org.springframework.beans.factory.annotation.Autowired;
-// import org.springframework.stereotype.Controller;
-// import org.springframework.web.bind.annotation.*;
-//
-// import java.util.List;
-//
-// /**
-//  * 后台资源管理Controller
-//  * Created by macro on 2020/2/4.
-//  */
-// @Controller
-// @Api(tags = "UmsResourceController", description = "后台资源管理")
-// @RequestMapping("/resource")
-// public class UmsResourceController {
-//
-//     @Autowired
-//     private UmsResourceService resourceService;
-//     @Autowired
-//     private DynamicSecurityMetadataSource dynamicSecurityMetadataSource;
-//
-//     @ApiOperation("添加后台资源")
-//     @RequestMapping(value = "/create", method = RequestMethod.POST)
-//     @ResponseBody
-//     public CommonResult create(@RequestBody UmsResource umsResource) {
-//         int count = resourceService.create(umsResource);
-//         dynamicSecurityMetadataSource.clearDataSource();
-//         if (count > 0) {
-//             return CommonResult.success(count);
-//         } else {
-//             return CommonResult.failed();
-//         }
-//     }
-//
-//     @ApiOperation("修改后台资源")
-//     @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
-//     @ResponseBody
-//     public CommonResult update(@PathVariable Long id,
-//                                @RequestBody UmsResource umsResource) {
-//         int count = resourceService.update(id, umsResource);
-//         dynamicSecurityMetadataSource.clearDataSource();
-//         if (count > 0) {
-//             return CommonResult.success(count);
-//         } else {
-//             return CommonResult.failed();
-//         }
-//     }
-//
-//     @ApiOperation("根据ID获取资源详情")
-//     @RequestMapping(value = "/{id}", method = RequestMethod.GET)
-//     @ResponseBody
-//     public CommonResult<UmsResource> getItem(@PathVariable Long id) {
-//         UmsResource umsResource = resourceService.getItem(id);
-//         return CommonResult.success(umsResource);
-//     }
-//
-//     @ApiOperation("根据ID删除后台资源")
-//     @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
-//     @ResponseBody
-//     public CommonResult delete(@PathVariable Long id) {
-//         int count = resourceService.delete(id);
-//         dynamicSecurityMetadataSource.clearDataSource();
-//         if (count > 0) {
-//             return CommonResult.success(count);
-//         } else {
-//             return CommonResult.failed();
-//         }
-//     }
-//
-//     @ApiOperation("分页模糊查询后台资源")
-//     @RequestMapping(value = "/list", method = RequestMethod.GET)
-//     @ResponseBody
-//     public CommonResult<CommonPage<UmsResource>> list(@RequestParam(required = false) Long categoryId,
-//                                                       @RequestParam(required = false) String nameKeyword,
-//                                                       @RequestParam(required = false) String urlKeyword,
-//                                                       @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
-//                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
-//         List<UmsResource> resourceList = resourceService.list(categoryId,nameKeyword, urlKeyword, pageSize, pageNum);
-//         return CommonResult.success(CommonPage.restPage(resourceList));
-//     }
-//
-//     @ApiOperation("查询所有后台资源")
-//     @RequestMapping(value = "/listAll", method = RequestMethod.GET)
-//     @ResponseBody
-//     public CommonResult<List<UmsResource>> listAll() {
-//         List<UmsResource> resourceList = resourceService.listAll();
-//         return CommonResult.success(resourceList);
-//     }
-// }
+package com.yonge.cooleshow.admin.controller;
+
+import com.yonge.cooleshow.mall.common.api.CommonPage;
+import com.yonge.cooleshow.mall.common.api.CommonResult;
+import com.yonge.cooleshow.mbg.model.UmsResource;
+import com.yonge.cooleshow.mall.security.component.DynamicSecurityMetadataSource;
+import com.yonge.cooleshow.admin.service.UmsResourceService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 后台资源管理Controller
+ * Created by macro on 2020/2/4.
+ */
+@Controller
+@Api(tags = "UmsResourceController", description = "后台资源管理")
+@RequestMapping("/resource")
+public class UmsResourceController {
+
+    @Autowired
+    private UmsResourceService resourceService;
+    @Autowired
+    private DynamicSecurityMetadataSource dynamicSecurityMetadataSource;
+
+    @ApiOperation("添加后台资源")
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult create(@RequestBody UmsResource umsResource) {
+        int count = resourceService.create(umsResource);
+        dynamicSecurityMetadataSource.clearDataSource();
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("修改后台资源")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult update(@PathVariable Long id,
+                               @RequestBody UmsResource umsResource) {
+        int count = resourceService.update(id, umsResource);
+        dynamicSecurityMetadataSource.clearDataSource();
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("根据ID获取资源详情")
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<UmsResource> getItem(@PathVariable Long id) {
+        UmsResource umsResource = resourceService.getItem(id);
+        return CommonResult.success(umsResource);
+    }
+
+    @ApiOperation("根据ID删除后台资源")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult delete(@PathVariable Long id) {
+        int count = resourceService.delete(id);
+        dynamicSecurityMetadataSource.clearDataSource();
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("分页模糊查询后台资源")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<CommonPage<UmsResource>> list(@RequestParam(required = false) Long categoryId,
+                                                      @RequestParam(required = false) String nameKeyword,
+                                                      @RequestParam(required = false) String urlKeyword,
+                                                      @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                                                      @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
+        List<UmsResource> resourceList = resourceService.list(categoryId,nameKeyword, urlKeyword, pageSize, pageNum);
+        return CommonResult.success(CommonPage.restPage(resourceList));
+    }
+
+    @ApiOperation("查询所有后台资源")
+    @RequestMapping(value = "/listAll", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsResource>> listAll() {
+        List<UmsResource> resourceList = resourceService.listAll();
+        return CommonResult.success(resourceList);
+    }
+}

+ 1 - 1
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/impl/UmsAdminServiceImpl.java

@@ -13,7 +13,7 @@ import com.yonge.cooleshow.mbg.mapper.UmsAdminLoginLogMapper;
 import com.yonge.cooleshow.mbg.mapper.UmsAdminMapper;
 import com.yonge.cooleshow.mbg.mapper.UmsAdminRoleRelationMapper;
 import com.yonge.cooleshow.mbg.model.*;
-import com.macro.mall.security.util.JwtTokenUtil;
+import com.yonge.cooleshow.mall.security.util.JwtTokenUtil;
 import com.yonge.cooleshow.admin.service.UmsAdminCacheService;
 import com.yonge.cooleshow.admin.service.UmsAdminService;
 import org.slf4j.Logger;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/annotation/CacheException.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/annotation/CacheException.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.annotation;
+package com.yonge.cooleshow.mall.security.annotation;
 
 import java.lang.annotation.*;
 

+ 2 - 2
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/aspect/RedisCacheAspect.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/aspect/RedisCacheAspect.java

@@ -1,6 +1,6 @@
-package com.macro.mall.security.aspect;
+package com.yonge.cooleshow.mall.security.aspect;
 
-import com.macro.mall.security.annotation.CacheException;
+import com.yonge.cooleshow.mall.security.annotation.CacheException;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.Signature;
 import org.aspectj.lang.annotation.Around;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/component/DynamicAccessDecisionManager.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicAccessDecisionManager.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.component;
+package com.yonge.cooleshow.mall.security.component;
 
 import cn.hutool.core.collection.CollUtil;
 import org.springframework.security.access.AccessDecisionManager;

+ 2 - 2
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityFilter.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicSecurityFilter.java

@@ -1,6 +1,6 @@
-package com.macro.mall.security.component;
+package com.yonge.cooleshow.mall.security.component;
 
-import com.macro.mall.security.config.IgnoreUrlsConfig;
+import com.yonge.cooleshow.mall.security.config.IgnoreUrlsConfig;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
 import org.springframework.security.access.SecurityMetadataSource;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityMetadataSource.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicSecurityMetadataSource.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.component;
+package com.yonge.cooleshow.mall.security.component;
 
 import cn.hutool.core.util.URLUtil;
 import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityService.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/DynamicSecurityService.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.component;
+package com.yonge.cooleshow.mall.security.component;
 
 import org.springframework.security.access.ConfigAttribute;
 

+ 2 - 2
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/component/JwtAuthenticationTokenFilter.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/JwtAuthenticationTokenFilter.java

@@ -1,6 +1,6 @@
-package com.macro.mall.security.component;
+package com.yonge.cooleshow.mall.security.component;
 
-import com.macro.mall.security.util.JwtTokenUtil;
+import com.yonge.cooleshow.mall.security.util.JwtTokenUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/component/RestAuthenticationEntryPoint.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/RestAuthenticationEntryPoint.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.component;
+package com.yonge.cooleshow.mall.security.component;
 
 import cn.hutool.json.JSONUtil;
 import com.yonge.cooleshow.mall.common.api.CommonResult;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/component/RestfulAccessDeniedHandler.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/component/RestfulAccessDeniedHandler.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.component;
+package com.yonge.cooleshow.mall.security.component;
 
 import cn.hutool.json.JSONUtil;
 import com.yonge.cooleshow.mall.common.api.CommonResult;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/config/IgnoreUrlsConfig.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/config/IgnoreUrlsConfig.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.config;
+package com.yonge.cooleshow.mall.security.config;
 
 import org.springframework.boot.context.properties.ConfigurationProperties;
 

+ 3 - 3
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/config/SecurityConfig.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/config/SecurityConfig.java

@@ -1,7 +1,7 @@
-package com.macro.mall.security.config;
+package com.yonge.cooleshow.mall.security.config;
 
-import com.macro.mall.security.component.*;
-import com.macro.mall.security.util.JwtTokenUtil;
+import com.yonge.cooleshow.mall.security.component.*;
+import com.yonge.cooleshow.mall.security.util.JwtTokenUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.context.annotation.Bean;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/util/JwtTokenUtil.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/util/JwtTokenUtil.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.util;
+package com.yonge.cooleshow.mall.security.util;
 
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;

+ 1 - 1
cooleshow-mall/mall-security/src/main/java/com/macro/mall/security/util/SpringUtil.java → cooleshow-mall/mall-security/src/main/java/com/yonge/cooleshow/mall/security/util/SpringUtil.java

@@ -1,4 +1,4 @@
-package com.macro.mall.security.util;
+package com.yonge.cooleshow.mall.security.util;
 
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/MusicTagSaveDto.java

@@ -3,6 +3,7 @@ package com.yonge.cooleshow.biz.dal.dto;
 import io.swagger.annotations.ApiModelProperty;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import javax.validation.groups.Default;
 
 /**
@@ -18,6 +19,7 @@ public class MusicTagSaveDto {
 
 
     @ApiModelProperty("标签id ")
+    @NotNull(groups = Update.class,message = "标签ID不能为空")
     private Long id;
 
     @ApiModelProperty("父级标签id ")