From 3c75c1b85a7accf9c78e2d8b62aa5c2e2f16c70f Mon Sep 17 00:00:00 2001
From: haoxr <1490493387@qq.com>
Date: Thu, 8 Jul 2021 23:03:49 +0800
Subject: [PATCH] =?UTF-8?q?fix(RoleController.java):=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E8=A7=92=E8=89=B2=E6=97=B6=E5=90=8D=E7=A7=B0=E9=87=8D=E5=A4=8D?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes I3ZONS
---
README.md | 8 ++++++--
pom.xml | 2 +-
.../controller/{v1 => }/DashboardController.java | 2 +-
.../admin/controller/{v1 => }/DeptController.java | 2 +-
.../admin/controller/{v1 => }/DictController.java | 2 +-
.../controller/{v1 => }/DictItemController.java | 2 +-
.../admin/controller/{v1 => }/FileController.java | 2 +-
.../admin/controller/{v1 => }/MenuController.java | 2 +-
.../controller/{v1 => }/OauthClientController.java | 2 +-
.../controller/{v1 => }/PermissionController.java | 2 +-
.../admin/controller/{v1 => }/RoleController.java | 12 ++++++++----
.../admin/controller/{v1 => }/RouteController.java | 2 +-
.../admin/controller/{v1 => }/TokenController.java | 2 +-
.../admin/controller/{v1 => }/UserController.java | 2 +-
.../gateway/security/ResourceServerManager.java | 1 -
15 files changed, 26 insertions(+), 19 deletions(-)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/DashboardController.java (99%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/DeptController.java (99%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/DictController.java (99%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/DictItemController.java (99%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/FileController.java (98%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/MenuController.java (99%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/OauthClientController.java (98%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/PermissionController.java (99%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/RoleController.java (95%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/RouteController.java (95%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/TokenController.java (96%)
rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/{v1 => }/UserController.java (99%)
diff --git a/README.md b/README.md
index c45ad0d02..b25cad861 100644
--- a/README.md
+++ b/README.md
@@ -157,10 +157,14 @@ youlai-mall
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| ![image-20210622000304570](https://gitee.com/haoxr/image/raw/master/image-20210622000304570.png) | ![image-20210622000046029](https://gitee.com/haoxr/image/raw/master/image-20210622000046029.png) |
+## 项目文档
+[项目文档地址](https://www.cnblogs.com/haoxianrui/)
-## Stargazers over time
+## Star趋势
+- Github
[![Github](https://starchart.cc/hxrui/youlai-mall.svg)](https://starchart.cc/hxrui/youlai-mall)
+- Gitee
[![Gitee](https://whnb.wang/stars/youlaitech/youlai-mall)](https://whnb.wang/stars/youlaitech/youlai-mall)
## contributors
@@ -168,7 +172,7 @@ youlai-mall
## 联系信息
-因为微信交流群超过200人了,只能通过邀请进入群聊,添加开发人员(PS:日常上班时间建议选择没有头像的)后由其拉进群,相互交流学习,备注“**有来**”即可。
+因为微信交流群满200人只能通过邀请进入,如果想进入交流群学习可添加以下开发人员,备注“**有来**“由其拉进群。
| ![](https://gitee.com/haoxr/image/raw/master/default/113__6c5ed5b1b73ea9cd4cf32848ed350c07_b9b214638a2a406e52dbf51e9bf9a2ef.png) | ![](https://gitee.com/haoxr/image/raw/master/hxr.jpg) | ![](https://gitee.com/haoxr/image/raw/master/huawei.jpg) | ![](https://gitee.com/haoxr/image/raw/master/default/1625149769(1).png) |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
diff --git a/pom.xml b/pom.xml
index c11a6da0c..5c78e03b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.5.0
+ 2.5.2
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DashboardController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DashboardController.java
similarity index 99%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DashboardController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DashboardController.java
index 4b4879063..772c1c2bf 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DashboardController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DashboardController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DeptController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java
similarity index 99%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DeptController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java
index 68dbf4aeb..8fd5f8b49 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DeptController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DictController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java
similarity index 99%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DictController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java
index 189b5f180..49f486f15 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DictController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DictItemController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java
similarity index 99%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DictItemController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java
index f661b60a5..d0fb56cce 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/DictItemController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/FileController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/FileController.java
similarity index 98%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/FileController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/FileController.java
index ad60e2c15..bfab7cee6 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/FileController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/FileController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.util.IdUtil;
import com.youlai.admin.service.impl.MinioService;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/MenuController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java
similarity index 99%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/MenuController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java
index ecbb24e6a..a2ff46bfa 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/MenuController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/OauthClientController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/OauthClientController.java
similarity index 98%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/OauthClientController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/OauthClientController.java
index 09c07764f..011b07217 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/OauthClientController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/OauthClientController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/PermissionController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/PermissionController.java
similarity index 99%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/PermissionController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/PermissionController.java
index 848a50522..091f7853f 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/PermissionController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/PermissionController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/RoleController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RoleController.java
similarity index 95%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/RoleController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RoleController.java
index 4457b0bd4..366e3a51f 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/RoleController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RoleController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
@@ -90,9 +90,11 @@ public class RoleController {
@PostMapping
public Result add(@RequestBody SysRole role) {
int count = iSysRoleService.count(new LambdaQueryWrapper()
- .eq(SysRole::getCode, role.getCode())
+ .eq(SysRole::getCode, role.getCode() )
+ .or()
+ .eq(SysRole::getName,role.getName())
);
- Assert.isTrue(count == 0, "角色编码已存在");
+ Assert.isTrue(count == 0, "角色名称或角色编码重复,请检查!");
boolean result = iSysRoleService.save(role);
return Result.judge(result);
}
@@ -108,9 +110,11 @@ public class RoleController {
@RequestBody SysRole role) {
int count = iSysRoleService.count(new LambdaQueryWrapper()
.eq(SysRole::getCode, role.getCode())
+ .or()
+ .eq(SysRole::getName,role.getName())
.ne(SysRole::getId, id)
);
- Assert.isTrue(count == 0, "角色编码已存在");
+ Assert.isTrue(count == 0, "角色名称或角色编码重复,请检查!");
boolean result = iSysRoleService.updateById(role);
if (result) {
iSysPermissionService.refreshPermRolesRules();
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/RouteController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RouteController.java
similarity index 95%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/RouteController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RouteController.java
index c6f9103a4..69861b360 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/RouteController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RouteController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import com.youlai.admin.pojo.vo.RouteVO;
import com.youlai.admin.service.ISysMenuService;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/TokenController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/TokenController.java
similarity index 96%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/TokenController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/TokenController.java
index 7ba841b55..32e636bfb 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/TokenController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/TokenController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import com.youlai.admin.service.ITokenService;
import com.youlai.common.result.Result;
diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/UserController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java
similarity index 99%
rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/UserController.java
rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java
index 78799a26a..c2642d3bd 100644
--- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/v1/UserController.java
+++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java
@@ -1,4 +1,4 @@
-package com.youlai.admin.controller.v1;
+package com.youlai.admin.controller;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
diff --git a/youlai-gateway/src/main/java/com/youlai/gateway/security/ResourceServerManager.java b/youlai-gateway/src/main/java/com/youlai/gateway/security/ResourceServerManager.java
index b17f3a95f..166baaa12 100644
--- a/youlai-gateway/src/main/java/com/youlai/gateway/security/ResourceServerManager.java
+++ b/youlai-gateway/src/main/java/com/youlai/gateway/security/ResourceServerManager.java
@@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil;
import com.youlai.common.constant.AuthConstants;
import com.youlai.common.constant.GlobalConstants;
import com.youlai.gateway.component.UrlPermRolesLocalCache;
-import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;