From 010fd2114aea3ea263fe0b0ea0eaf9bbb4d9f834 Mon Sep 17 00:00:00 2001 From: dongchunyu <1540770111@qq.com> Date: Fri, 10 Sep 2021 15:18:38 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix=EF=BC=9A=E5=88=A0=E9=99=A4=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E5=AD=97=E6=AE=B5=20fix=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E5=8C=85=20feat=EF=BC=9A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=9F=BA=E7=A1=80=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/biz/controller/LoginController.java | 2 +- .../system/biz/component/DataScopeUtil.java | 124 ++++++++--------- .../system/biz/config/DataScopeConfig.java | 34 +++++ .../system/biz/controller/UserController.java | 2 +- .../biz/dto/output/UserInfoListOutputDTO.java | 3 - .../com/dcy/system/biz/mapper/DeptMapper.java | 11 ++ .../com/dcy/system/biz/mapper/RoleMapper.java | 9 ++ .../dcy/system/biz/mapper/UserInfoMapper.java | 17 +++ .../system/biz/service/DictDataService.java | 3 +- .../system/biz/service/ResourcesService.java | 4 +- .../dcy/system/biz/service/RoleService.java | 56 ++++---- .../system/biz/service/UserInfoService.java | 21 ++- .../resources/mapper/system/ConfigMapper.xml | 16 +-- .../resources/mapper/system/DeptMapper.xml | 20 +-- .../mapper/system/DictDataMapper.xml | 17 +-- .../mapper/system/DictTypeMapper.xml | 17 +-- .../resources/mapper/system/LogMapper.xml | 30 ---- .../resources/mapper/system/PostMapper.xml | 12 -- .../mapper/system/ResourcesMapper.xml | 8 +- .../resources/mapper/system/RoleMapper.xml | 14 +- .../mapper/system/UserInfoMapper.xml | 24 +++- .../gateway/satoken/filter/SaTokenFilter.java | 3 +- .../db/base/enums/BaseModelDelFlagEnum.java | 23 ++++ .../dcy/db/base/enums}/RoleDataScopeEnum.java | 2 +- .../java/com/dcy/db/base/model/BaseModel.java | 12 ++ .../com/dcy/db/config/MybatisPlusConfig.java | 3 + .../dcy/db/mybatis/annotation/DataColumn.java | 32 +++++ .../dcy/db/mybatis/annotation/DataScope.java | 32 +++++ .../DataPermissionInterceptor.java | 129 ++++++++++++++++++ .../db/mybatis/model/DataColumnProperty.java | 56 ++++++++ .../db/mybatis/model/DataScopeProperty.java | 29 ++++ .../db/mybatis/model/DataScopeRoleModel.java | 25 ++++ .../service/AbstractDataScopeProvider.java | 10 ++ .../mybatis/service/IDataScopeProvider.java | 21 +++ .../db/mybatis/service/IDataScopeService.java | 43 ++++++ .../DictDataStatusEnum.java | 17 +-- .../ResourcesStatusEnum.java | 17 +-- .../ResourcesTypeEnum.java | 17 +-- .../UserInfoStatusEnum.java | 17 +-- .../{constant => enums}/UserInfoTypeEnum.java | 17 +-- .../java/com/dcy/system/api/model/Config.java | 4 +- .../java/com/dcy/system/api/model/Dept.java | 4 +- .../com/dcy/system/api/model/DictData.java | 7 +- .../com/dcy/system/api/model/DictType.java | 4 +- .../java/com/dcy/system/api/model/Post.java | 4 +- .../com/dcy/system/api/model/Resources.java | 8 +- .../java/com/dcy/system/api/model/Role.java | 7 +- .../com/dcy/system/api/model/UserInfo.java | 11 +- 48 files changed, 685 insertions(+), 313 deletions(-) create mode 100644 business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java delete mode 100644 business-center/system-center/src/main/resources/mapper/system/LogMapper.xml create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/enums/BaseModelDelFlagEnum.java rename inner-intergration/{common-spring-boot-starter/src/main/java/com/dcy/common/constant => db-spring-boot-starter/src/main/java/com/dcy/db/base/enums}/RoleDataScopeEnum.java (96%) create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataColumn.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataScope.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/interceptor/DataPermissionInterceptor.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataColumnProperty.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeProperty.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeRoleModel.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java create mode 100644 inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java rename service-api/system-api/src/main/java/com/dcy/system/api/{constant => enums}/DictDataStatusEnum.java (66%) rename service-api/system-api/src/main/java/com/dcy/system/api/{constant => enums}/ResourcesStatusEnum.java (66%) rename service-api/system-api/src/main/java/com/dcy/system/api/{constant => enums}/ResourcesTypeEnum.java (66%) rename service-api/system-api/src/main/java/com/dcy/system/api/{constant => enums}/UserInfoStatusEnum.java (66%) rename service-api/system-api/src/main/java/com/dcy/system/api/{constant => enums}/UserInfoTypeEnum.java (67%) diff --git a/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java b/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java index ef6290c..5445085 100644 --- a/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java +++ b/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java @@ -18,7 +18,7 @@ import com.dcy.common.utils.BPwdEncoderUtil; import com.dcy.db.base.controller.RBaseController; import com.dcy.system.api.api.ADeptService; import com.dcy.system.api.api.AUserService; -import com.dcy.system.api.constant.UserInfoStatusEnum; +import com.dcy.system.api.enums.UserInfoStatusEnum; import com.dcy.system.api.model.Role; import com.dcy.system.api.model.UserInfo; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java b/business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java index dff1834..b9db4c8 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java @@ -1,62 +1,62 @@ -package com.dcy.system.biz.component; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.lang.TypeReference; -import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.AbstractWrapper; -import com.dcy.common.constant.Constant; -import com.dcy.system.api.model.Role; -import com.dcy.system.biz.service.RoleService; -import org.apache.dubbo.rpc.RpcContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * @Author:dcy - * @Description: - * @Date: 2021/3/29 16:02 - */ -@Component -public class DataScopeUtil { - - @Autowired - private RoleService roleService; - - /** - * 数据过滤 - * - * @param wrapper - */ - public void dataScopeFilter(AbstractWrapper wrapper) { - dataScopeFilter(wrapper, null); - } - - /** - * 数据过滤 - * - * @param wrapper - * @param deptAlias 主表别名 - */ - public void dataScopeFilter(AbstractWrapper wrapper, String deptAlias) { - final String userId = RpcContext.getContext().getAttachment(Constant.USER_ID); - final Map allDataScopeFlagAndData = roleService.getAllDataScopeFlagAndDataByUserId(userId); - final Boolean allDataScope = MapUtil.getBool(allDataScopeFlagAndData, "allDataScope"); - if (!allDataScope) { - // 有数据范围 - List roleList = MapUtil.get(allDataScopeFlagAndData, "roleList", new TypeReference>() { - }); - Set dataScopeList = roleService.getDateScopeDeptIds(userId, roleList); - if (StrUtil.isNotBlank(deptAlias)) { - wrapper.apply(StrUtil.format(" {}.dept_id in ({})", deptAlias, CollUtil.join(dataScopeList, ",", "\"", "\""))); - } else { - wrapper.apply(StrUtil.format(" dept_id in ({})", CollUtil.join(dataScopeList, ",", "\"", "\""))); - } - } - } - -} +//package com.dcy.system.biz.component; +// +//import cn.hutool.core.collection.CollUtil; +//import cn.hutool.core.lang.TypeReference; +//import cn.hutool.core.map.MapUtil; +//import cn.hutool.core.util.StrUtil; +//import com.baomidou.mybatisplus.core.conditions.AbstractWrapper; +//import com.dcy.common.constant.Constant; +//import com.dcy.system.api.model.Role; +//import com.dcy.system.biz.service.RoleService; +//import org.apache.dubbo.rpc.RpcContext; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.List; +//import java.util.Map; +//import java.util.Set; +// +///** +// * @Author:dcy +// * @Description: +// * @Date: 2021/3/29 16:02 +// */ +//@Component +//public class DataScopeUtil { +// +// @Autowired +// private RoleService roleService; +// +// /** +// * 数据过滤 +// * +// * @param wrapper +// */ +// public void dataScopeFilter(AbstractWrapper wrapper) { +// dataScopeFilter(wrapper, null); +// } +// +// /** +// * 数据过滤 +// * +// * @param wrapper +// * @param deptAlias 主表别名 +// */ +// public void dataScopeFilter(AbstractWrapper wrapper, String deptAlias) { +// final String userId = RpcContext.getContext().getAttachment(Constant.USER_ID); +// final Map allDataScopeFlagAndData = roleService.getAllDataScopeFlagAndDataByUserId(userId); +// final Boolean allDataScope = MapUtil.getBool(allDataScopeFlagAndData, "allDataScope"); +// if (!allDataScope) { +// // 有数据范围 +// List roleList = MapUtil.get(allDataScopeFlagAndData, "roleList", new TypeReference>() { +// }); +// Set dataScopeList = roleService.getDateScopeDeptIds(userId, roleList); +// if (StrUtil.isNotBlank(deptAlias)) { +// wrapper.apply(StrUtil.format(" {}.dept_id in ({})", deptAlias, CollUtil.join(dataScopeList, ",", "\"", "\""))); +// } else { +// wrapper.apply(StrUtil.format(" dept_id in ({})", CollUtil.join(dataScopeList, ",", "\"", "\""))); +// } +// } +// } +// +//} diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java b/business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java new file mode 100644 index 0000000..80548fd --- /dev/null +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java @@ -0,0 +1,34 @@ +package com.dcy.system.biz.config; + +import com.dcy.common.constant.Constant; +import com.dcy.db.mybatis.model.DataScopeProperty; +import com.dcy.db.mybatis.service.AbstractDataScopeProvider; +import com.dcy.db.mybatis.service.IDataScopeProvider; +import lombok.extern.slf4j.Slf4j; +import net.sf.jsqlparser.statement.select.PlainSelect; +import org.apache.dubbo.rpc.RpcContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @Author:dcy + * @Description: + * @Date: 2021/9/9 14:17 + */ +@Slf4j +@Configuration +public class DataScopeConfig { + + @Bean + public IDataScopeProvider dataScopeProvider() { + return new AbstractDataScopeProvider() { + @Override + public void setWhere(DataScopeProperty dataScope, PlainSelect plainSelect) { + final String userId = RpcContext.getContext().getAttachment(Constant.USER_ID); + log.info(userId); + log.info(plainSelect.toString()); + log.info(dataScope.toString()); + } + }; + } +} diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java index 5802ee3..5cda71f 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java @@ -68,7 +68,7 @@ public class UserController extends BaseController { // 转换model UserInfo userInfo = mUserInfoMapper.userInfoSearchInputDTOToUserInfo(userInfoSearchInputDTO); // 获取源对象 - IPage pageListByListInputDTO = baseService.getPageListByEntity(userInfo); + IPage pageListByListInputDTO = baseService.pageList(userInfo); // 转换新对象 List userInfoListOutputDTOS = mUserInfoMapper.userInfosToUserInfoListOutputDTOs(pageListByListInputDTO.getRecords()); // 返回业务分页数据 diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/dto/output/UserInfoListOutputDTO.java b/business-center/system-center/src/main/java/com/dcy/system/biz/dto/output/UserInfoListOutputDTO.java index e9cb11c..6c86ca8 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/dto/output/UserInfoListOutputDTO.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/dto/output/UserInfoListOutputDTO.java @@ -21,9 +21,6 @@ public class UserInfoListOutputDTO { @ApiModelProperty(value = "用户名") private String username; - @ApiModelProperty(value = "密码") - private String password; - @ApiModelProperty(value = "用户昵称") private String nickName; diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/DeptMapper.java b/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/DeptMapper.java index af1b0fd..722bf72 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/DeptMapper.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/DeptMapper.java @@ -2,6 +2,9 @@ package com.dcy.system.biz.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dcy.system.api.model.Dept; +import org.apache.ibatis.annotations.Param; + +import java.util.Set; /** *

@@ -13,4 +16,12 @@ import com.dcy.system.api.model.Dept; */ public interface DeptMapper extends BaseMapper { + /** + * 根据id 查询所有的子级 + * + * @param id 部门id + * @return + */ + Set selectChildrenById(@Param("id") String id); + } diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/RoleMapper.java b/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/RoleMapper.java index e09f442..0f2995d 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/RoleMapper.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/RoleMapper.java @@ -6,6 +6,7 @@ import com.dcy.system.api.model.Role; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; /** *

@@ -23,4 +24,12 @@ public interface RoleMapper extends BaseMapper { * @return */ List getAuthResourceListByRoleId(@Param("roleId") String roleId); + + /** + * 根据角色id 获取能看到的部门ids + * + * @param roleId 角色id + * @return + */ + Set selectAuthDeptIdsByRoleId(@Param("roleId") String roleId); } diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/UserInfoMapper.java b/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/UserInfoMapper.java index 22b4eae..4d05b47 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/UserInfoMapper.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/mapper/UserInfoMapper.java @@ -1,6 +1,11 @@ package com.dcy.system.biz.mapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.dcy.db.mybatis.annotation.DataColumn; +import com.dcy.db.mybatis.annotation.DataScope; import com.dcy.system.api.model.Role; import com.dcy.system.api.model.UserInfo; import org.apache.ibatis.annotations.Param; @@ -41,4 +46,16 @@ public interface UserInfoMapper extends BaseMapper { * @return */ Set getResourcesCodeByUserId(@Param("userId") String userId); + + /** + * 分页查询 + * + * @param page 分页对象 + * @param wrapper 条件参数 + * @return + */ + @DataScope(value = { + @DataColumn(alias = "userInfo", name = "dept_id") + }) + IPage selectPageList(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); } diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/service/DictDataService.java b/business-center/system-center/src/main/java/com/dcy/system/biz/service/DictDataService.java index 3ba8de2..327b0be 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/service/DictDataService.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/service/DictDataService.java @@ -4,9 +4,8 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.dcy.common.constant.Constant; import com.dcy.db.base.service.BaseService; -import com.dcy.system.api.constant.DictDataStatusEnum; +import com.dcy.system.api.enums.DictDataStatusEnum; import com.dcy.system.api.model.DictData; import com.dcy.system.biz.mapper.DictDataMapper; import org.springframework.stereotype.Service; diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/service/ResourcesService.java b/business-center/system-center/src/main/java/com/dcy/system/biz/service/ResourcesService.java index 38a60ab..da76c67 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/service/ResourcesService.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/service/ResourcesService.java @@ -6,8 +6,8 @@ import com.dcy.common.constant.Constant; import com.dcy.common.utils.TreeUtil; import com.dcy.db.base.service.BaseService; import com.dcy.system.api.api.AResourcesService; -import com.dcy.system.api.constant.ResourcesStatusEnum; -import com.dcy.system.api.constant.ResourcesTypeEnum; +import com.dcy.system.api.enums.ResourcesStatusEnum; +import com.dcy.system.api.enums.ResourcesTypeEnum; import com.dcy.system.api.model.Resources; import com.dcy.system.api.model.RoleRes; import com.dcy.system.biz.mapper.ResourcesMapper; diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java b/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java index 0955197..91cf7bb 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java @@ -8,8 +8,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.dcy.common.constant.Constant; -import com.dcy.common.constant.RoleDataScopeEnum; +import com.dcy.db.base.enums.RoleDataScopeEnum; +import com.dcy.db.mybatis.model.DataScopeRoleModel; import com.dcy.db.base.service.BaseService; +import com.dcy.db.mybatis.service.IDataScopeService; import com.dcy.system.api.model.*; import com.dcy.system.biz.mapper.*; import org.springframework.beans.factory.annotation.Autowired; @@ -31,7 +33,7 @@ import java.util.stream.Collectors; * @since 2020-08-19 */ @Service -public class RoleService extends BaseService { +public class RoleService extends BaseService implements IDataScopeService { @Autowired private RoleResMapper roleResMapper; @@ -182,6 +184,7 @@ public class RoleService extends BaseService { * @return */ @Cacheable(value = "role:data-scope-flag", key = "#userId") + @Override public Map getAllDataScopeFlagAndDataByUserId(String userId) { // 设置数据范围类型 final List roleList = userInfoMapper.getAuthRoleListByUserId(userId); @@ -203,51 +206,42 @@ public class RoleService extends BaseService { */ @Cacheable(value = "role:data-scope", key = "#userId") @Transactional(readOnly = true) - public Set getDateScopeDeptIds(String userId, List roleList) { - Set deptIds = new HashSet<>(); + @Override + public Set getDateScopeDeptIds(final String userId, final List roleList) { + Set authDeptIds = new HashSet<>(); roleList.forEach(role -> { // 获取枚举值 - RoleDataScopeEnum dataScope = RoleDataScopeEnum.getByCode(role.getDataScope()); + final RoleDataScopeEnum dataScope = RoleDataScopeEnum.getByCode(role.getDataScope()); if (dataScope != null) { switch (dataScope) { case CUSTOM: - List collect = roleDeptMapper.selectList(Wrappers.lambdaQuery().eq(RoleDept::getRoleId, role.getId())) - .stream() - .map(RoleDept::getDeptId) - .collect(Collectors.toList()); - deptIds.addAll(collect); + // 获取能看到的部门ids + final Set seeDeptIds = baseMapper.selectAuthDeptIdsByRoleId(role.getId()); + if (CollUtil.isNotEmpty(seeDeptIds)){ + authDeptIds.addAll(seeDeptIds); + } break; case ME_DEPT: // 获取用户信息 UserInfo userInfo = userInfoMapper.selectById(userId); - deptIds.add(userInfo.getDeptId()); + authDeptIds.add(userInfo.getDeptId()); break; case ME_DEPT_CHILD: - UserInfo userInfo2 = userInfoMapper.selectById(userId); - if (StrUtil.isNotBlank(userInfo2.getDeptId())) { - List newDeptList = new ArrayList<>(); - newDeptList.add(userInfo2.getDeptId()); - Dept dept = deptMapper.selectById(userInfo2.getDeptId()); - // 查询第一层子级数据 - List deptList = deptMapper.selectList(Wrappers.lambdaQuery().eq(Dept::getParentId, dept.getId())); - // 递归查询子级数据 - getDeptChild(newDeptList, deptList); - deptIds.addAll(newDeptList); + UserInfo userInfoOne = userInfoMapper.selectById(userId); + if (StrUtil.isNotBlank(userInfoOne.getDeptId())) { + authDeptIds.add(userInfoOne.getDeptId()); + // 查询所有的子级 + final Set childrenIds = deptMapper.selectChildrenById(userInfoOne.getDeptId()); + if (CollUtil.isNotEmpty(childrenIds)){ + authDeptIds.addAll(childrenIds); + } } break; + default: } } }); - return deptIds; + return authDeptIds; } - private void getDeptChild(List newDeptList, List deptList) { - if (CollUtil.isNotEmpty(deptList)) { - deptList.forEach(dept -> { - List deptList1 = deptMapper.selectList(Wrappers.lambdaQuery().eq(Dept::getParentId, dept.getId())); - newDeptList.add(dept.getId()); - getDeptChild(newDeptList, deptList1); - }); - } - } } diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/service/UserInfoService.java b/business-center/system-center/src/main/java/com/dcy/system/biz/service/UserInfoService.java index 8d47c6b..1a526c7 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/service/UserInfoService.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/service/UserInfoService.java @@ -9,13 +9,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.dcy.common.constant.Constant; +import com.dcy.db.base.enums.BaseModelDelFlagEnum; +import com.dcy.db.base.model.BaseModel; import com.dcy.db.base.service.BaseService; import com.dcy.system.api.api.AUserService; import com.dcy.system.api.model.Role; import com.dcy.system.api.model.UserInfo; import com.dcy.system.api.model.UserPost; import com.dcy.system.api.model.UserRole; -import com.dcy.system.biz.component.DataScopeUtil; import com.dcy.system.biz.mapper.UserInfoMapper; import com.dcy.system.biz.mapper.UserPostMapper; import com.dcy.system.biz.mapper.UserRoleMapper; @@ -47,8 +48,6 @@ public class UserInfoService extends BaseService imple @Autowired private UserPostMapper userPostMapper; @Autowired - private DataScopeUtil dataScopeUtil; - @Autowired private RedisTemplate redisTemplate; /** @@ -119,25 +118,23 @@ public class UserInfoService extends BaseService imple } /** - * 获取用户分页数据多条件查询 + * 自定义sql分页查询 * * @param userInfo * @return */ - public IPage getPageListByEntity(UserInfo userInfo) { + public IPage pageList(UserInfo userInfo) { QueryWrapper queryWrapper = Wrappers.query(); - queryWrapper.like(StrUtil.isNotBlank(userInfo.getUsername()), UserInfo.USERNAME, userInfo.getUsername()); + queryWrapper.eq("userInfo." + BaseModel.DEL_FLAG, BaseModelDelFlagEnum.NORMAL.code); + queryWrapper.like(StrUtil.isNotBlank(userInfo.getUsername()), "userInfo." + UserInfo.USERNAME, userInfo.getUsername()); if (StrUtil.isNotBlank(userInfo.getDeptId())) { - // u.dept_id = 100 OR u.dept_id IN (SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(100, ancestors) queryWrapper.and(userInfoQueryWrapper -> { - userInfoQueryWrapper.eq(UserInfo.DEPT_ID, userInfo.getDeptId()) - .or().inSql(UserInfo.DEPT_ID, "SELECT sys_dept.id FROM sys_dept WHERE FIND_IN_SET('" + userInfo.getDeptId() + "', ancestors)"); + userInfoQueryWrapper.eq("userInfo." + UserInfo.DEPT_ID, userInfo.getDeptId()) + .or().inSql("userInfo." + UserInfo.DEPT_ID, "SELECT sys_dept.id FROM sys_dept WHERE FIND_IN_SET('" + userInfo.getDeptId() + "', ancestors)"); } ); } - // 添加数据权限 - dataScopeUtil.dataScopeFilter(queryWrapper); - return super.page(userInfo, queryWrapper); + return baseMapper.selectPageList(getPagePlusInfo(userInfo), queryWrapper); } /** diff --git a/business-center/system-center/src/main/resources/mapper/system/ConfigMapper.xml b/business-center/system-center/src/main/resources/mapper/system/ConfigMapper.xml index 307abc1..66c002c 100644 --- a/business-center/system-center/src/main/resources/mapper/system/ConfigMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/ConfigMapper.xml @@ -9,25 +9,11 @@ - - - - - - - id, config_name, config_key, config_value, config_type, create_by, create_date, update_by, update_date, - del_flag, remark + id, config_name, config_key, config_value, config_type - - - id AS id,config.config_name AS configName,config.config_key AS configKey,config.config_value - AS configValue,config.config_type AS configType,config.create_by AS createBy,config.create_date AS - createDate,config.update_by AS updateBy,config.update_date AS updateDate,config.del_flag AS - delFlag,config.remark - diff --git a/business-center/system-center/src/main/resources/mapper/system/DeptMapper.xml b/business-center/system-center/src/main/resources/mapper/system/DeptMapper.xml index 7fc5b0d..15f66a3 100644 --- a/business-center/system-center/src/main/resources/mapper/system/DeptMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/DeptMapper.xml @@ -12,27 +12,15 @@ - - - - - - - create_by, - create_date, - update_by, - update_date, - del_flag, - remark, id, parent_id, ancestors, name, dept_sort, phone, email, dept_status - - - system.id,system.parent_id AS parentId,system.ancestors,system.name,system.dept_sort AS deptSort,system.phone,system.email,system.dept_status AS deptStatus - + + diff --git a/business-center/system-center/src/main/resources/mapper/system/DictDataMapper.xml b/business-center/system-center/src/main/resources/mapper/system/DictDataMapper.xml index dce3b03..1ba7d61 100644 --- a/business-center/system-center/src/main/resources/mapper/system/DictDataMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/DictDataMapper.xml @@ -13,27 +13,12 @@ - - - - - - - create_by, - create_date, - update_by, - update_date, - del_flag, - remark, id, parent_id, dict_label, dict_value, dict_type, dict_sort, css_class, list_class, dict_status - - - system.id,system.parent_id AS parentId,system.dict_label AS dictLabel,system.dict_value AS dictValue,system.dict_type AS dictType,system.dict_sort AS dictSort,system.css_class AS cssClass,system.list_class AS listClass,system.dict_status AS dictStatus - + diff --git a/business-center/system-center/src/main/resources/mapper/system/DictTypeMapper.xml b/business-center/system-center/src/main/resources/mapper/system/DictTypeMapper.xml index 2b82abc..660591d 100644 --- a/business-center/system-center/src/main/resources/mapper/system/DictTypeMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/DictTypeMapper.xml @@ -8,27 +8,12 @@ - - - - - - - create_by, - create_date, - update_by, - update_date, - del_flag, - remark, id, dict_name, dict_type, dict_status - - - system.id,system.dict_name AS dictName,system.dict_type AS dictType,system.dict_status AS dictStatus - + diff --git a/business-center/system-center/src/main/resources/mapper/system/LogMapper.xml b/business-center/system-center/src/main/resources/mapper/system/LogMapper.xml deleted file mode 100644 index bff4d97..0000000 --- a/business-center/system-center/src/main/resources/mapper/system/LogMapper.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - create_date, - id, oper_name, oper_param, url, ip, business_name, method, result, log_status, error - - - - - admin.id,admin.oper_name AS operName,admin.oper_param AS operParam,admin.url,admin.ip,admin.business_name AS businessName,admin.method,admin.result,admin.log_status AS logStatus,admin.error - - diff --git a/business-center/system-center/src/main/resources/mapper/system/PostMapper.xml b/business-center/system-center/src/main/resources/mapper/system/PostMapper.xml index a7653db..b3f923c 100644 --- a/business-center/system-center/src/main/resources/mapper/system/PostMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/PostMapper.xml @@ -9,22 +9,10 @@ - - - - - - - create_by, - create_date, - update_by, - update_date, - del_flag, - remark, id, post_code, post_name, post_sort, post_status diff --git a/business-center/system-center/src/main/resources/mapper/system/ResourcesMapper.xml b/business-center/system-center/src/main/resources/mapper/system/ResourcesMapper.xml index 55d6499..4c84716 100644 --- a/business-center/system-center/src/main/resources/mapper/system/ResourcesMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/ResourcesMapper.xml @@ -14,16 +14,10 @@ - - - - - - - id, parent_id, parent_ids, res_name, res_code, res_path, http_method, res_status, res_type, res_sort, create_by, create_date, update_by, update_date, del_flag, remark + id, parent_id, parent_ids, res_name, res_code, res_path, http_method, res_status, res_type, res_sort diff --git a/business-center/system-center/src/main/resources/mapper/system/RoleMapper.xml b/business-center/system-center/src/main/resources/mapper/system/RoleMapper.xml index 74c8579..fecd107 100644 --- a/business-center/system-center/src/main/resources/mapper/system/RoleMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/RoleMapper.xml @@ -9,17 +9,11 @@ - - - - - - - id, role_name, role_key, role_status, create_by, create_date, update_by, update_date, del_flag, remark + id, role_name, role_key, role_status @@ -33,7 +27,11 @@ FROM sys_role role INNER JOIN sys_role_res rr on role.id = rr.role_id INNER JOIN sys_resources res on rr.res_id = res.id - WHERE res.del_flag = 0 and role.id = #{roleId} + WHERE role.id = #{roleId} + + + diff --git a/business-center/system-center/src/main/resources/mapper/system/UserInfoMapper.xml b/business-center/system-center/src/main/resources/mapper/system/UserInfoMapper.xml index e33af08..e8a9dea 100644 --- a/business-center/system-center/src/main/resources/mapper/system/UserInfoMapper.xml +++ b/business-center/system-center/src/main/resources/mapper/system/UserInfoMapper.xml @@ -25,12 +25,16 @@ - id, dept_id, username, password, nick_name, user_type, email, phone_number, sex, avatar_path, user_status, create_by, create_date, update_by, update_date, del_flag, remark + id, dept_id, username, password, nick_name, user_type, email, phone_number, sex, avatar_path, user_status + + + + + userInfo.id,userInfo.dept_id AS deptId,userInfo.username,userInfo.password,userInfo.nick_name AS nickName,userInfo.user_type AS userType,userInfo.email,userInfo.phone_number AS phoneNumber,userInfo.sex,userInfo.avatar_path AS avatarPath,userInfo.user_status AS userStatus - role.id AS id,role.role_name AS roleName,role.role_key AS roleKey,role.role_status AS - roleStatus,role.data_scope as dataScope + role.id AS id,role.role_name AS roleName,role.role_key AS roleKey,role.role_status AS roleStatus,role.data_scope as dataScope + + + diff --git a/gateway-center/src/main/java/com/dcy/gateway/satoken/filter/SaTokenFilter.java b/gateway-center/src/main/java/com/dcy/gateway/satoken/filter/SaTokenFilter.java index 168fd92..39dc76d 100644 --- a/gateway-center/src/main/java/com/dcy/gateway/satoken/filter/SaTokenFilter.java +++ b/gateway-center/src/main/java/com/dcy/gateway/satoken/filter/SaTokenFilter.java @@ -6,7 +6,6 @@ import cn.dev33.satoken.filter.SaFilterErrorStrategy; import cn.dev33.satoken.reactor.context.SaReactorHolder; import cn.dev33.satoken.reactor.context.SaReactorSyncHolder; import cn.dev33.satoken.router.SaRouter; -import cn.dev33.satoken.router.SaRouterUtil; import cn.dev33.satoken.session.SaSession; import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.util.SaTokenConsts; @@ -17,7 +16,7 @@ import com.dcy.common.constant.Constant; import com.dcy.common.model.LoginAccount; import com.dcy.common.model.R; import com.dcy.system.api.api.AResourcesService; -import com.dcy.system.api.constant.UserInfoTypeEnum; +import com.dcy.system.api.enums.UserInfoTypeEnum; import com.dcy.system.api.model.Resources; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.config.annotation.DubboReference; diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/enums/BaseModelDelFlagEnum.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/enums/BaseModelDelFlagEnum.java new file mode 100644 index 0000000..b4f602d --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/enums/BaseModelDelFlagEnum.java @@ -0,0 +1,23 @@ +package com.dcy.db.base.enums; + +/** + * @Author:dcy + * @Description: 公共类删除标识枚举类 + * @Date: 2021/9/2 15:28 + */ +public enum BaseModelDelFlagEnum { + + //删除标识(0:正常;1:已删除) + NORMAL("0", "正常"), + DELETED("1", "已删除"), + ; + + public final String code; + public final String name; + + BaseModelDelFlagEnum(String code, String name) { + this.code = code; + this.name = name; + } + +} diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/constant/RoleDataScopeEnum.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/enums/RoleDataScopeEnum.java similarity index 96% rename from inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/constant/RoleDataScopeEnum.java rename to inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/enums/RoleDataScopeEnum.java index 6e256e5..2d9bab3 100644 --- a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/constant/RoleDataScopeEnum.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/enums/RoleDataScopeEnum.java @@ -1,4 +1,4 @@ -package com.dcy.common.constant; +package com.dcy.db.base.enums; import cn.hutool.core.util.StrUtil; diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/model/BaseModel.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/model/BaseModel.java index da87bb8..5b61e51 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/model/BaseModel.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/model/BaseModel.java @@ -57,4 +57,16 @@ public class BaseModel extends PageModel implements Serializable { * 备注 */ private String remark; + + public static final String CREATE_BY = "create_by"; + + public static final String CREATE_DATE = "create_date"; + + public static final String UPDATE_BY = "update_by"; + + public static final String UPDATE_DATE = "update_date"; + + public static final String DEL_FLAG = "del_flag"; + + public static final String REMARK = "remark"; } diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/config/MybatisPlusConfig.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/config/MybatisPlusConfig.java index 037e9ad..5ede9b5 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/config/MybatisPlusConfig.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/config/MybatisPlusConfig.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.MybatisMapWrapperFactory; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import com.dcy.db.mybatis.interceptor.DataPermissionInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -24,6 +25,8 @@ public class MybatisPlusConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor() { MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor(); + // 数据权限拦截器 + mybatisPlusInterceptor.addInnerInterceptor(new DataPermissionInterceptor()); //分页拦截器 mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor()); // 攻击 SQL 阻断解析器,防止全表更新与删除 diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataColumn.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataColumn.java new file mode 100644 index 0000000..d082fae --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataColumn.java @@ -0,0 +1,32 @@ +package com.dcy.db.mybatis.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @Author:dcy + * @Description: 数据权限过滤字段 + * @Date: 2021/9/8 15:18 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ + ElementType.METHOD +}) +public @interface DataColumn { + + /** + * 别名 + * + * @return + */ + String alias(); + + /** + * 字段名 + * + * @return + */ + String name(); +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataScope.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataScope.java new file mode 100644 index 0000000..449c4e5 --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/annotation/DataScope.java @@ -0,0 +1,32 @@ +package com.dcy.db.mybatis.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @Author:dcy + * @Description: 数据权限过滤注解 + * @Date: 2021/9/8 15:18 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ + ElementType.METHOD +}) +public @interface DataScope { + + /** + * 区分类型 用于不同类型过滤字段不同 + * + * @return + */ + String type() default "dev"; + + /** + * 过滤字段 + * + * @return + */ + DataColumn[] value(); +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/interceptor/DataPermissionInterceptor.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/interceptor/DataPermissionInterceptor.java new file mode 100644 index 0000000..2338d09 --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/interceptor/DataPermissionInterceptor.java @@ -0,0 +1,129 @@ +package com.dcy.db.mybatis.interceptor; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.spring.SpringUtil; +import com.baomidou.mybatisplus.core.toolkit.PluginUtils; +import com.baomidou.mybatisplus.extension.parser.JsqlParserSupport; +import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; +import com.dcy.db.mybatis.annotation.DataColumn; +import com.dcy.db.mybatis.annotation.DataScope; +import com.dcy.db.mybatis.model.DataColumnProperty; +import com.dcy.db.mybatis.model.DataScopeProperty; +import com.dcy.db.mybatis.service.IDataScopeProvider; +import lombok.extern.slf4j.Slf4j; +import net.sf.jsqlparser.statement.select.PlainSelect; +import net.sf.jsqlparser.statement.select.Select; +import org.apache.ibatis.cache.CacheKey; +import org.apache.ibatis.executor.Executor; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.SqlCommandType; +import org.apache.ibatis.session.ResultHandler; +import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Component; + +import java.lang.reflect.Method; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author:dcy + * @Description: 数据权限mybatis拦截器 + * @Date: 2021/9/9 13:55 + */ +@Slf4j +@Component +public class DataPermissionInterceptor extends JsqlParserSupport implements InnerInterceptor { + + /** + * {@link Executor#query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql)} 操作前置处理 + *

+ * 改改sql啥的 + * + * @param executor Executor(可能是代理对象) + * @param ms MappedStatement + * @param parameter parameter + * @param rowBounds rowBounds + * @param resultHandler resultHandler + * @param boundSql boundSql + */ + @Override + public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException { + PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql); + mpBs.sql(parserSingle(mpBs.sql(), ms)); + } + + /** + * 查询 + * + * @param select + * @param index + * @param obj + */ + @Override + protected void processSelect(Select select, int index, Object obj) { + MappedStatement ms = PluginUtils.realTarget(obj); + // 先判断是不是SELECT操作 不是直接过滤 + if (!SqlCommandType.SELECT.equals(ms.getSqlCommandType())) { + return; + } + PlainSelect plainSelect = (PlainSelect) select.getSelectBody(); + authHandler(ms, plainSelect); + } + + /** + * 鉴权处理 + * + * @param ms + * @param plainSelect + */ + private void authHandler(MappedStatement ms, PlainSelect plainSelect) { + //获取执行方法的位置 + String namespace = ms.getId(); + //log.info("namespace {} ", namespace); + //获取mapper名称 + String className = StrUtil.subBefore(namespace, ".", true); + //log.info("className {} ", className); + //获取方法名 + String methodName = StrUtil.subAfter(namespace, ".", true); + //log.info("methodName {} ", methodName); + try { + final Method[] methods = Class.forName(className).getDeclaredMethods(); + for (Method method : methods) { + if (method.getName().equals(methodName)) { + //获取注解 来判断是不是要储存sql + DataScope dataScope = method.getAnnotation(DataScope.class); + if (dataScope != null) { + dataPermissionHandler(dataScope, plainSelect); + } + } + } + } catch (ClassNotFoundException e) { + log.error("找不到文件 {}", e.toString()); + } + } + + /** + * 数据权限处理 + * + * @param dataScope 权限注解 + * @param plainSelect sql + */ + private void dataPermissionHandler(DataScope dataScope, PlainSelect plainSelect) { + final IDataScopeProvider iDataScopeProvider = SpringUtil.getBean(IDataScopeProvider.class); + if (iDataScopeProvider != null) { + final DataScopeProperty dataScopeProperty = new DataScopeProperty(); + dataScopeProperty.setType(dataScope.type()); + List columns = new ArrayList<>(dataScope.value().length); + for (DataColumn dataColumn : dataScope.value()) { + final DataColumnProperty dataColumnProperty = new DataColumnProperty(); + dataColumnProperty.setAlias(dataColumn.alias()); + dataColumnProperty.setName(dataColumn.name()); + columns.add(dataColumnProperty); + } + dataScopeProperty.setColumns(columns); + iDataScopeProvider.setWhere(dataScopeProperty, plainSelect); + } + } +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataColumnProperty.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataColumnProperty.java new file mode 100644 index 0000000..f56c97d --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataColumnProperty.java @@ -0,0 +1,56 @@ +package com.dcy.db.mybatis.model; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +/** + * @Author:dcy + * @Description: 数据权限过滤字段对象 + * @Date: 2021/9/8 15:18 + */ +@Getter +@Setter +@ToString +public class DataColumnProperty { + + /** + * 别名 + * + * @return + */ + private String alias; + + /** + * 字段名 + * + * @return + */ + private String name; + + /** + * 拼接字段名称 + */ + private String aliasName; + + public DataColumnProperty() { + + } + + public DataColumnProperty(String alias, String name, String aliasName) { + this.alias = alias; + this.name = name; + this.aliasName = aliasName; + } + + public String getAliasName() { + String column = this.name; + if (StrUtil.isNotBlank(this.alias)) { + column = StrUtil.builder().append(this.alias).append(StringPool.DOT).append(this.name).toString(); + } + return column; + } + +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeProperty.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeProperty.java new file mode 100644 index 0000000..c7dccb1 --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeProperty.java @@ -0,0 +1,29 @@ +package com.dcy.db.mybatis.model; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.List; + +/** + * @Author:dcy + * @Description: 数据权限过滤注解对象 + * @Date: 2021/9/9 14:04 + */ +@Getter +@Setter +@ToString +public class DataScopeProperty { + + /** + * 类型 + */ + private String type; + + /** + * 字段名称 + */ + private List columns; + +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeRoleModel.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeRoleModel.java new file mode 100644 index 0000000..1f01434 --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/model/DataScopeRoleModel.java @@ -0,0 +1,25 @@ +package com.dcy.db.mybatis.model; + +/** + * @Author:dcy + * @Description: 角色权限model + * @Date: 2021/9/3 14:29 + */ +public interface DataScopeRoleModel { + + /** + * 角色id + * + * @return 角色id + */ + String getId(); + + /** + * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) + * + * @return 数据范围 + * @see com.dcy.db.base.enums.RoleDataScopeEnum + */ + String getDataScope(); + +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java new file mode 100644 index 0000000..7c57a16 --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java @@ -0,0 +1,10 @@ +package com.dcy.db.mybatis.service; + +/** + * @Author:dcy + * @Description: + * @Date: 2021/9/9 14:14 + */ +public abstract class AbstractDataScopeProvider implements IDataScopeProvider { + +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java new file mode 100644 index 0000000..76cbaee --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java @@ -0,0 +1,21 @@ +package com.dcy.db.mybatis.service; + +import com.dcy.db.mybatis.model.DataScopeProperty; +import net.sf.jsqlparser.statement.select.PlainSelect; + +/** + * @Author:dcy + * @Description: 处理数据权限 + * @Date: 2021/9/9 14:01 + */ +public interface IDataScopeProvider { + + /** + * 设置条件 + * + * @param dataScope + * @param plainSelect + */ + void setWhere(DataScopeProperty dataScope, PlainSelect plainSelect); + +} diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java new file mode 100644 index 0000000..2b4effd --- /dev/null +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java @@ -0,0 +1,43 @@ +package com.dcy.db.mybatis.service; + +import com.dcy.db.mybatis.model.DataScopeRoleModel; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @Author:dcy + * @Description: + * @Date: 2021/9/3 14:24 + */ +public interface IDataScopeService { + + /** + * 是否有全部数据权限 + */ + String ALL_DATA_SCOPE_FLAG = "all-data-scope"; + + /** + * 角色列表 + */ + String ROLE_LIST = "role-list"; + + /** + * 获取角色列表和是否有全部数据权限 + * + * @param userId 用户id + * @return + */ + Map getAllDataScopeFlagAndDataByUserId(String userId); + + + /** + * 根据用户id和角色列表查询 获取所有的部门id + * + * @param userId 用户id + * @param roleList 角色列表 + * @return + */ + Set getDateScopeDeptIds(String userId, List roleList); +} diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/constant/DictDataStatusEnum.java b/service-api/system-api/src/main/java/com/dcy/system/api/enums/DictDataStatusEnum.java similarity index 66% rename from service-api/system-api/src/main/java/com/dcy/system/api/constant/DictDataStatusEnum.java rename to service-api/system-api/src/main/java/com/dcy/system/api/enums/DictDataStatusEnum.java index 9f540f4..f9c6f46 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/constant/DictDataStatusEnum.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/enums/DictDataStatusEnum.java @@ -1,7 +1,9 @@ -package com.dcy.system.api.constant; +package com.dcy.system.api.enums; import cn.hutool.core.util.StrUtil; +import java.util.stream.Stream; + /** * @Author:dcy * @Description: @@ -29,14 +31,9 @@ public enum DictDataStatusEnum { * @return */ public static DictDataStatusEnum getByCode(String code) { - if (StrUtil.isBlank(code)) { - return null; - } - for (DictDataStatusEnum enums : DictDataStatusEnum.values()) { - if (enums.code.equals(code)) { - return enums; - } - } - return null; + return Stream.of(DictDataStatusEnum.values()) + .filter(dictDataStatusEnum -> dictDataStatusEnum.code.equals(code)) + .findAny() + .orElse(null); } } diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/constant/ResourcesStatusEnum.java b/service-api/system-api/src/main/java/com/dcy/system/api/enums/ResourcesStatusEnum.java similarity index 66% rename from service-api/system-api/src/main/java/com/dcy/system/api/constant/ResourcesStatusEnum.java rename to service-api/system-api/src/main/java/com/dcy/system/api/enums/ResourcesStatusEnum.java index 25008e8..acd023a 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/constant/ResourcesStatusEnum.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/enums/ResourcesStatusEnum.java @@ -1,7 +1,9 @@ -package com.dcy.system.api.constant; +package com.dcy.system.api.enums; import cn.hutool.core.util.StrUtil; +import java.util.stream.Stream; + /** * @Author:dcy * @Description: @@ -29,15 +31,10 @@ public enum ResourcesStatusEnum { * @return */ public static ResourcesStatusEnum getByCode(String code) { - if (StrUtil.isBlank(code)) { - return null; - } - for (ResourcesStatusEnum enums : ResourcesStatusEnum.values()) { - if (enums.code.equals(code)) { - return enums; - } - } - return null; + return Stream.of(ResourcesStatusEnum.values()) + .filter(resourcesStatusEnum -> resourcesStatusEnum.code.equals(code)) + .findAny() + .orElse(null); } } diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/constant/ResourcesTypeEnum.java b/service-api/system-api/src/main/java/com/dcy/system/api/enums/ResourcesTypeEnum.java similarity index 66% rename from service-api/system-api/src/main/java/com/dcy/system/api/constant/ResourcesTypeEnum.java rename to service-api/system-api/src/main/java/com/dcy/system/api/enums/ResourcesTypeEnum.java index d05af35..27bf9eb 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/constant/ResourcesTypeEnum.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/enums/ResourcesTypeEnum.java @@ -1,7 +1,9 @@ -package com.dcy.system.api.constant; +package com.dcy.system.api.enums; import cn.hutool.core.util.StrUtil; +import java.util.stream.Stream; + /** * @Author:dcy * @Description: @@ -29,14 +31,9 @@ public enum ResourcesTypeEnum { * @return */ public static ResourcesTypeEnum getByCode(String code) { - if (StrUtil.isBlank(code)) { - return null; - } - for (ResourcesTypeEnum enums : ResourcesTypeEnum.values()) { - if (enums.code.equals(code)) { - return enums; - } - } - return null; + return Stream.of(ResourcesTypeEnum.values()) + .filter(resourcesTypeEnum -> resourcesTypeEnum.code.equals(code)) + .findAny() + .orElse(null); } } diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/constant/UserInfoStatusEnum.java b/service-api/system-api/src/main/java/com/dcy/system/api/enums/UserInfoStatusEnum.java similarity index 66% rename from service-api/system-api/src/main/java/com/dcy/system/api/constant/UserInfoStatusEnum.java rename to service-api/system-api/src/main/java/com/dcy/system/api/enums/UserInfoStatusEnum.java index 437d3f8..de13fbd 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/constant/UserInfoStatusEnum.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/enums/UserInfoStatusEnum.java @@ -1,7 +1,9 @@ -package com.dcy.system.api.constant; +package com.dcy.system.api.enums; import cn.hutool.core.util.StrUtil; +import java.util.stream.Stream; + /** * @Author:dcy * @Description: @@ -29,15 +31,10 @@ public enum UserInfoStatusEnum { * @return */ public static UserInfoStatusEnum getByCode(String code) { - if (StrUtil.isBlank(code)) { - return null; - } - for (UserInfoStatusEnum enums : UserInfoStatusEnum.values()) { - if (enums.code.equals(code)) { - return enums; - } - } - return null; + return Stream.of(UserInfoStatusEnum.values()) + .filter(userInfoStatusEnum -> userInfoStatusEnum.code.equals(code)) + .findAny() + .orElse(null); } } diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/constant/UserInfoTypeEnum.java b/service-api/system-api/src/main/java/com/dcy/system/api/enums/UserInfoTypeEnum.java similarity index 67% rename from service-api/system-api/src/main/java/com/dcy/system/api/constant/UserInfoTypeEnum.java rename to service-api/system-api/src/main/java/com/dcy/system/api/enums/UserInfoTypeEnum.java index c835fd3..d8fd3f1 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/constant/UserInfoTypeEnum.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/enums/UserInfoTypeEnum.java @@ -1,7 +1,9 @@ -package com.dcy.system.api.constant; +package com.dcy.system.api.enums; import cn.hutool.core.util.StrUtil; +import java.util.stream.Stream; + /** * @Author:dcy * @Description: @@ -29,15 +31,10 @@ public enum UserInfoTypeEnum { * @return */ public static UserInfoTypeEnum getByCode(String code) { - if (StrUtil.isBlank(code)) { - return null; - } - for (UserInfoTypeEnum enums : UserInfoTypeEnum.values()) { - if (enums.code.equals(code)) { - return enums; - } - } - return null; + return Stream.of(UserInfoTypeEnum.values()) + .filter(userInfoTypeEnum -> userInfoTypeEnum.code.equals(code)) + .findAny() + .orElse(null); } } diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/Config.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/Config.java index 195cda6..fddcafe 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/Config.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/Config.java @@ -1,7 +1,7 @@ package com.dcy.system.api.model; import com.baomidou.mybatisplus.annotation.TableName; -import com.dcy.db.base.model.BaseModel; +import com.dcy.db.base.model.PageModel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -18,7 +18,7 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableName("sys_config") -public class Config extends BaseModel { +public class Config extends PageModel { /** * 参数id diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/Dept.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/Dept.java index 17a3276..81702e5 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/Dept.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/Dept.java @@ -3,7 +3,7 @@ package com.dcy.system.api.model; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.dcy.common.model.TreeModel; -import com.dcy.db.base.model.BaseModel; +import com.dcy.db.base.model.PageModel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -23,7 +23,7 @@ import java.util.List; @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableName("sys_dept") -public class Dept extends BaseModel implements TreeModel { +public class Dept extends PageModel implements TreeModel { private static final long serialVersionUID = 1L; diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/DictData.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/DictData.java index a9c8dff..504deff 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/DictData.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/DictData.java @@ -3,7 +3,7 @@ package com.dcy.system.api.model; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.dcy.common.model.TreeModel; -import com.dcy.db.base.model.BaseModel; +import com.dcy.db.base.model.PageModel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -22,7 +22,7 @@ import java.util.List; @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableName("sys_dict_data") -public class DictData extends BaseModel implements TreeModel { +public class DictData extends PageModel implements TreeModel { private static final long serialVersionUID = 1L; @@ -68,7 +68,8 @@ public class DictData extends BaseModel implements TreeModel { /** * 状态(0正常 1停用) - * @see com.dcy.system.api.constant.DictDataStatusEnum + * + * @see com.dcy.system.api.enums.DictDataStatusEnum */ private String dictStatus; diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/DictType.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/DictType.java index e9206a2..b933e90 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/DictType.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/DictType.java @@ -1,7 +1,7 @@ package com.dcy.system.api.model; import com.baomidou.mybatisplus.annotation.TableName; -import com.dcy.db.base.model.BaseModel; +import com.dcy.db.base.model.PageModel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -18,7 +18,7 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableName("sys_dict_type") -public class DictType extends BaseModel { +public class DictType extends PageModel { private static final long serialVersionUID = 1L; diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/Post.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/Post.java index 4b21f82..547bd5e 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/Post.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/Post.java @@ -1,7 +1,7 @@ package com.dcy.system.api.model; import com.baomidou.mybatisplus.annotation.TableName; -import com.dcy.db.base.model.BaseModel; +import com.dcy.db.base.model.PageModel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -20,7 +20,7 @@ import java.math.BigDecimal; @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableName("sys_post") -public class Post extends BaseModel { +public class Post extends PageModel { private static final long serialVersionUID = 1L; diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/Resources.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/Resources.java index e672d02..61f8654 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/Resources.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/Resources.java @@ -3,7 +3,7 @@ package com.dcy.system.api.model; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.dcy.common.model.TreeModel; -import com.dcy.db.base.model.BaseModel; +import com.dcy.db.base.model.PageModel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -23,7 +23,7 @@ import java.util.List; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sys_resources") -public class Resources extends BaseModel implements TreeModel { +public class Resources extends PageModel implements TreeModel { /** * 主键id @@ -63,14 +63,14 @@ public class Resources extends BaseModel implements TreeModel { /** * 状态(0、正常;1、禁用) * - * @see com.dcy.system.api.constant.ResourcesStatusEnum + * @see com.dcy.system.api.enums.ResourcesStatusEnum */ private String resStatus; /** * 类型(0、模块;1、链接) * - * @see com.dcy.system.api.constant.ResourcesTypeEnum + * @see com.dcy.system.api.enums.ResourcesTypeEnum */ private String resType; diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/Role.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/Role.java index f4486df..5bb20b9 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/Role.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/Role.java @@ -1,7 +1,8 @@ package com.dcy.system.api.model; import com.baomidou.mybatisplus.annotation.TableName; -import com.dcy.db.base.model.BaseModel; +import com.dcy.db.mybatis.model.DataScopeRoleModel; +import com.dcy.db.base.model.PageModel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -18,7 +19,7 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sys_role") -public class Role extends BaseModel { +public class Role extends PageModel implements DataScopeRoleModel { /** * 角色id @@ -43,7 +44,7 @@ public class Role extends BaseModel { /** * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) * - * @see com.dcy.common.constant.RoleDataScopeEnum + * @see com.dcy.db.base.enums.RoleDataScopeEnum */ private String dataScope; diff --git a/service-api/system-api/src/main/java/com/dcy/system/api/model/UserInfo.java b/service-api/system-api/src/main/java/com/dcy/system/api/model/UserInfo.java index 7580a5b..d0fef2e 100644 --- a/service-api/system-api/src/main/java/com/dcy/system/api/model/UserInfo.java +++ b/service-api/system-api/src/main/java/com/dcy/system/api/model/UserInfo.java @@ -1,5 +1,6 @@ package com.dcy.system.api.model; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.dcy.db.base.model.BaseModel; import lombok.Data; @@ -48,7 +49,7 @@ public class UserInfo extends BaseModel { /** * 用户类型(0、管理员;1、普通用户) * - * @see com.dcy.system.api.constant.UserInfoTypeEnum + * @see com.dcy.system.api.enums.UserInfoTypeEnum */ private String userType; @@ -75,10 +76,16 @@ public class UserInfo extends BaseModel { /** * 帐号状态(0、正常;1、禁用) * - * @see com.dcy.system.api.constant.UserInfoStatusEnum + * @see com.dcy.system.api.enums.UserInfoStatusEnum */ private String userStatus; + /** + * 部门名称 + */ + @TableField(exist = false) + private String deptName; + public static final String ID = "id"; public static final String USERNAME = "username"; -- Gitee From 847f3658d68a476a0b3bce51e181de46fe5c0a33 Mon Sep 17 00:00:00 2001 From: dongchunyu <1540770111@qq.com> Date: Fri, 10 Sep 2021 15:33:10 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix=EF=BC=9A=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=A4=84=E7=90=86=20fix=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=BC=93=E5=AD=98bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/biz/config/DataScopeConfig.java | 54 +++++++++++++++++-- .../dcy/system/biz/service/RoleService.java | 4 +- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java b/business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java index 80548fd..e686eb5 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/config/DataScopeConfig.java @@ -1,33 +1,79 @@ package com.dcy.system.biz.config; +import cn.hutool.core.lang.TypeReference; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.StrUtil; import com.dcy.common.constant.Constant; +import com.dcy.db.mybatis.model.DataColumnProperty; import com.dcy.db.mybatis.model.DataScopeProperty; +import com.dcy.db.mybatis.model.DataScopeRoleModel; import com.dcy.db.mybatis.service.AbstractDataScopeProvider; import com.dcy.db.mybatis.service.IDataScopeProvider; +import com.dcy.db.mybatis.service.IDataScopeService; import lombok.extern.slf4j.Slf4j; +import net.sf.jsqlparser.expression.Parenthesis; +import net.sf.jsqlparser.expression.StringValue; +import net.sf.jsqlparser.expression.operators.conditional.AndExpression; +import net.sf.jsqlparser.expression.operators.relational.ExpressionList; +import net.sf.jsqlparser.expression.operators.relational.InExpression; +import net.sf.jsqlparser.expression.operators.relational.ItemsList; +import net.sf.jsqlparser.schema.Column; import net.sf.jsqlparser.statement.select.PlainSelect; import org.apache.dubbo.rpc.RpcContext; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + /** * @Author:dcy - * @Description: + * @Description: 数据权限处理 * @Date: 2021/9/9 14:17 */ @Slf4j @Configuration public class DataScopeConfig { + @Autowired + private IDataScopeService iDataScopeService; + @Bean public IDataScopeProvider dataScopeProvider() { return new AbstractDataScopeProvider() { @Override public void setWhere(DataScopeProperty dataScope, PlainSelect plainSelect) { final String userId = RpcContext.getContext().getAttachment(Constant.USER_ID); - log.info(userId); - log.info(plainSelect.toString()); - log.info(dataScope.toString()); +// log.info(userId); +// log.info(plainSelect.toString()); +// log.info(dataScope.toString()); + if (StrUtil.equals(dataScope.getType(), "dev")) { + for (DataColumnProperty dataColumn : dataScope.getColumns()) { + if (StrUtil.equals(dataColumn.getName(), "dept_id")) { + final Map allDataScopeFlagAndData = iDataScopeService.getAllDataScopeFlagAndDataByUserId(userId); + final Boolean allDataScope = MapUtil.getBool(allDataScopeFlagAndData, IDataScopeService.ALL_DATA_SCOPE_FLAG); + if (!allDataScope) { + // 有数据范围 + List roleList = MapUtil.get(allDataScopeFlagAndData, IDataScopeService.ROLE_LIST, new TypeReference>() { + }); + Set dataScopeList = iDataScopeService.getDateScopeDeptIds(userId, roleList); + ItemsList itemsList = new ExpressionList(dataScopeList.stream().map(StringValue::new).collect(Collectors.toList())); + InExpression inExpression = new InExpression(new Column(dataColumn.getAliasName()), itemsList); + if (null == plainSelect.getWhere()) { + // 不存在 where 条件 + plainSelect.setWhere(new Parenthesis(inExpression)); + } else { + // 存在 where 条件 and 处理 + plainSelect.setWhere(new AndExpression(plainSelect.getWhere(), inExpression)); + } + } + } + } + } + } }; } diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java b/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java index 91cf7bb..bc0d0e6 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/service/RoleService.java @@ -191,9 +191,9 @@ public class RoleService extends BaseService implements IDataS final boolean anyMatch = roleList.stream().anyMatch(role -> RoleDataScopeEnum.ALL.code.equals(role.getDataScope())); final Map map = new HashMap<>(); // 角色列表 - map.put("roleList", roleList); + map.put(IDataScopeService.ROLE_LIST, roleList); // 是否有全部数据权限 - map.put("allDataScope", anyMatch); + map.put(IDataScopeService.ALL_DATA_SCOPE_FLAG, anyMatch); return map; } -- Gitee From ab9db2d9b4da568323161dfe9bf4cf2f2da73bfc Mon Sep 17 00:00:00 2001 From: dongchunyu <1540770111@qq.com> Date: Fri, 10 Sep 2021 15:52:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E5=AF=B9=E8=B1=A1=20fix=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=BF=94=E5=9B=9Ebool=20=E7=94=A8code=E5=8C=BA=E5=88=86=20fix?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E6=94=B9controller=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/biz/controller/FileController.java | 2 +- .../main/resources/simple/controller.java.ftl | 2 +- .../system/biz/component/DataScopeUtil.java | 62 ------------------- .../com/dcy/system/biz/config/WebConfig.java | 2 +- .../biz/controller/ConfigController.java | 2 +- .../biz/controller/DictDataController.java | 6 +- .../biz/controller/DictTypeController.java | 6 +- .../system/biz/controller/PostController.java | 2 +- .../biz/controller/ResourcesController.java | 6 +- .../system/biz/controller/RoleController.java | 12 ++-- .../system/biz/controller/UserController.java | 12 ++-- .../com/dcy/common}/model/PageResult.java | 21 +------ .../db/base/controller/BaseController.java | 18 ++++-- .../db/base/controller/RBaseController.java | 3 + .../service/AbstractDataScopeProvider.java | 2 +- .../mybatis/service/IDataScopeProvider.java | 4 +- .../db/mybatis/service/IDataScopeService.java | 2 +- .../biz/controller/AccountTblController.java | 2 +- .../biz/controller/OrderTblController.java | 2 +- .../biz/controller/StorageTblController.java | 2 +- 20 files changed, 49 insertions(+), 121 deletions(-) delete mode 100644 business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java rename inner-intergration/{db-spring-boot-starter/src/main/java/com/dcy/db/base => common-spring-boot-starter/src/main/java/com/dcy/common}/model/PageResult.java (54%) diff --git a/business-center/file-center/src/main/java/com/dcy/file/biz/controller/FileController.java b/business-center/file-center/src/main/java/com/dcy/file/biz/controller/FileController.java index 07be48a..9ced3e3 100644 --- a/business-center/file-center/src/main/java/com/dcy/file/biz/controller/FileController.java +++ b/business-center/file-center/src/main/java/com/dcy/file/biz/controller/FileController.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; import com.dcy.db.base.controller.BaseController; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.file.biz.dto.input.DownloadInputDTO; import com.dcy.file.biz.dto.input.FileInfoSearchInputDTO; import com.dcy.file.biz.dto.output.FileInfoListOutputDTO; diff --git a/business-center/generate-code/src/main/resources/simple/controller.java.ftl b/business-center/generate-code/src/main/resources/simple/controller.java.ftl index 5b39f8d..c2be3fc 100644 --- a/business-center/generate-code/src/main/resources/simple/controller.java.ftl +++ b/business-center/generate-code/src/main/resources/simple/controller.java.ftl @@ -3,7 +3,7 @@ package ${package.Controller}; import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import ${cfg.inputDtoPackage}.${entity}CreateInputDTO; import ${cfg.inputDtoPackage}.${entity}SearchInputDTO; import ${cfg.inputDtoPackage}.${entity}UpdateInputDTO; diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java b/business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java deleted file mode 100644 index b9db4c8..0000000 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/component/DataScopeUtil.java +++ /dev/null @@ -1,62 +0,0 @@ -//package com.dcy.system.biz.component; -// -//import cn.hutool.core.collection.CollUtil; -//import cn.hutool.core.lang.TypeReference; -//import cn.hutool.core.map.MapUtil; -//import cn.hutool.core.util.StrUtil; -//import com.baomidou.mybatisplus.core.conditions.AbstractWrapper; -//import com.dcy.common.constant.Constant; -//import com.dcy.system.api.model.Role; -//import com.dcy.system.biz.service.RoleService; -//import org.apache.dubbo.rpc.RpcContext; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//import java.util.List; -//import java.util.Map; -//import java.util.Set; -// -///** -// * @Author:dcy -// * @Description: -// * @Date: 2021/3/29 16:02 -// */ -//@Component -//public class DataScopeUtil { -// -// @Autowired -// private RoleService roleService; -// -// /** -// * 数据过滤 -// * -// * @param wrapper -// */ -// public void dataScopeFilter(AbstractWrapper wrapper) { -// dataScopeFilter(wrapper, null); -// } -// -// /** -// * 数据过滤 -// * -// * @param wrapper -// * @param deptAlias 主表别名 -// */ -// public void dataScopeFilter(AbstractWrapper wrapper, String deptAlias) { -// final String userId = RpcContext.getContext().getAttachment(Constant.USER_ID); -// final Map allDataScopeFlagAndData = roleService.getAllDataScopeFlagAndDataByUserId(userId); -// final Boolean allDataScope = MapUtil.getBool(allDataScopeFlagAndData, "allDataScope"); -// if (!allDataScope) { -// // 有数据范围 -// List roleList = MapUtil.get(allDataScopeFlagAndData, "roleList", new TypeReference>() { -// }); -// Set dataScopeList = roleService.getDateScopeDeptIds(userId, roleList); -// if (StrUtil.isNotBlank(deptAlias)) { -// wrapper.apply(StrUtil.format(" {}.dept_id in ({})", deptAlias, CollUtil.join(dataScopeList, ",", "\"", "\""))); -// } else { -// wrapper.apply(StrUtil.format(" dept_id in ({})", CollUtil.join(dataScopeList, ",", "\"", "\""))); -// } -// } -// } -// -//} diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/config/WebConfig.java b/business-center/system-center/src/main/java/com/dcy/system/biz/config/WebConfig.java index 7424d87..ff9a0c8 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/config/WebConfig.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/config/WebConfig.java @@ -4,7 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** - * @author Tango + * @Author:dcy * @since 2021/3/29 */ @Configuration diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ConfigController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ConfigController.java index 0273891..afe3768 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ConfigController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ConfigController.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; import com.dcy.db.base.controller.BaseController; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.system.api.model.Config; import com.dcy.system.biz.dto.input.ConfigCreateInputDTO; import com.dcy.system.biz.dto.input.ConfigSearchInputDTO; diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictDataController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictDataController.java index 6c12157..9b55895 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictDataController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictDataController.java @@ -5,7 +5,7 @@ import com.dcy.common.annotation.Log; import com.dcy.common.model.R; import com.dcy.common.utils.TreeUtil; import com.dcy.db.base.controller.BaseController; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.system.api.model.DictData; import com.dcy.system.biz.dto.input.DictDataCreateInputDTO; import com.dcy.system.biz.dto.input.DictDataSearchInputDTO; @@ -64,7 +64,7 @@ public class DictDataController extends BaseController save(@Validated @ApiParam @RequestBody DictDataCreateInputDTO dictDataCreateInputDTO) { DictData dictData = mDictDataMapper.dictDataCreateInputDTOToDictData(dictDataCreateInputDTO); - return R.success(baseService.save(dictData)); + return super.save(dictData); } @Log @@ -72,7 +72,7 @@ public class DictDataController extends BaseController update(@Validated @ApiParam @RequestBody DictDataUpdateInputDTO dictDataUpdateInputDTO) { DictData dictData = mDictDataMapper.dictDataUpdateInputDTOToDictData(dictDataUpdateInputDTO); - return R.success(baseService.updateById(dictData)); + return super.update(dictData); } @Log diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java index dd23ef1..5ac6ace 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; import com.dcy.db.base.controller.BaseController; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.system.api.model.DictType; import com.dcy.system.biz.dto.input.DictTypeCreateInputDTO; import com.dcy.system.biz.dto.input.DictTypeSearchInputDTO; @@ -61,7 +61,7 @@ public class DictTypeController extends BaseController save(@Validated @ApiParam @RequestBody DictTypeCreateInputDTO dictTypeCreateInputDTO) { DictType dictType = mDictTypeMapper.dictTypeCreateInputDTOToDictType(dictTypeCreateInputDTO); - return R.success(baseService.save(dictType)); + return depends(baseService.save(dictType)); } @Log @@ -69,7 +69,7 @@ public class DictTypeController extends BaseController update(@Validated @ApiParam @RequestBody DictTypeUpdateInputDTO dictTypeUpdateInputDTO) { DictType dictType = mDictTypeMapper.dictTypeUpdateInputDTOToDictType(dictTypeUpdateInputDTO); - return R.success(baseService.updateById(dictType)); + return depends(baseService.updateById(dictType)); } @Log diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/PostController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/PostController.java index 0cd0bc0..1213a87 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/PostController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/PostController.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; import com.dcy.db.base.controller.BaseController; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.system.api.model.Post; import com.dcy.system.biz.dto.input.PostCreateInputDTO; import com.dcy.system.biz.dto.input.PostSearchInputDTO; diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java index 4d66c40..bf2ac93 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java @@ -58,7 +58,7 @@ public class ResourcesController extends BaseController save(@Validated @ApiParam @RequestBody ResourcesCreateInputDTO resourcesCreateInputDTO) { Resources resources = mResourcesMapper.resourcesCreateInputDTOToResources(resourcesCreateInputDTO); - return success(baseService.saveOrUpdate(resources)); + return depends(baseService.saveOrUpdate(resources)); } @Log @@ -66,7 +66,7 @@ public class ResourcesController extends BaseController update(@Validated @ApiParam @RequestBody ResourcesUpdateInputDTO updateResourcesInputDTO) { Resources resources = mResourcesMapper.resourcesUpdateInputDTOToResources(updateResourcesInputDTO); - return success(baseService.saveOrUpdate(resources)); + return depends(baseService.saveOrUpdate(resources)); } @Log @@ -74,6 +74,6 @@ public class ResourcesController extends BaseController delete(@NotBlank(message = "资源id不能为空") @RequestParam String id) { - return success(baseService.removeById(id)); + return depends(baseService.removeById(id)); } } diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java index 4df3b18..5c25325 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java @@ -5,7 +5,7 @@ import com.dcy.auth.api.AAuthService; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; import com.dcy.db.base.controller.BaseController; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.system.api.model.Resources; import com.dcy.system.api.model.Role; import com.dcy.system.biz.dto.input.RoleCreateInputDTO; @@ -74,7 +74,7 @@ public class RoleController extends BaseController { @PostMapping(value = "/save") public R save(@Validated @ApiParam @RequestBody RoleCreateInputDTO roleCreateInputDTO) { Role role = mRoleMapper.roleCreateInputDTOToRole(roleCreateInputDTO); - return success(baseService.saveRole(role, roleCreateInputDTO.getDeptIds())); + return depends(baseService.saveRole(role, roleCreateInputDTO.getDeptIds())); } @Log @@ -82,7 +82,7 @@ public class RoleController extends BaseController { @PostMapping(value = "/update") public R update(@Validated @ApiParam @RequestBody RoleUpdateInputDTO roleUpdateInputDTO) { Role role = mRoleMapper.roleUpdateInputDTOToRole(roleUpdateInputDTO); - return success(baseService.saveRole(role, roleUpdateInputDTO.getDeptIds())); + return depends(baseService.saveRole(role, roleUpdateInputDTO.getDeptIds())); } @Log @@ -90,14 +90,14 @@ public class RoleController extends BaseController { @ApiImplicitParam(name = "id", value = "角色id", dataType = "String", paramType = "query", required = true) @PostMapping(value = "/delete") public R delete(@NotBlank(message = "角色id不能为空") @RequestParam String id) { - return success(baseService.deleteRole(id)); + return depends(baseService.deleteRole(id)); } @Log @ApiOperation(value = "根据list删除") @PostMapping(value = "/deleteBatch") public R deleteBatch(@NotEmpty(message = "集合不能为空") @ApiParam @RequestBody List idList) { - return success(baseService.deleteBatchRole(idList)); + return depends(baseService.deleteBatchRole(idList)); } @Log @@ -117,7 +117,7 @@ public class RoleController extends BaseController { // 只能刷新当前登录人的权限,不能修改角色下所有用户的权限 aAuthService.refreshUserInfoByUserId(roleResourceInputDto.getUserId()); } - return success(bool); + return depends(bool); } @Log diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java index 5cda71f..61d83f3 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java @@ -10,7 +10,7 @@ import com.dcy.common.model.ReturnCode; import com.dcy.common.utils.BPwdEncoderUtil; import com.dcy.common.utils.EasyExcelUtil; import com.dcy.db.base.controller.BaseController; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.system.api.model.Role; import com.dcy.system.api.model.UserInfo; import com.dcy.system.biz.dto.input.*; @@ -82,7 +82,7 @@ public class UserController extends BaseController { public R save(@Validated @ApiParam @RequestBody UserInfoCreateInputDTO userInfoCreateInputDTO) { UserInfo userInfo = mUserInfoMapper.userInfoCreateInputDTOToUserInfo(userInfoCreateInputDTO); userInfo.setPassword("{bcrypt}" + PASSWORD_ENCODER.encode(userInfoCreateInputDTO.getPassword())); - return R.success(baseService.saveUser(userInfo, userInfoCreateInputDTO.getPostIds())); + return depends(baseService.saveUser(userInfo, userInfoCreateInputDTO.getPostIds())); } @Log @@ -91,7 +91,7 @@ public class UserController extends BaseController { @PostMapping(value = "/update") public R update(@Validated @ApiParam @RequestBody UserInfoUpdateInputDTO userInfoUpdateInputDTO) { UserInfo userInfo = mUserInfoMapper.userInfoUpdateInputDTOToUserInfo(userInfoUpdateInputDTO); - return R.success(baseService.saveUser(userInfo, userInfoUpdateInputDTO.getPostIds())); + return depends(baseService.saveUser(userInfo, userInfoUpdateInputDTO.getPostIds())); } @Log @@ -152,7 +152,7 @@ public class UserController extends BaseController { if (bool) { aAuthService.refreshUserInfoByUserId(userInfoRoleOutputDto.getUserId()); } - return success(bool); + return depends(bool); } @Log @@ -170,7 +170,7 @@ public class UserController extends BaseController { @PostMapping(value = "/updateInfo") public R updateInfo(@Validated @ApiParam @RequestBody UserInfoUpdateInfoInputDTO userInfoUpdateInfoInputDTO) { UserInfo userInfo = mUserInfoMapper.userInfoUpdateInfoInputDTOToUserInfo(userInfoUpdateInfoInputDTO); - return R.success(baseService.updateById(userInfo)); + return super.update(userInfo); } @Log @@ -188,7 +188,7 @@ public class UserController extends BaseController { UserInfo updatePassUser = new UserInfo(); updatePassUser.setId(userUpdatePassInputDTO.getUserId()); updatePassUser.setPassword("{bcrypt}" + PASSWORD_ENCODER.encode(userUpdatePassInputDTO.getNewPass())); - return R.success(baseService.updateById(updatePassUser)); + return super.update(updatePassUser); } @ApiOperation(value = "导出excel测试") diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/model/PageResult.java b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/PageResult.java similarity index 54% rename from inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/model/PageResult.java rename to inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/PageResult.java index 77af496..c673463 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/model/PageResult.java +++ b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/PageResult.java @@ -1,6 +1,5 @@ -package com.dcy.db.base.model; +package com.dcy.common.model; -import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; @@ -33,22 +32,4 @@ public class PageResult { @ApiModelProperty(value = "分页记录列表") private List records; - /** - * 根据IPage 转换 PageResult - * @param iPage - * @param list - * @param - * @param - * @return - */ - public static PageResult toPageDTO(IPage iPage, List list){ - PageResult pageResult = new PageResult<>(); - pageResult.setCurrent(iPage.getCurrent()); - pageResult.setPages(iPage.getPages()); - pageResult.setSize(iPage.getSize()); - pageResult.setTotal(iPage.getTotal()); - pageResult.setRecords(list); - return pageResult; - } - } diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java index fae4d35..e6e1f97 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java @@ -2,7 +2,7 @@ package com.dcy.db.base.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.model.R; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.db.base.service.BaseService; import org.springframework.beans.factory.annotation.Autowired; @@ -28,7 +28,13 @@ public abstract class BaseController extend * @return */ protected PageResult toPageDTO(IPage iPage, List list) { - return PageResult.toPageDTO(iPage, list); + PageResult pageResult = new PageResult<>(); + pageResult.setCurrent(iPage.getCurrent()); + pageResult.setPages(iPage.getPages()); + pageResult.setSize(iPage.getSize()); + pageResult.setTotal(iPage.getTotal()); + pageResult.setRecords(list); + return pageResult; } /** @@ -58,7 +64,7 @@ public abstract class BaseController extend * @return */ public R save(Entity entity) { - return success(baseService.save(entity)); + return depends(baseService.save(entity)); } /** @@ -68,7 +74,7 @@ public abstract class BaseController extend * @return */ public R update(Entity entity) { - return success(baseService.updateById(entity)); + return depends(baseService.updateById(entity)); } /** @@ -78,7 +84,7 @@ public abstract class BaseController extend * @return */ public R delete(Serializable id) { - return success(baseService.removeById(id)); + return depends(baseService.removeById(id)); } /** @@ -88,6 +94,6 @@ public abstract class BaseController extend * @return */ public R deleteBatch(Collection idList) { - return success(baseService.removeByIds(idList)); + return depends(baseService.removeByIds(idList)); } } diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java index 11ca92f..cd6462b 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java @@ -36,6 +36,9 @@ public class RBaseController { return R.error(returnCode); } + protected R depends(boolean success) { + return success ? success() : error(); + } /** * 获取用户id */ diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java index 7c57a16..c8bd5f0 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/AbstractDataScopeProvider.java @@ -2,7 +2,7 @@ package com.dcy.db.mybatis.service; /** * @Author:dcy - * @Description: + * @Description: 默认数据权限处理 * @Date: 2021/9/9 14:14 */ public abstract class AbstractDataScopeProvider implements IDataScopeProvider { diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java index 76cbaee..eaa220d 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeProvider.java @@ -13,8 +13,8 @@ public interface IDataScopeProvider { /** * 设置条件 * - * @param dataScope - * @param plainSelect + * @param dataScope 数据权限注解包装对象 + * @param plainSelect sql解析对象 */ void setWhere(DataScopeProperty dataScope, PlainSelect plainSelect); diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java index 2b4effd..bb809b2 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/mybatis/service/IDataScopeService.java @@ -8,7 +8,7 @@ import java.util.Set; /** * @Author:dcy - * @Description: + * @Description: 获取角色权限公共接口 * @Date: 2021/9/3 14:24 */ public interface IDataScopeService { diff --git a/seata-demo/seata-business/seata-account-center/src/main/java/com/dcy/seataaccount/biz/controller/AccountTblController.java b/seata-demo/seata-business/seata-account-center/src/main/java/com/dcy/seataaccount/biz/controller/AccountTblController.java index ac175e7..0e81398 100644 --- a/seata-demo/seata-business/seata-account-center/src/main/java/com/dcy/seataaccount/biz/controller/AccountTblController.java +++ b/seata-demo/seata-business/seata-account-center/src/main/java/com/dcy/seataaccount/biz/controller/AccountTblController.java @@ -3,7 +3,7 @@ package com.dcy.seataaccount.biz.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.seataaccount.biz.dto.input.AccountTblCreateInputDTO; import com.dcy.seataaccount.biz.dto.input.AccountTblSearchInputDTO; import com.dcy.seataaccount.biz.dto.input.AccountTblUpdateInputDTO; diff --git a/seata-demo/seata-business/seata-order-center/src/main/java/com/dcy/seataorder/biz/controller/OrderTblController.java b/seata-demo/seata-business/seata-order-center/src/main/java/com/dcy/seataorder/biz/controller/OrderTblController.java index 65549b2..e43ef22 100644 --- a/seata-demo/seata-business/seata-order-center/src/main/java/com/dcy/seataorder/biz/controller/OrderTblController.java +++ b/seata-demo/seata-business/seata-order-center/src/main/java/com/dcy/seataorder/biz/controller/OrderTblController.java @@ -3,7 +3,7 @@ package com.dcy.seataorder.biz.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.seataorder.biz.dto.input.OrderTblCreateInputDTO; import com.dcy.seataorder.biz.dto.input.OrderTblSearchInputDTO; import com.dcy.seataorder.biz.dto.input.OrderTblUpdateInputDTO; diff --git a/seata-demo/seata-business/seata-storage-center/src/main/java/com/dcy/seatastorage/biz/controller/StorageTblController.java b/seata-demo/seata-business/seata-storage-center/src/main/java/com/dcy/seatastorage/biz/controller/StorageTblController.java index 6f7e46b..502ccf2 100644 --- a/seata-demo/seata-business/seata-storage-center/src/main/java/com/dcy/seatastorage/biz/controller/StorageTblController.java +++ b/seata-demo/seata-business/seata-storage-center/src/main/java/com/dcy/seatastorage/biz/controller/StorageTblController.java @@ -3,7 +3,7 @@ package com.dcy.seatastorage.biz.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.common.annotation.Log; import com.dcy.common.model.R; -import com.dcy.db.base.model.PageResult; +import com.dcy.common.model.PageResult; import com.dcy.seatastorage.biz.dto.input.StorageTblCreateInputDTO; import com.dcy.seatastorage.biz.dto.input.StorageTblSearchInputDTO; import com.dcy.seatastorage.biz.dto.input.StorageTblUpdateInputDTO; -- Gitee From b262f32a65cfedb94c3fb8ab269df5d2b9bc743b Mon Sep 17 00:00:00 2001 From: dongchunyu <1540770111@qq.com> Date: Tue, 14 Sep 2021 13:51:04 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business-center/auth-center/pom.xml | 6 +- .../auth/biz/controller/LoginController.java | 18 +++--- .../dcy/auth/biz/enums/AuthApiErrorCode.java | 20 +++++++ .../dcy/auth/biz/util}/BPwdEncoderUtil.java | 6 +- .../com/dcy/log/biz/service/LogService.java | 2 +- business-center/system-center/pom.xml | 11 ++++ .../biz/controller/DictTypeController.java | 4 +- .../biz/controller/ResourcesController.java | 6 +- .../system/biz/controller/RoleController.java | 10 ++-- .../system/biz/controller/UserController.java | 17 +++--- .../system/biz/enums/SystemApiErrorCode.java | 20 +++++++ .../dcy/system/biz/util/BPwdEncoderUtil.java | 24 ++++++++ .../dcy/system/biz/util}/EasyExcelUtil.java | 2 +- .../gateway/enums/GatewayApiErrorCode.java | 25 ++++++++ ...nSentinelGatewayBlockExceptionHandler.java | 4 +- .../common-spring-boot-starter/pom.xml | 11 ---- .../java/com/dcy/common/annotation/Log.java | 2 + .../java/com/dcy/common/api/IErrorCode.java | 24 ++++++++ .../com/dcy/common/enums/ApiErrorCode.java | 58 +++++++++++++++++++ .../common/{annotation => enums}/LogEnum.java | 2 +- .../com/dcy/common/model/OperationalLog.java | 2 +- .../src/main/java/com/dcy/common/model/R.java | 51 ++++++++-------- .../db/base/controller/BaseController.java | 8 +-- .../db/base/controller/RBaseController.java | 25 +++----- .../dcy/db/handler/CheckExceptionHandler.java | 14 ++--- .../db/handler/GlobalExceptionHandler.java | 10 +--- 26 files changed, 272 insertions(+), 110 deletions(-) create mode 100644 business-center/auth-center/src/main/java/com/dcy/auth/biz/enums/AuthApiErrorCode.java rename {inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils => business-center/auth-center/src/main/java/com/dcy/auth/biz/util}/BPwdEncoderUtil.java (68%) create mode 100644 business-center/system-center/src/main/java/com/dcy/system/biz/enums/SystemApiErrorCode.java create mode 100644 business-center/system-center/src/main/java/com/dcy/system/biz/util/BPwdEncoderUtil.java rename {inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils => business-center/system-center/src/main/java/com/dcy/system/biz/util}/EasyExcelUtil.java (99%) create mode 100644 gateway-center/src/main/java/com/dcy/gateway/enums/GatewayApiErrorCode.java create mode 100644 inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/api/IErrorCode.java create mode 100644 inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/enums/ApiErrorCode.java rename inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/{annotation => enums}/LogEnum.java (84%) diff --git a/business-center/auth-center/pom.xml b/business-center/auth-center/pom.xml index e04ce6d..9d9993a 100644 --- a/business-center/auth-center/pom.xml +++ b/business-center/auth-center/pom.xml @@ -89,7 +89,11 @@ log-spring-boot-starter 1.0-SNAPSHOT - + + + org.springframework.security + spring-security-core + diff --git a/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java b/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java index 5445085..8fc3c3d 100644 --- a/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java +++ b/business-center/auth-center/src/main/java/com/dcy/auth/biz/controller/LoginController.java @@ -7,14 +7,14 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.dcy.auth.biz.dto.input.LoginInputDTO; import com.dcy.auth.biz.dtomapper.MUserInfoMapper; +import com.dcy.auth.biz.enums.AuthApiErrorCode; import com.dcy.auth.biz.service.AuthService; +import com.dcy.auth.biz.util.BPwdEncoderUtil; import com.dcy.common.annotation.Log; -import com.dcy.common.annotation.LogEnum; import com.dcy.common.constant.Constant; +import com.dcy.common.enums.LogEnum; import com.dcy.common.model.LoginAccount; import com.dcy.common.model.R; -import com.dcy.common.model.ReturnCode; -import com.dcy.common.utils.BPwdEncoderUtil; import com.dcy.db.base.controller.RBaseController; import com.dcy.system.api.api.ADeptService; import com.dcy.system.api.api.AUserService; @@ -74,13 +74,13 @@ public class LoginController extends RBaseController { // ----------------可以不调用------------------------ UserInfo userInfo = aUserService.getUserInfoByUsername(loginInputDTO.getUsername()); if (userInfo == null) { - return R.error(ReturnCode.USER_PASSWORD_ERROR); + return R.error(AuthApiErrorCode.USER_PASSWORD_ERROR); } if (UserInfoStatusEnum.DISABLE.code.equals(userInfo.getUserStatus())) { - return R.error(ReturnCode.USER_LOCKED_ERROR); + return R.error(AuthApiErrorCode.USER_LOCKED_ERROR); } if (!BPwdEncoderUtil.matches(loginInputDTO.getPassword(), userInfo.getPassword().replace("{bcrypt}", ""))) { - return R.error(ReturnCode.USER_PASSWORD_ERROR); + return R.error(AuthApiErrorCode.USER_PASSWORD_ERROR); } LoginAccount loginOutputDTO = mUserInfoMapper.toLoginAccount(userInfo); // 设置权限 @@ -100,7 +100,7 @@ public class LoginController extends RBaseController { SaSession session = StpUtil.getSession(); // 设置用户信息 session.set(Constant.SESSION_USER_KEY, loginOutputDTO); - return R.success(tokenInfo.getTokenValue()); + return success(tokenInfo.getTokenValue()); } @Log(type = LogEnum.BUSINESS) @@ -110,7 +110,7 @@ public class LoginController extends RBaseController { public R getUserInfo() { SaSession session = StpUtil.getSession(); LoginAccount loginOutputDTO = session.getModel(Constant.SESSION_USER_KEY, LoginAccount.class); - return R.success(loginOutputDTO); + return success(loginOutputDTO); } @Log(type = LogEnum.LOGOUT) @@ -119,6 +119,6 @@ public class LoginController extends RBaseController { @ApiOperationSupport(order = 10, author = "dcy") public R logout() { StpUtil.logout(); - return R.success("退出成功"); + return success("退出成功"); } } diff --git a/business-center/auth-center/src/main/java/com/dcy/auth/biz/enums/AuthApiErrorCode.java b/business-center/auth-center/src/main/java/com/dcy/auth/biz/enums/AuthApiErrorCode.java new file mode 100644 index 0000000..3bc5541 --- /dev/null +++ b/business-center/auth-center/src/main/java/com/dcy/auth/biz/enums/AuthApiErrorCode.java @@ -0,0 +1,20 @@ +package com.dcy.auth.biz.enums; + +import com.dcy.common.api.IErrorCode; +import lombok.Getter; + +@Getter +public enum AuthApiErrorCode implements IErrorCode { + // token错误 + USER_PASSWORD_ERROR(1300101, "用户名和密码错误,请重新输入"), + USER_LOCKED_ERROR(1300102, "用户已锁定"), + ; + + private final Integer code; + private final String msg; + + AuthApiErrorCode(Integer code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils/BPwdEncoderUtil.java b/business-center/auth-center/src/main/java/com/dcy/auth/biz/util/BPwdEncoderUtil.java similarity index 68% rename from inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils/BPwdEncoderUtil.java rename to business-center/auth-center/src/main/java/com/dcy/auth/biz/util/BPwdEncoderUtil.java index 9d69b7c..e13394f 100644 --- a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils/BPwdEncoderUtil.java +++ b/business-center/auth-center/src/main/java/com/dcy/auth/biz/util/BPwdEncoderUtil.java @@ -1,4 +1,4 @@ -package com.dcy.common.utils; +package com.dcy.auth.biz.util; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @@ -9,7 +9,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; */ public final class BPwdEncoderUtil { - private static final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + private static final BCryptPasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder(); /** * 匹配密码 @@ -19,6 +19,6 @@ public final class BPwdEncoderUtil { * @return */ public static boolean matches(CharSequence rawPassword, String encodedPassword) { - return passwordEncoder.matches(rawPassword, encodedPassword); + return PASSWORD_ENCODER.matches(rawPassword, encodedPassword); } } diff --git a/business-center/log-center/src/main/java/com/dcy/log/biz/service/LogService.java b/business-center/log-center/src/main/java/com/dcy/log/biz/service/LogService.java index 7583fef..7b9acc2 100644 --- a/business-center/log-center/src/main/java/com/dcy/log/biz/service/LogService.java +++ b/business-center/log-center/src/main/java/com/dcy/log/biz/service/LogService.java @@ -2,7 +2,7 @@ package com.dcy.log.biz.service; import cn.hutool.core.util.PageUtil; import cn.hutool.core.util.StrUtil; -import com.dcy.common.annotation.LogEnum; +import com.dcy.common.enums.LogEnum; import com.dcy.es.dto.PageResultOutputDTO; import com.dcy.es.service.BaseElasticService; import com.dcy.log.biz.dto.input.SearchInputDTO; diff --git a/business-center/system-center/pom.xml b/business-center/system-center/pom.xml index 66233c0..5bcc99b 100644 --- a/business-center/system-center/pom.xml +++ b/business-center/system-center/pom.xml @@ -95,6 +95,17 @@ ${mapstruct.version} + + + cn.afterturn + easypoi-spring-boot-starter + + + + org.springframework.security + spring-security-core + + diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java index 5ac6ace..fcbf9b1 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/DictTypeController.java @@ -61,7 +61,7 @@ public class DictTypeController extends BaseController save(@Validated @ApiParam @RequestBody DictTypeCreateInputDTO dictTypeCreateInputDTO) { DictType dictType = mDictTypeMapper.dictTypeCreateInputDTOToDictType(dictTypeCreateInputDTO); - return depends(baseService.save(dictType)); + return success(baseService.save(dictType)); } @Log @@ -69,7 +69,7 @@ public class DictTypeController extends BaseController update(@Validated @ApiParam @RequestBody DictTypeUpdateInputDTO dictTypeUpdateInputDTO) { DictType dictType = mDictTypeMapper.dictTypeUpdateInputDTOToDictType(dictTypeUpdateInputDTO); - return depends(baseService.updateById(dictType)); + return success(baseService.updateById(dictType)); } @Log diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java index bf2ac93..4d66c40 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/ResourcesController.java @@ -58,7 +58,7 @@ public class ResourcesController extends BaseController save(@Validated @ApiParam @RequestBody ResourcesCreateInputDTO resourcesCreateInputDTO) { Resources resources = mResourcesMapper.resourcesCreateInputDTOToResources(resourcesCreateInputDTO); - return depends(baseService.saveOrUpdate(resources)); + return success(baseService.saveOrUpdate(resources)); } @Log @@ -66,7 +66,7 @@ public class ResourcesController extends BaseController update(@Validated @ApiParam @RequestBody ResourcesUpdateInputDTO updateResourcesInputDTO) { Resources resources = mResourcesMapper.resourcesUpdateInputDTOToResources(updateResourcesInputDTO); - return depends(baseService.saveOrUpdate(resources)); + return success(baseService.saveOrUpdate(resources)); } @Log @@ -74,6 +74,6 @@ public class ResourcesController extends BaseController delete(@NotBlank(message = "资源id不能为空") @RequestParam String id) { - return depends(baseService.removeById(id)); + return success(baseService.removeById(id)); } } diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java index 5c25325..e27d0a5 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/RoleController.java @@ -74,7 +74,7 @@ public class RoleController extends BaseController { @PostMapping(value = "/save") public R save(@Validated @ApiParam @RequestBody RoleCreateInputDTO roleCreateInputDTO) { Role role = mRoleMapper.roleCreateInputDTOToRole(roleCreateInputDTO); - return depends(baseService.saveRole(role, roleCreateInputDTO.getDeptIds())); + return success(baseService.saveRole(role, roleCreateInputDTO.getDeptIds())); } @Log @@ -82,7 +82,7 @@ public class RoleController extends BaseController { @PostMapping(value = "/update") public R update(@Validated @ApiParam @RequestBody RoleUpdateInputDTO roleUpdateInputDTO) { Role role = mRoleMapper.roleUpdateInputDTOToRole(roleUpdateInputDTO); - return depends(baseService.saveRole(role, roleUpdateInputDTO.getDeptIds())); + return success(baseService.saveRole(role, roleUpdateInputDTO.getDeptIds())); } @Log @@ -90,14 +90,14 @@ public class RoleController extends BaseController { @ApiImplicitParam(name = "id", value = "角色id", dataType = "String", paramType = "query", required = true) @PostMapping(value = "/delete") public R delete(@NotBlank(message = "角色id不能为空") @RequestParam String id) { - return depends(baseService.deleteRole(id)); + return success(baseService.deleteRole(id)); } @Log @ApiOperation(value = "根据list删除") @PostMapping(value = "/deleteBatch") public R deleteBatch(@NotEmpty(message = "集合不能为空") @ApiParam @RequestBody List idList) { - return depends(baseService.deleteBatchRole(idList)); + return success(baseService.deleteBatchRole(idList)); } @Log @@ -117,7 +117,7 @@ public class RoleController extends BaseController { // 只能刷新当前登录人的权限,不能修改角色下所有用户的权限 aAuthService.refreshUserInfoByUserId(roleResourceInputDto.getUserId()); } - return depends(bool); + return success(bool); } @Log diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java index 61d83f3..008aa09 100644 --- a/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/controller/UserController.java @@ -5,10 +5,8 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import com.baomidou.mybatisplus.core.metadata.IPage; import com.dcy.auth.api.AAuthService; import com.dcy.common.annotation.Log; +import com.dcy.common.enums.ApiErrorCode; import com.dcy.common.model.R; -import com.dcy.common.model.ReturnCode; -import com.dcy.common.utils.BPwdEncoderUtil; -import com.dcy.common.utils.EasyExcelUtil; import com.dcy.db.base.controller.BaseController; import com.dcy.common.model.PageResult; import com.dcy.system.api.model.Role; @@ -20,7 +18,10 @@ import com.dcy.system.biz.dto.output.UserInfoListOutputDTO; import com.dcy.system.biz.dto.output.UserInfoRoleOutputDTO; import com.dcy.system.biz.dtomapper.MRoleMapper; import com.dcy.system.biz.dtomapper.MUserInfoMapper; +import com.dcy.system.biz.enums.SystemApiErrorCode; import com.dcy.system.biz.service.UserInfoService; +import com.dcy.system.biz.util.BPwdEncoderUtil; +import com.dcy.system.biz.util.EasyExcelUtil; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.swagger.annotations.Api; @@ -82,7 +83,7 @@ public class UserController extends BaseController { public R save(@Validated @ApiParam @RequestBody UserInfoCreateInputDTO userInfoCreateInputDTO) { UserInfo userInfo = mUserInfoMapper.userInfoCreateInputDTOToUserInfo(userInfoCreateInputDTO); userInfo.setPassword("{bcrypt}" + PASSWORD_ENCODER.encode(userInfoCreateInputDTO.getPassword())); - return depends(baseService.saveUser(userInfo, userInfoCreateInputDTO.getPostIds())); + return success(baseService.saveUser(userInfo, userInfoCreateInputDTO.getPostIds())); } @Log @@ -91,7 +92,7 @@ public class UserController extends BaseController { @PostMapping(value = "/update") public R update(@Validated @ApiParam @RequestBody UserInfoUpdateInputDTO userInfoUpdateInputDTO) { UserInfo userInfo = mUserInfoMapper.userInfoUpdateInputDTOToUserInfo(userInfoUpdateInputDTO); - return depends(baseService.saveUser(userInfo, userInfoUpdateInputDTO.getPostIds())); + return success(baseService.saveUser(userInfo, userInfoUpdateInputDTO.getPostIds())); } @Log @@ -152,7 +153,7 @@ public class UserController extends BaseController { if (bool) { aAuthService.refreshUserInfoByUserId(userInfoRoleOutputDto.getUserId()); } - return depends(bool); + return success(bool); } @Log @@ -180,10 +181,10 @@ public class UserController extends BaseController { public R updatePass(@Validated @ApiParam @RequestBody UserUpdatePassInputDTO userUpdatePassInputDTO) { UserInfo userInfo = baseService.getById(userUpdatePassInputDTO.getUserId()); if (!BPwdEncoderUtil.matches(userUpdatePassInputDTO.getCurrentPass(), userInfo.getPassword().replace("{bcrypt}", ""))) { - return R.error(ReturnCode.USER_UPDATE_PASS_ERROR); + return R.error(SystemApiErrorCode.USER_UPDATE_PASS_ERROR); } if (!userUpdatePassInputDTO.getNewPass().equalsIgnoreCase(userUpdatePassInputDTO.getConfPass())) { - return R.error(ReturnCode.USER_UPDATE_PASS2_ERROR); + return R.error(SystemApiErrorCode.USER_UPDATE_PASS2_ERROR); } UserInfo updatePassUser = new UserInfo(); updatePassUser.setId(userUpdatePassInputDTO.getUserId()); diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/enums/SystemApiErrorCode.java b/business-center/system-center/src/main/java/com/dcy/system/biz/enums/SystemApiErrorCode.java new file mode 100644 index 0000000..ed35583 --- /dev/null +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/enums/SystemApiErrorCode.java @@ -0,0 +1,20 @@ +package com.dcy.system.biz.enums; + +import com.dcy.common.api.IErrorCode; +import lombok.Getter; + +@Getter +public enum SystemApiErrorCode implements IErrorCode { + // token错误 + USER_UPDATE_PASS_ERROR(1300001, "当前密码输入错误,请重新输入"), + USER_UPDATE_PASS2_ERROR(1300002, "两次密码输入不一致,请重新输入"), + ; + + private final Integer code; + private final String msg; + + SystemApiErrorCode(Integer code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/business-center/system-center/src/main/java/com/dcy/system/biz/util/BPwdEncoderUtil.java b/business-center/system-center/src/main/java/com/dcy/system/biz/util/BPwdEncoderUtil.java new file mode 100644 index 0000000..be069f5 --- /dev/null +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/util/BPwdEncoderUtil.java @@ -0,0 +1,24 @@ +package com.dcy.system.biz.util; + +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; + +/** + * @Auther: dcy + * @Date: 2019/3/22 10:21 + * @Description: 密码加密 + */ +public final class BPwdEncoderUtil { + + private static final BCryptPasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder(); + + /** + * 匹配密码 + * + * @param rawPassword 未加密密码 + * @param encodedPassword 加密密码 + * @return + */ + public static boolean matches(CharSequence rawPassword, String encodedPassword) { + return PASSWORD_ENCODER.matches(rawPassword, encodedPassword); + } +} diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils/EasyExcelUtil.java b/business-center/system-center/src/main/java/com/dcy/system/biz/util/EasyExcelUtil.java similarity index 99% rename from inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils/EasyExcelUtil.java rename to business-center/system-center/src/main/java/com/dcy/system/biz/util/EasyExcelUtil.java index dcabfba..d6a0f9d 100644 --- a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/utils/EasyExcelUtil.java +++ b/business-center/system-center/src/main/java/com/dcy/system/biz/util/EasyExcelUtil.java @@ -1,4 +1,4 @@ -package com.dcy.common.utils; +package com.dcy.system.biz.util; import cn.afterturn.easypoi.entity.vo.BigExcelConstants; import cn.afterturn.easypoi.entity.vo.MapExcelConstants; diff --git a/gateway-center/src/main/java/com/dcy/gateway/enums/GatewayApiErrorCode.java b/gateway-center/src/main/java/com/dcy/gateway/enums/GatewayApiErrorCode.java new file mode 100644 index 0000000..3c42ded --- /dev/null +++ b/gateway-center/src/main/java/com/dcy/gateway/enums/GatewayApiErrorCode.java @@ -0,0 +1,25 @@ +package com.dcy.gateway.enums; + +import com.dcy.common.api.IErrorCode; +import lombok.Getter; + +/** + * @Author:dcy + * @Description: + * @Date: 2021/9/14 13:20 + */ +@Getter +public enum GatewayApiErrorCode implements IErrorCode { + + SENTINEL_BLOCKED_ERROR(3003, "sentinel限流了"), + ; + + private final Integer code; + private final String msg; + + GatewayApiErrorCode(final Integer code, final String msg) { + this.code = code; + this.msg = msg; + } + +} diff --git a/gateway-center/src/main/java/com/dcy/gateway/sentinel/JsonSentinelGatewayBlockExceptionHandler.java b/gateway-center/src/main/java/com/dcy/gateway/sentinel/JsonSentinelGatewayBlockExceptionHandler.java index 1f4bbc9..209cdf5 100644 --- a/gateway-center/src/main/java/com/dcy/gateway/sentinel/JsonSentinelGatewayBlockExceptionHandler.java +++ b/gateway-center/src/main/java/com/dcy/gateway/sentinel/JsonSentinelGatewayBlockExceptionHandler.java @@ -4,7 +4,7 @@ import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.GatewayCallbackManag import com.alibaba.csp.sentinel.slots.block.BlockException; import com.alibaba.fastjson.JSON; import com.dcy.common.model.R; -import com.dcy.common.model.ReturnCode; +import com.dcy.gateway.enums.GatewayApiErrorCode; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.server.reactive.ServerHttpResponse; @@ -23,7 +23,7 @@ public class JsonSentinelGatewayBlockExceptionHandler implements WebExceptionHan private Mono writeResponse(ServerResponse response, ServerWebExchange exchange) { ServerHttpResponse serverHttpResponse = exchange.getResponse(); serverHttpResponse.getHeaders().add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE); - return serverHttpResponse.writeWith(Mono.just(exchange.getResponse().bufferFactory().wrap(JSON.toJSONBytes(R.error(ReturnCode.SENTINEL_BLOCKED_ERROR))))); + return serverHttpResponse.writeWith(Mono.just(exchange.getResponse().bufferFactory().wrap(JSON.toJSONBytes(R.error(GatewayApiErrorCode.SENTINEL_BLOCKED_ERROR))))); } @Override diff --git a/inner-intergration/common-spring-boot-starter/pom.xml b/inner-intergration/common-spring-boot-starter/pom.xml index 2a2733d..99b544b 100644 --- a/inner-intergration/common-spring-boot-starter/pom.xml +++ b/inner-intergration/common-spring-boot-starter/pom.xml @@ -48,22 +48,11 @@ spring-boot-starter-aop - - - cn.afterturn - easypoi-spring-boot-starter - - io.swagger swagger-annotations - - - org.springframework.security - spring-security-core - \ No newline at end of file diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/annotation/Log.java b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/annotation/Log.java index a699c2a..7b95ceb 100644 --- a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/annotation/Log.java +++ b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/annotation/Log.java @@ -1,5 +1,7 @@ package com.dcy.common.annotation; +import com.dcy.common.enums.LogEnum; + import java.lang.annotation.*; /** diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/api/IErrorCode.java b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/api/IErrorCode.java new file mode 100644 index 0000000..f7307cf --- /dev/null +++ b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/api/IErrorCode.java @@ -0,0 +1,24 @@ +package com.dcy.common.api; + +/** + * @Author:dcy + * @Description: 请求返回 + * @Date: 2021/9/14 13:05 + */ +public interface IErrorCode { + + /** + * 错误编码 1、成功;0、失败 + * + * @return + */ + Integer getCode(); + + /** + * 错误描述 + * + * @return + */ + String getMsg(); + +} diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/enums/ApiErrorCode.java b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/enums/ApiErrorCode.java new file mode 100644 index 0000000..0606d66 --- /dev/null +++ b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/enums/ApiErrorCode.java @@ -0,0 +1,58 @@ +package com.dcy.common.enums; + +import com.dcy.common.api.IErrorCode; + +import java.util.stream.Stream; + +/** + * @Author:dcy + * @Description: + * @Date: 2021/9/13 16:14 + */ +public enum ApiErrorCode implements IErrorCode { + /** + * 失败 + */ + ERROR(0, "操作失败"), + /** + * 成功 + */ + SUCCESS(1, "操作成功"), + + /** + * 校验公共错误 + */ + CHECK_ERROR(1000, "校验公共错误"), + OTHER_ERROR(3000, "其他exe 错误"), + ; + + private final Integer code; + private final String msg; + + ApiErrorCode(final Integer code, final String msg) { + this.code = code; + this.msg = msg; + } + + public static ApiErrorCode fromCode(Integer code) { + return Stream.of(ApiErrorCode.values()) + .filter(apiErrorCode -> apiErrorCode.code.equals(code)) + .findAny() + .orElse(SUCCESS); + } + + @Override + public Integer getCode() { + return code; + } + + @Override + public String getMsg() { + return msg; + } + + @Override + public String toString() { + return String.format(" ErrorCode:{code=%s, msg=%s} ", code, msg); + } +} \ No newline at end of file diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/annotation/LogEnum.java b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/enums/LogEnum.java similarity index 84% rename from inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/annotation/LogEnum.java rename to inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/enums/LogEnum.java index 62e7b6d..07e14b1 100644 --- a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/annotation/LogEnum.java +++ b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/enums/LogEnum.java @@ -1,4 +1,4 @@ -package com.dcy.common.annotation; +package com.dcy.common.enums; /** * @Author:dcy diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/OperationalLog.java b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/OperationalLog.java index 085359e..eae721f 100644 --- a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/OperationalLog.java +++ b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/OperationalLog.java @@ -1,6 +1,6 @@ package com.dcy.common.model; -import com.dcy.common.annotation.LogEnum; +import com.dcy.common.enums.LogEnum; import lombok.Getter; import lombok.Setter; import lombok.ToString; diff --git a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/R.java b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/R.java index 37afff2..447a09b 100644 --- a/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/R.java +++ b/inner-intergration/common-spring-boot-starter/src/main/java/com/dcy/common/model/R.java @@ -1,10 +1,14 @@ package com.dcy.common.model; +import com.dcy.common.api.IErrorCode; +import com.dcy.common.enums.ApiErrorCode; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; +import java.util.Optional; + /** * @Author:dcy * @Description: 返回给前台的通用包装 @@ -28,40 +32,37 @@ public class R { } - public R(ReturnCode returnCode, T data) { - this.code = returnCode.getCode(); - this.msg = returnCode.getMsg(); - this.data = data; - } - - public static R success() { - return new R(ReturnCode.SUCCESS, null); - } - - public static R success(T object) { - return new R(ReturnCode.SUCCESS, object); + public R(IErrorCode errorCode) { + errorCode = Optional.ofNullable(errorCode).orElse(ApiErrorCode.ERROR); + this.code = errorCode.getCode(); + this.msg = errorCode.getMsg(); } - public static R success(ReturnCode returnCode, T object) { - return new R(returnCode, object); + public static R success(T data) { + ApiErrorCode aec = ApiErrorCode.SUCCESS; + if (data instanceof Boolean && Boolean.FALSE.equals(data)) { + aec = ApiErrorCode.ERROR; + } + return restResult(aec, data); } - public static R error() { - return new R(ReturnCode.ERROR, null); + public static R error(String msg) { + return restResult(ApiErrorCode.ERROR.getCode(), msg, null); } - public static R error(ReturnCode returnCode) { - return new R(returnCode, null); + public static R error(IErrorCode errorCode) { + return restResult(errorCode, null); } - public static R error(Integer code, String msg) { - R r = new R<>(); - r.setCode(code); - r.setMsg(msg); - return r; + public static R restResult(IErrorCode errorCode, T data) { + return restResult(errorCode.getCode(), errorCode.getMsg(), data); } - public static R error(ReturnCode returnCode, T object) { - return new R(returnCode, object); + private static R restResult(Integer code, String msg, T data) { + R apiResult = new R<>(); + apiResult.setCode(code); + apiResult.setData(data); + apiResult.setMsg(msg); + return apiResult; } } diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java index e6e1f97..13324fa 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/BaseController.java @@ -64,7 +64,7 @@ public abstract class BaseController extend * @return */ public R save(Entity entity) { - return depends(baseService.save(entity)); + return success(baseService.save(entity)); } /** @@ -74,7 +74,7 @@ public abstract class BaseController extend * @return */ public R update(Entity entity) { - return depends(baseService.updateById(entity)); + return success(baseService.updateById(entity)); } /** @@ -84,7 +84,7 @@ public abstract class BaseController extend * @return */ public R delete(Serializable id) { - return depends(baseService.removeById(id)); + return success(baseService.removeById(id)); } /** @@ -94,6 +94,6 @@ public abstract class BaseController extend * @return */ public R deleteBatch(Collection idList) { - return depends(baseService.removeByIds(idList)); + return success(baseService.removeByIds(idList)); } } diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java index cd6462b..1fe8a89 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/base/controller/RBaseController.java @@ -1,8 +1,8 @@ package com.dcy.db.base.controller; +import com.dcy.common.api.IErrorCode; import com.dcy.common.constant.Constant; import com.dcy.common.model.R; -import com.dcy.common.model.ReturnCode; import org.apache.dubbo.rpc.RpcContext; /** @@ -12,33 +12,22 @@ import org.apache.dubbo.rpc.RpcContext; */ public class RBaseController { - protected R success() { - return R.success(); - } - - protected R success(ReturnCode returnCode, T obj) { - return R.success(returnCode, obj); - } - protected R success(T obj) { return R.success(obj); } - protected R error() { - return R.error(); + protected R error(String msg) { + return R.error(msg); } - protected R error(ReturnCode returnCode, T obj) { - return R.error(returnCode, obj); + protected R error(IErrorCode errorCode, T obj) { + return R.error(errorCode); } - protected R error(ReturnCode returnCode) { - return R.error(returnCode); + protected R restResult(IErrorCode errorCode, T data) { + return R.restResult(errorCode, data); } - protected R depends(boolean success) { - return success ? success() : error(); - } /** * 获取用户id */ diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/CheckExceptionHandler.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/CheckExceptionHandler.java index 39607f9..30273be 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/CheckExceptionHandler.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/CheckExceptionHandler.java @@ -1,7 +1,7 @@ package com.dcy.db.handler; +import com.dcy.common.enums.ApiErrorCode; import com.dcy.common.model.R; -import com.dcy.common.model.ReturnCode; import lombok.extern.slf4j.Slf4j; import org.springframework.core.annotation.Order; import org.springframework.http.HttpStatus; @@ -40,10 +40,10 @@ public class CheckExceptionHandler { // validException.printStackTrace(); if (bindException.hasErrors()) { for (ObjectError error : bindException.getAllErrors()) { - return R.error(ReturnCode.CHECK_ERROR.getCode(), error.getDefaultMessage()); + return R.restResult(ApiErrorCode.CHECK_ERROR, error.toString()); } } - return R.error(ReturnCode.CHECK_ERROR.getCode(), bindException.getMessage()); + return R.restResult(ApiErrorCode.CHECK_ERROR, bindException.getMessage()); } /** @@ -55,8 +55,8 @@ public class CheckExceptionHandler { @ResponseStatus(HttpStatus.OK) @ExceptionHandler(MissingServletRequestParameterException.class) public R missingServletRequestParameterExceptionHandler(MissingServletRequestParameterException missingServletRequestParameterException) { - log.warn("missingServletRequestParameterException [{}]", missingServletRequestParameterException.toString()); - return R.error(ReturnCode.CHECK_ERROR.getCode(), missingServletRequestParameterException.getMessage()); + log.warn("missingServletRequestParameterException [{}]", missingServletRequestParameterException.getMessage()); + return R.restResult(ApiErrorCode.CHECK_ERROR, missingServletRequestParameterException.getMessage()); } /** @@ -74,10 +74,10 @@ public class CheckExceptionHandler { ConstraintViolationException exs = (ConstraintViolationException) exception; Set> violations = exs.getConstraintViolations(); for (ConstraintViolation item : violations) { - return R.error(ReturnCode.CHECK_ERROR.getCode(), item.getMessage()); + return R.restResult(ApiErrorCode.CHECK_ERROR, item.getMessage()); } } - return R.error(ReturnCode.CHECK_ERROR.getCode(), exception.getMessage()); + return R.restResult(ApiErrorCode.CHECK_ERROR, exception.getMessage()); } } diff --git a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/GlobalExceptionHandler.java b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/GlobalExceptionHandler.java index e7fd58f..afce8e7 100644 --- a/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/GlobalExceptionHandler.java +++ b/inner-intergration/db-spring-boot-starter/src/main/java/com/dcy/db/handler/GlobalExceptionHandler.java @@ -1,8 +1,7 @@ package com.dcy.db.handler; -import cn.hutool.core.exceptions.ValidateException; +import com.dcy.common.enums.ApiErrorCode; import com.dcy.common.model.R; -import com.dcy.common.model.ReturnCode; import lombok.extern.slf4j.Slf4j; import org.springframework.core.annotation.Order; import org.springframework.http.HttpStatus; @@ -10,11 +9,6 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.ValidationException; -import java.util.Set; - /** * @Author:dcy * @Description: 全局的的异常拦截器 @@ -37,7 +31,7 @@ public class GlobalExceptionHandler { public R exceptionHandler(Exception exception) { log.error("exceptionHandle [{}]", exception.toString()); exception.printStackTrace(); - return R.error(ReturnCode.OTHER_ERROR.getCode(), exception.getMessage()); + return R.restResult(ApiErrorCode.OTHER_ERROR, exception.getMessage()); } } -- Gitee From ad993bec360b119199b02b38fe09230dcf3426eb Mon Sep 17 00:00:00 2001 From: dongchunyu <1540770111@qq.com> Date: Tue, 14 Sep 2021 13:52:59 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a-build/sql/dcy-fast-cloud.sql | 499 ++++++++--------- .../db/migration/V1.0__create_system.sql | 502 +++++++++--------- 2 files changed, 460 insertions(+), 541 deletions(-) diff --git a/a-build/sql/dcy-fast-cloud.sql b/a-build/sql/dcy-fast-cloud.sql index 467ccbb..7c82533 100644 --- a/a-build/sql/dcy-fast-cloud.sql +++ b/a-build/sql/dcy-fast-cloud.sql @@ -5,13 +5,13 @@ Source Server Type : MySQL Source Server Version : 50730 Source Host : localhost:3306 - Source Schema : dcy-fast-cloud + Source Schema : dcy-fast-system Target Server Type : MySQL Target Server Version : 50730 File Encoding : 65001 - Date: 16/04/2021 13:56:51 + Date: 14/09/2021 13:51:14 */ SET NAMES utf8mb4; @@ -22,335 +22,272 @@ SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- DROP TABLE IF EXISTS `sys_config`; CREATE TABLE `sys_config` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数id', - `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数名称', - `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键名', - `config_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键值', - `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '系统内置', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数id', + `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数名称', + `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键名', + `config_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键值', + `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '系统内置', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数配置表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_config -- ---------------------------- -INSERT INTO `sys_config` VALUES ('1377930337229471746', '测试配置', 'test_config_key', 'userinfo', '0', '1170896100656156674', '2021-04-02 18:26:07.764', '1170896100656156674', '2021-04-03 08:39:08.729', '0', NULL); +INSERT INTO `sys_config` VALUES ('1377930337229471746', '测试配置', 'test_config_key', 'userinfo', '0'); -- ---------------------------- -- Table structure for sys_dept -- ---------------------------- DROP TABLE IF EXISTS `sys_dept`; CREATE TABLE `sys_dept` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', - `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '父部门id', - `ancestors` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', - `dept_sort` decimal(20, 0) NULL DEFAULT 0 COMMENT '显示顺序', - `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', - `dept_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0、正常;1、停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', + `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '父部门id', + `ancestors` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', + `dept_sort` decimal(20, 0) NULL DEFAULT 0 COMMENT '显示顺序', + `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `dept_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0、正常;1、停用)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_dept -- ---------------------------- -INSERT INTO `sys_dept` VALUES ('1', '0', '0', '总公司', 0, NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1371702174283571201', '3', '0,1,3', '财务部门', 5, NULL, NULL, '0', '1170896100656156674', '2021-03-16 13:57:38', '1170896100656156674', '2021-04-02 18:49:25', '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935436483919873', '2', '0,1,2', '研发部门', 1, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:24', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935480696078337', '2', '0,1,2', '测试部门', 3, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:34', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935517522067457', '2', '0,1,2', '产品部门', 5, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:43', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935562556309505', '2', '0,1,2', '运维部门', 7, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:54', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935601739497474', '2', '0,1,2', '市场部门', 8, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:47:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377936163021258753', '3', '0,1,3', '市场部门', 3, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:49:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('2', '1', '0,1', '深圳总公司', 1, NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('3', '1', '0,1', '长沙分公司', 2, '22323', '11111', '0', NULL, NULL, '1170896100656156674', '2021-03-16 13:57:27', '0', NULL); +INSERT INTO `sys_dept` VALUES ('1', '0', '0', '总公司', 0, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1371702174283571201', '3', '0,1,3', '财务部门', 5, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935436483919873', '2', '0,1,2', '研发部门', 1, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935480696078337', '2', '0,1,2', '测试部门', 3, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935517522067457', '2', '0,1,2', '产品部门', 5, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935562556309505', '2', '0,1,2', '运维部门', 7, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935601739497474', '2', '0,1,2', '市场部门', 8, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377936163021258753', '3', '0,1,3', '市场部门', 3, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('2', '1', '0,1', '深圳总公司', 1, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('3', '1', '0,1', '长沙分公司', 2, '22323', '11111', '0'); -- ---------------------------- -- Table structure for sys_dict_data -- ---------------------------- DROP TABLE IF EXISTS `sys_dict_data`; CREATE TABLE `sys_dict_data` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典id', - `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', - `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', - `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典键值', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `dict_sort` int(11) NULL DEFAULT 0 COMMENT '字典排序', - `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', - `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', - `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典id', + `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', + `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', + `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典键值', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', + `dict_sort` int(11) NULL DEFAULT 0 COMMENT '字典排序', + `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', + `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', + `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_dict_data -- ---------------------------- -INSERT INTO `sys_dict_data` VALUES ('1372709863595810818', NULL, '男', '1', 'sex', 1, NULL, 'primary', '0', '1170896100656156674', '2021-03-19 08:41:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372709863595810819', NULL, '女', '2', 'sex', 2, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:41:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372709863595810820', NULL, '未知', '3', 'sex', 3, NULL, 'info', '0', '1170896100656156674', '2021-03-19 08:41:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979960', NULL, '正常', '0', 'dict_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979962', NULL, '正常', '0', 'role_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979966', NULL, '正常', '0', 'dept_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979967', NULL, '正常', '0', 'post_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979969', NULL, '正常', '0', 'user_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979980', NULL, '正常', '0', 'res_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986241', NULL, '禁用', '1', 'user_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986242', NULL, '禁用', '1', 'dict_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986243', NULL, '禁用', '1', 'role_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986245', NULL, '禁用', '1', 'dept_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986248', NULL, '禁用', '1', 'post_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986281', NULL, '禁用', '1', 'res_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310657', NULL, '管理员', '0', 'user_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310670', NULL, '模块权限', '0', 'menu_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310673', NULL, '模块', '0', 'module_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310678', NULL, '模块', '0', 'power_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768769', NULL, '普通用户', '1', 'user_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768771', NULL, '菜单权限', '1', 'menu_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768774', NULL, '操作', '1', 'module_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768776', NULL, 'GET', 'GET', 'http_method', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768777', NULL, 'POST', 'POST', 'http_method', 3, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768779', NULL, '菜单', '1', 'power_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376409914658590721', NULL, '全部数据权限', '1', 'data_scope', 1, NULL, 'primary', '0', '1170896100656156674', '2021-03-29 13:44:31', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376409951539105794', NULL, '自定数据权限', '2', 'data_scope', 2, NULL, 'success', '0', '1170896100656156674', '2021-03-29 13:44:40', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376409996724342786', NULL, '本部门数据权限', '3', 'data_scope', 3, NULL, 'danger', '0', '1170896100656156674', '2021-03-29 13:44:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376410032313012226', NULL, '本部门及以下数据权限', '4', 'data_scope', 4, NULL, 'error', '0', '1170896100656156674', '2021-03-29 13:44:59', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1378139151967047682', NULL, '是', '0', 'config_type', 0, NULL, 'success', '0', '1170896100656156674', '2021-04-03 08:15:53', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1378139197374582785', NULL, '否', '1', 'config_type', 1, NULL, 'danger', '0', '1170896100656156674', '2021-04-03 08:16:04', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234283315372034', NULL, '立即执行', '1', 'misfire_policy_type', 1, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 08:47:33', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234361887268865', NULL, '执行一次', '2', 'misfire_policy_type', 2, NULL, 'success', '0', '1170896100656156674', '2021-04-06 08:47:51', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234431768567809', NULL, '放弃执行', '3', 'misfire_policy_type', 3, NULL, 'danger', '0', '1170896100656156674', '2021-04-06 08:48:08', '1170896100656156674', '2021-04-06 08:48:15', '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234652439289857', NULL, '允许', '0', 'concurrent_type', 0, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 08:49:01', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234729853558786', NULL, '禁止', '1', 'concurrent_type', 1, NULL, 'error', '0', '1170896100656156674', '2021-04-06 08:49:19', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234884933754882', NULL, '正常', '0', 'job_status', 0, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 08:49:56', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234956018819074', NULL, '暂停', '1', 'job_status', 1, NULL, 'danger', '0', '1170896100656156674', '2021-04-06 08:50:13', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379240904900845569', NULL, '默认', 'DEFAULT', 'job_group', 1, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 09:13:51', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379240969895780354', NULL, '系统', 'SYSTEM', 'job_group', 2, NULL, 'info', '0', '1170896100656156674', '2021-04-06 09:14:07', NULL, NULL, '0', NULL); +INSERT INTO `sys_dict_data` VALUES ('1372709863595810818', NULL, '男', '1', 'sex', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372709863595810819', NULL, '女', '2', 'sex', 2, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372709863595810820', NULL, '未知', '3', 'sex', 3, NULL, 'info', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979960', NULL, '正常', '0', 'dict_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979962', NULL, '正常', '0', 'role_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979966', NULL, '正常', '0', 'dept_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979967', NULL, '正常', '0', 'post_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979969', NULL, '正常', '0', 'user_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979980', NULL, '正常', '0', 'res_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986241', NULL, '禁用', '1', 'user_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986242', NULL, '禁用', '1', 'dict_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986243', NULL, '禁用', '1', 'role_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986245', NULL, '禁用', '1', 'dept_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986248', NULL, '禁用', '1', 'post_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986281', NULL, '禁用', '1', 'res_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310657', NULL, '管理员', '0', 'user_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310670', NULL, '模块权限', '0', 'menu_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310673', NULL, '模块', '0', 'module_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310678', NULL, '模块', '0', 'power_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768769', NULL, '普通用户', '1', 'user_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768771', NULL, '菜单权限', '1', 'menu_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768774', NULL, '操作', '1', 'module_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768776', NULL, 'GET', 'GET', 'http_method', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768777', NULL, 'POST', 'POST', 'http_method', 3, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768779', NULL, '菜单', '1', 'power_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1376409914658590721', NULL, '全部数据权限', '1', 'data_scope', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1376409951539105794', NULL, '自定数据权限', '2', 'data_scope', 2, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1376409996724342786', NULL, '本部门数据权限', '3', 'data_scope', 3, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1376410032313012226', NULL, '本部门及以下数据权限', '4', 'data_scope', 4, NULL, 'error', '0'); +INSERT INTO `sys_dict_data` VALUES ('1378139151967047682', NULL, '是', '0', 'config_type', 0, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1378139197374582785', NULL, '否', '1', 'config_type', 1, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234283315372034', NULL, '立即执行', '1', 'misfire_policy_type', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234361887268865', NULL, '执行一次', '2', 'misfire_policy_type', 2, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234431768567809', NULL, '放弃执行', '3', 'misfire_policy_type', 3, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234652439289857', NULL, '允许', '0', 'concurrent_type', 0, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234729853558786', NULL, '禁止', '1', 'concurrent_type', 1, NULL, 'error', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234884933754882', NULL, '正常', '0', 'job_status', 0, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234956018819074', NULL, '暂停', '1', 'job_status', 1, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379240904900845569', NULL, '默认', 'DEFAULT', 'job_group', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379240969895780354', NULL, '系统', 'SYSTEM', 'job_group', 2, NULL, 'info', '0'); -- ---------------------------- -- Table structure for sys_dict_type -- ---------------------------- DROP TABLE IF EXISTS `sys_dict_type`; CREATE TABLE `sys_dict_type` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典主键', - `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典主键', + `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', + `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_dict_type -- ---------------------------- -INSERT INTO `sys_dict_type` VALUES ('1372709749485576194', '性别', 'sex', '0', '1170896100656156674', '2021-03-19 08:41:23', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372710292954128385', '用户类型', 'user_type', '0', '1170896100656156674', '2021-03-19 08:43:32', '1170896100656156674', '2021-03-19 08:45:56', '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372710383374934017', '用户状态', 'user_status', '0', '1170896100656156674', '2021-03-19 08:43:54', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372710383374934018', '字典状态', 'dict_status', '0', '1170896100656156674', '2021-03-19 08:43:54', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372714386955558914', '角色状态', 'role_status', '0', '1170896100656156674', '2021-03-19 08:59:48', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372714386955558915', '部门状态', 'dept_status', '0', '1170896100656156674', '2021-03-19 08:59:48', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372714386955558916', '岗位状态', 'post_status', '0', '1170896100656156674', '2021-03-19 08:59:48', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720345916502017', '权限类型', 'menu_type', '0', '1170896100656156674', '2021-03-19 09:23:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720409946746881', '模块类型', 'module_type', '0', '1170896100656156674', '2021-03-19 09:23:44', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720457925390338', '请求方式', 'http_method', '0', '1170896100656156674', '2021-03-19 09:23:56', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720504272449538', '菜单类型', 'power_type', '0', '1170896100656156674', '2021-03-19 09:24:07', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372742181504978945', '资源状态', 'res_status', '0', '1170896100656156674', '2021-03-19 10:50:15', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1376409832819331073', '数据范围', 'data_scope', '0', '1170896100656156674', '2021-03-29 13:44:11', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1378139043670118402', '参数配置系统内置选项', 'config_type', '0', '1170896100656156674', '2021-04-03 08:15:27', '1170896100656156674', '2021-04-03 08:16:51', '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379234181460893697', '任务计划执行错误策略', 'misfire_policy_type', '0', '1170896100656156674', '2021-04-06 08:47:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379234566711910401', '任务是否并发执行', 'concurrent_type', '0', '1170896100656156674', '2021-04-06 08:48:40', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379234800548552706', '任务状态', 'job_status', '0', '1170896100656156674', '2021-04-06 08:49:36', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379240777616302082', '任务分组', 'job_group', '0', '1170896100656156674', '2021-04-06 09:13:21', NULL, NULL, '0', NULL); - --- ---------------------------- --- Table structure for sys_file_info --- ---------------------------- -DROP TABLE IF EXISTS `sys_file_info`; -CREATE TABLE `sys_file_info` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件md5', - `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件名称', - `content_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件类型', - `file_size` int(11) NOT NULL COMMENT '文件大小', - `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物理路径', - `url` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'url地址', - `source` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_file_info --- ---------------------------- -INSERT INTO `sys_file_info` VALUES ('d9c81d9c4a45fc58520f14602b5c1687', '旭旭宝宝头像.jpg', 'image/jpeg', 33072, 'group1/M00/00/00/wKgDLF-skuuAEEWsAACBMET2Odo216.jpg', 'http://192.168.3.44:8888/group1/M00/00/00/wKgDLF-skuuAEEWsAACBMET2Odo216.jpg', 'fastdfs', NULL); +INSERT INTO `sys_dict_type` VALUES ('1372709749485576194', '性别', 'sex', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372710292954128385', '用户类型', 'user_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372710383374934017', '用户状态', 'user_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372710383374934018', '字典状态', 'dict_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372714386955558914', '角色状态', 'role_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372714386955558915', '部门状态', 'dept_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372714386955558916', '岗位状态', 'post_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720345916502017', '权限类型', 'menu_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720409946746881', '模块类型', 'module_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720457925390338', '请求方式', 'http_method', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720504272449538', '菜单类型', 'power_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372742181504978945', '资源状态', 'res_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1376409832819331073', '数据范围', 'data_scope', '0'); +INSERT INTO `sys_dict_type` VALUES ('1378139043670118402', '参数配置系统内置选项', 'config_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379234181460893697', '任务计划执行错误策略', 'misfire_policy_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379234566711910401', '任务是否并发执行', 'concurrent_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379234800548552706', '任务状态', 'job_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379240777616302082', '任务分组', 'job_group', '0'); -- ---------------------------- -- Table structure for sys_post -- ---------------------------- DROP TABLE IF EXISTS `sys_post`; CREATE TABLE `sys_post` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位ID', - `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位编码', - `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位名称', - `post_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '显示顺序', - `post_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '岗位状态(0、正常;1、停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位ID', + `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位编码', + `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位名称', + `post_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '显示顺序', + `post_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '岗位状态(0、正常;1、停用)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '岗位表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_post -- ---------------------------- -INSERT INTO `sys_post` VALUES ('1372012058585690114', 'ceo', '董事长', 1.00, '0', '1170896100656156674', '2021-03-17 10:29:00', '1170896100656156674', '2021-03-17 13:12:30', '0', NULL); -INSERT INTO `sys_post` VALUES ('1372053095446319106', 'xxx', '研发经理', 2.00, '0', '1170896100656156674', '2021-03-17 13:12:04', NULL, NULL, '0', NULL); -INSERT INTO `sys_post` VALUES ('1372053161728905217', 'test', '测试经理', 3.00, '0', '1170896100656156674', '2021-03-17 13:12:20', NULL, NULL, '0', NULL); -INSERT INTO `sys_post` VALUES ('1372053279836311554', 'hr', '人力资源', 4.00, '0', '1170896100656156674', '2021-03-17 13:12:48', NULL, NULL, '0', NULL); +INSERT INTO `sys_post` VALUES ('1372012058585690114', 'ceo', '董事长', 1.00, '0'); +INSERT INTO `sys_post` VALUES ('1372053095446319106', 'xxx', '研发经理', 2.00, '0'); +INSERT INTO `sys_post` VALUES ('1372053161728905217', 'test', '测试经理', 3.00, '0'); +INSERT INTO `sys_post` VALUES ('1372053279836311554', 'hr', '人力资源', 4.00, '0'); -- ---------------------------- -- Table structure for sys_resources -- ---------------------------- DROP TABLE IF EXISTS `sys_resources`; CREATE TABLE `sys_resources` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id', - `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', - `parent_ids` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级ids', - `res_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源名称', - `res_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源code', - `res_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源path', - `http_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请求方式', - `res_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态(0、正常;1、禁用)', - `res_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型(0、模块;1、链接)', - `res_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序', - `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识(0:正常;1:已删除)', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id', + `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', + `parent_ids` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级ids', + `res_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源名称', + `res_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源code', + `res_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源path', + `http_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请求方式', + `res_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态(0、正常;1、禁用)', + `res_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型(0、模块;1、链接)', + `res_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '资源表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_resources -- ---------------------------- -INSERT INTO `sys_resources` VALUES ('1173417638056017922', '0', '0', '系统管理', NULL, NULL, NULL, '0', '0', 100.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173417760584220674', '1173417638056017922', '1173416959543459841,1173417638056017922', '用户管理', NULL, NULL, NULL, '0', '0', 10.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173494683788189698', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户添加', 'user:save', '/system-center/system/user/save', 'POST', '0', '1', 2.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:11:59', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173519815223037953', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户修改', 'user:update', '/system-center/system/user/update', 'POST', '0', '1', 5.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:12:03', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173519895434907649', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除', 'user:delete', '/system-center/system/user/delete', 'POST', '0', '1', 7.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:12:26', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173519984786165761', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除(批量)', 'user:batch:delete', '/system-center/system/user/deleteBatch', 'POST', '0', '1', 12.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:13:18', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173520061013446658', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '重置密码', 'user:reset:pass', '/system-center/system/user/resetPassword', 'POST', '0', '1', 13.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173520251158024193', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '授权角色', 'user:auth:role', '/system-center/system/user/saveAuthRole', 'POST', '0', '1', 15.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:14:08', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173521725967654914', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户查询', 'user:list', '/system-center/system/user/page', 'GET', '0', '1', 1.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:11:51', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173786240433037313', '1173417638056017922', '1173416959543459841,1173417638056017922', '角色管理', NULL, NULL, NULL, '0', '0', 20.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173786896229244930', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色查询', 'role:list', '/system-center/system/role/page', 'GET', '0', '1', 3.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:15:56', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787141281456130', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色添加', 'role:save', '/system-center/system/role/save', 'POST', '0', '1', 7.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:33', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787273578192898', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色修改', 'role:update', '/system-center/system/role/update', 'POST', '0', '1', 10.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:38', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787371326447617', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除', 'role:delete', '/system-center/system/role/delete', 'POST', '0', '1', 15.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:44', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787467954823170', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除(批量)', 'role:batch:delete', '/system-center/system/role/deleteBatch', 'POST', '0', '1', 17.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:58', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787686142517250', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '保存授权权限', 'role:auth:resource', '/system-center/system/role/saveAuthResource', 'POST', '0', '1', 25.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173792738055856130', '1173417638056017922', '1173416959543459841,1173417638056017922', '资源管理', NULL, NULL, NULL, '0', '0', 30.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:02:36', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793141136859137', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源添加', 'module:add', '/system-center/system/resources/save', 'POST', '0', '1', 7.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:43', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793218580488194', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源修改', 'module:update', '/system-center/system/resources/update', 'POST', '0', '1', 9.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:48', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793287136387073', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源删除', 'module:delete', '/system-center/system/resources/delete', 'POST', '0', '1', 11.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:53', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793449908936705', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源查询', 'module:list', '/system-center/system/resources/getResourceTreeTableList', 'GET', '0', '1', 2.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:35', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938290946772993', '1173417638056017922', '1173416959543459841,1173417638056017922', '字典管理', NULL, NULL, NULL, '0', '0', 60.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:04:18', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938414578077698', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典查询', 'dict:list', '/system-center/system/dict/getDictTreeTableList', 'GET', '0', '1', 5.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:24:23', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938659106000810', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典修改', 'dict:update', '/system-center/system/dict/update', 'POST', '0', '1', 15.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938659106000811', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典删除', 'dict:delete', '/system-center/system/dict/delete', 'POST', '0', '1', 20.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938659106000898', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典添加', 'dict:save', '/system-center/system/dict/save', 'POST', '0', '1', 10.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924533432627201', '1173417638056017922', '1173416959543459841,1173417638056017922', '部门管理', NULL, NULL, NULL, '0', '0', 40.00, '1170896100656156674', '2021-04-02 18:03:04', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924655306518530', '1173417638056017922', '1173416959543459841,1173417638056017922', '岗位管理', NULL, NULL, NULL, '0', '0', 50.00, '1170896100656156674', '2021-04-02 18:03:33', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924913415598081', '1173417638056017922', '1173416959543459841,1173417638056017922', '配置管理', NULL, NULL, NULL, '0', '0', 70.00, '1170896100656156674', '2021-04-02 18:04:35', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924955010510850', '1173417638056017922', '1173416959543459841,1173417638056017922', '日志管理', NULL, NULL, NULL, '0', '0', 80.00, '1170896100656156674', '2021-04-02 18:04:45', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928656441847810', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门查询', 'dept:list', '/system-center/system/dept/getDeptTreeTableList', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:19:27', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928808594419714', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门添加', 'dept:save', '/system-center/system/dept/save', 'POST', '0', '1', 4.00, '1170896100656156674', '2021-04-02 18:20:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928808594419715', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门修改', 'dept:update', '/system-center/system/dept/update', 'POST', '0', '1', 5.00, '1170896100656156674', '2021-04-02 18:20:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928808594419716', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门删除', 'dept:delete', '/system-center/system/dept/delete', 'POST', '0', '1', 6.00, '1170896100656156674', '2021-04-02 18:20:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642690', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位查询', 'post:list', '/system-center/system/post/page', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642691', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位添加', 'post:save', '/system-center/system/post/save', 'GET', '0', '1', 4.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642692', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位修改', 'post:update', '/system-center/system/post/update', 'GET', '0', '1', 6.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642693', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除', 'post:delete', '/system-center/system/post/delete', 'GET', '0', '1', 8.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642694', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除(批量)', 'post:batch:delete', '/system-center/system/post/deleteBatch', 'GET', '0', '1', 10.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821505', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置查询', 'config:list', '/system-center/system/config/page', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821506', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置添加', 'config:save', '/system-center/system/config/save', 'POST', '0', '1', 4.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821507', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置修改', 'config:update', '/system-center/system/config/update', 'POST', '0', '1', 5.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821508', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除', 'config:delete', '/system-center/system/config/delete', 'POST', '0', '1', 7.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821509', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除(批量)', 'config:batch:delete', '/system-center/system/config/deleteBatch', 'POST', '0', '1', 9.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377931926581280770', '1377924955010510850', '1173416959543459841,1173417638056017922,1377924955010510850', '日志查询', 'log:list', '/system-center/system/log/page', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:32:27', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379319785074839553', '1173417638056017922', '0,1173417638056017922', '任务管理', NULL, NULL, NULL, '0', '0', 90.00, '1170896100656156674', '2021-04-06 14:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734722', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务查询', 'job:list', '/system-center/monitor/job/page', 'GET', '0', '1', 1.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734723', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务添加', 'job:save', '/system-center/monitor/job/save', 'POST', '0', '1', 3.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734724', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务修改', 'job:update', '/system-center/monitor/job/update', 'POST', '0', '1', 5.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734725', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除', 'job:delete', '/system-center/monitor/job/delete', 'POST', '0', '1', 7.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734726', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除(批量)', 'job:batch:delete', '/system-center/monitor/job/deleteBatch', 'POST', '0', '1', 9.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734727', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '切换状态', 'job:change:status', '/system-center/monitor/job/changeStatus', 'POST', '0', '1', 11.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734728', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '执行一次', 'job:run', '/system-center/monitor/job/run', 'POST', '0', '1', 14.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734729', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '调度日志', 'job:task:log', '/system-center/monitor/jobLog/page', 'GET', '0', '1', 16.00, '1170896100656156674', '2021-04-06 14:29:08', '1170896100656156674', '2021-04-06 15:42:19', '0', NULL); +INSERT INTO `sys_resources` VALUES ('1173417638056017922', '0', '0', '系统管理', NULL, NULL, NULL, '0', '0', 100.00); +INSERT INTO `sys_resources` VALUES ('1173417760584220674', '1173417638056017922', '1173416959543459841,1173417638056017922', '用户管理', NULL, NULL, NULL, '0', '0', 10.00); +INSERT INTO `sys_resources` VALUES ('1173494683788189698', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户添加', 'user:save', '/system-center/system/user/save', 'POST', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1173519815223037953', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户修改', 'user:update', '/system-center/system/user/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1173519895434907649', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除', 'user:delete', '/system-center/system/user/delete', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1173519984786165761', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除(批量)', 'user:batch:delete', '/system-center/system/user/deleteBatch', 'POST', '0', '1', 12.00); +INSERT INTO `sys_resources` VALUES ('1173520061013446658', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '重置密码', 'user:reset:pass', '/system-center/system/user/resetPassword', 'POST', '0', '1', 13.00); +INSERT INTO `sys_resources` VALUES ('1173520251158024193', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '授权角色', 'user:auth:role', '/system-center/system/user/saveAuthRole', 'POST', '0', '1', 15.00); +INSERT INTO `sys_resources` VALUES ('1173521725967654914', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户查询', 'user:list', '/system-center/system/user/page', 'GET', '0', '1', 1.00); +INSERT INTO `sys_resources` VALUES ('1173786240433037313', '1173417638056017922', '1173416959543459841,1173417638056017922', '角色管理', NULL, NULL, NULL, '0', '0', 20.00); +INSERT INTO `sys_resources` VALUES ('1173786896229244930', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色查询', 'role:list', '/system-center/system/role/page', 'GET', '0', '1', 3.00); +INSERT INTO `sys_resources` VALUES ('1173787141281456130', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色添加', 'role:save', '/system-center/system/role/save', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1173787273578192898', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色修改', 'role:update', '/system-center/system/role/update', 'POST', '0', '1', 10.00); +INSERT INTO `sys_resources` VALUES ('1173787371326447617', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除', 'role:delete', '/system-center/system/role/delete', 'POST', '0', '1', 15.00); +INSERT INTO `sys_resources` VALUES ('1173787467954823170', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除(批量)', 'role:batch:delete', '/system-center/system/role/deleteBatch', 'POST', '0', '1', 17.00); +INSERT INTO `sys_resources` VALUES ('1173787686142517250', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '保存授权权限', 'role:auth:resource', '/system-center/system/role/saveAuthResource', 'POST', '0', '1', 25.00); +INSERT INTO `sys_resources` VALUES ('1173792738055856130', '1173417638056017922', '1173416959543459841,1173417638056017922', '资源管理', NULL, NULL, NULL, '0', '0', 30.00); +INSERT INTO `sys_resources` VALUES ('1173793141136859137', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源添加', 'module:add', '/system-center/system/resources/save', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1173793218580488194', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源修改', 'module:update', '/system-center/system/resources/update', 'POST', '0', '1', 9.00); +INSERT INTO `sys_resources` VALUES ('1173793287136387073', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源删除', 'module:delete', '/system-center/system/resources/delete', 'POST', '0', '1', 11.00); +INSERT INTO `sys_resources` VALUES ('1173793449908936705', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源查询', 'module:list', '/system-center/system/resources/getResourceTreeTableList', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1208938290946772993', '1173417638056017922', '1173416959543459841,1173417638056017922', '字典管理', NULL, NULL, NULL, '0', '0', 60.00); +INSERT INTO `sys_resources` VALUES ('1208938414578077698', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典查询', 'dict:list', '/system-center/system/dict/getDictTreeTableList', 'GET', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1208938659106000810', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典修改', 'dict:update', '/system-center/system/dict/update', 'POST', '0', '1', 15.00); +INSERT INTO `sys_resources` VALUES ('1208938659106000811', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典删除', 'dict:delete', '/system-center/system/dict/delete', 'POST', '0', '1', 20.00); +INSERT INTO `sys_resources` VALUES ('1208938659106000898', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典添加', 'dict:save', '/system-center/system/dict/save', 'POST', '0', '1', 10.00); +INSERT INTO `sys_resources` VALUES ('1377924533432627201', '1173417638056017922', '1173416959543459841,1173417638056017922', '部门管理', NULL, NULL, NULL, '0', '0', 40.00); +INSERT INTO `sys_resources` VALUES ('1377924655306518530', '1173417638056017922', '1173416959543459841,1173417638056017922', '岗位管理', NULL, NULL, NULL, '0', '0', 50.00); +INSERT INTO `sys_resources` VALUES ('1377924913415598081', '1173417638056017922', '1173416959543459841,1173417638056017922', '配置管理', NULL, NULL, NULL, '0', '0', 70.00); +INSERT INTO `sys_resources` VALUES ('1377924955010510850', '1173417638056017922', '1173416959543459841,1173417638056017922', '日志管理', NULL, NULL, NULL, '0', '0', 80.00); +INSERT INTO `sys_resources` VALUES ('1377928656441847810', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门查询', 'dept:list', '/system-center/system/dept/getDeptTreeTableList', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1377928808594419714', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门添加', 'dept:save', '/system-center/system/dept/save', 'POST', '0', '1', 4.00); +INSERT INTO `sys_resources` VALUES ('1377928808594419715', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门修改', 'dept:update', '/system-center/system/dept/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1377928808594419716', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门删除', 'dept:delete', '/system-center/system/dept/delete', 'POST', '0', '1', 6.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642690', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位查询', 'post:list', '/system-center/system/post/page', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642691', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位添加', 'post:save', '/system-center/system/post/save', 'GET', '0', '1', 4.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642692', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位修改', 'post:update', '/system-center/system/post/update', 'GET', '0', '1', 6.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642693', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除', 'post:delete', '/system-center/system/post/delete', 'GET', '0', '1', 8.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642694', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除(批量)', 'post:batch:delete', '/system-center/system/post/deleteBatch', 'GET', '0', '1', 10.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821505', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置查询', 'config:list', '/system-center/system/config/page', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821506', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置添加', 'config:save', '/system-center/system/config/save', 'POST', '0', '1', 4.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821507', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置修改', 'config:update', '/system-center/system/config/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821508', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除', 'config:delete', '/system-center/system/config/delete', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821509', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除(批量)', 'config:batch:delete', '/system-center/system/config/deleteBatch', 'POST', '0', '1', 9.00); +INSERT INTO `sys_resources` VALUES ('1377931926581280770', '1377924955010510850', '1173416959543459841,1173417638056017922,1377924955010510850', '日志查询', 'log:list', '/system-center/system/log/page', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1379319785074839553', '1173417638056017922', '0,1173417638056017922', '任务管理', NULL, NULL, NULL, '0', '0', 90.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734722', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务查询', 'job:list', '/system-center/monitor/job/page', 'GET', '0', '1', 1.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734723', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务添加', 'job:save', '/system-center/monitor/job/save', 'POST', '0', '1', 3.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734724', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务修改', 'job:update', '/system-center/monitor/job/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734725', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除', 'job:delete', '/system-center/monitor/job/delete', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734726', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除(批量)', 'job:batch:delete', '/system-center/monitor/job/deleteBatch', 'POST', '0', '1', 9.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734727', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '切换状态', 'job:change:status', '/system-center/monitor/job/changeStatus', 'POST', '0', '1', 11.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734728', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '执行一次', 'job:run', '/system-center/monitor/job/run', 'POST', '0', '1', 14.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734729', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '调度日志', 'job:task:log', '/system-center/monitor/jobLog/page', 'GET', '0', '1', 16.00); -- ---------------------------- -- Table structure for sys_role -- ---------------------------- DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - `role_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', - `role_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色权限字符串', - `role_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色状态(0、正常;1、禁用)', - `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围(1、全部数据权限;2、自定数据权限;3、本部门数据权限;4、本部门及以下数据权限)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + `role_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', + `role_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色权限字符串', + `role_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色状态(0、正常;1、禁用)', + `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围(1、全部数据权限;2、自定数据权限;3、本部门数据权限;4、本部门及以下数据权限)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_role -- ---------------------------- -INSERT INTO `sys_role` VALUES ('1171709223680184321', '管理员', 'ROLE_ADMIN', '0', '1', NULL, NULL, '1170896100656156674', '2021-03-29 16:36:53', '0', '备注'); -INSERT INTO `sys_role` VALUES ('1171953892250918913', '开发组长', 'ROLE_DEVELOP', '0', '4', NULL, NULL, '1170896100656156674', '2021-03-31 08:02:34', '0', NULL); -INSERT INTO `sys_role` VALUES ('1171953965877731330', '测试组长', 'ROLE_TEST', '0', '4', NULL, NULL, '1170896100656156674', '2021-03-29 15:40:37', '0', NULL); -INSERT INTO `sys_role` VALUES ('1171954063797952514', '项目经理', 'ROLE_MANAGE', '1', '1', NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_role` VALUES ('1339373635128303617', 'test2', 'ROLE_AAD', '1', '2', NULL, NULL, '1170896100656156674', '2021-03-29 14:35:16', '0', NULL); +INSERT INTO `sys_role` VALUES ('1171709223680184321', '管理员', 'ROLE_ADMIN', '0', '1'); +INSERT INTO `sys_role` VALUES ('1171953892250918913', '开发组长', 'ROLE_DEVELOP', '0', '4'); +INSERT INTO `sys_role` VALUES ('1171953965877731330', '测试组长', 'ROLE_TEST', '0', '4'); +INSERT INTO `sys_role` VALUES ('1171954063797952514', '项目经理', 'ROLE_MANAGE', '1', '1'); +INSERT INTO `sys_role` VALUES ('1339373635128303617', 'test2', 'ROLE_AAD', '1', '2'); -- ---------------------------- -- Table structure for sys_role_dept -- ---------------------------- DROP TABLE IF EXISTS `sys_role_dept`; CREATE TABLE `sys_role_dept` ( - `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', - PRIMARY KEY (`role_id`, `dept_id`) USING BTREE + `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', + PRIMARY KEY (`role_id`, `dept_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- @@ -363,9 +300,9 @@ INSERT INTO `sys_role_dept` VALUES ('1339373635128303617', '2'); -- ---------------------------- DROP TABLE IF EXISTS `sys_role_res`; CREATE TABLE `sys_role_res` ( - `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - `res_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '资源id', - PRIMARY KEY (`role_id`, `res_id`) USING BTREE + `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + `res_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '资源id', + PRIMARY KEY (`role_id`, `res_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和资源关联表' ROW_FORMAT = Dynamic; -- ---------------------------- @@ -439,24 +376,24 @@ INSERT INTO `sys_role_res` VALUES ('1171953892250918913', '1173521725967654914') -- ---------------------------- DROP TABLE IF EXISTS `sys_user_info`; CREATE TABLE `sys_user_info` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', - `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门id', - `username` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名', - `password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', - `nick_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称', - `user_type` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '用户类型(0、管理员;1、普通用户)', - `email` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户邮箱', - `phone_number` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码', - `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别(0、男;1、女)', - `avatar_path` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', - `user_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0、正常;1、禁用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', + `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门id', + `username` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名', + `password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', + `nick_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称', + `user_type` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '用户类型(0、管理员;1、普通用户)', + `email` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户邮箱', + `phone_number` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别(0、男;1、女)', + `avatar_path` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', + `user_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0、正常;1、禁用)', + `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', + `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', + `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', + `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic; -- ---------------------------- @@ -472,9 +409,9 @@ INSERT INTO `sys_user_info` VALUES ('1339368705646702593', '3', '12345676', '{bc -- ---------------------------- DROP TABLE IF EXISTS `sys_user_post`; CREATE TABLE `sys_user_post` ( - `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', - `post_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位id', - PRIMARY KEY (`user_id`, `post_id`) USING BTREE + `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', + `post_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位id', + PRIMARY KEY (`user_id`, `post_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户与岗位关联表' ROW_FORMAT = Dynamic; -- ---------------------------- @@ -491,9 +428,9 @@ INSERT INTO `sys_user_post` VALUES ('1339368705646702593', '1372012058585690114' -- ---------------------------- DROP TABLE IF EXISTS `sys_user_role`; CREATE TABLE `sys_user_role` ( - `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', - `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - PRIMARY KEY (`user_id`, `role_id`) USING BTREE + `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', + `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + PRIMARY KEY (`user_id`, `role_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户角色关联表' ROW_FORMAT = Dynamic; -- ---------------------------- diff --git a/business-center/system-center/src/main/resources/db/migration/V1.0__create_system.sql b/business-center/system-center/src/main/resources/db/migration/V1.0__create_system.sql index f16e13d..1b817ea 100644 --- a/business-center/system-center/src/main/resources/db/migration/V1.0__create_system.sql +++ b/business-center/system-center/src/main/resources/db/migration/V1.0__create_system.sql @@ -5,331 +5,313 @@ Source Server Type : MySQL Source Server Version : 50730 Source Host : localhost:3306 - Source Schema : dcy-fast-cloud + Source Schema : dcy-fast-system Target Server Type : MySQL Target Server Version : 50730 File Encoding : 65001 - Date: 16/04/2021 13:56:51 + Date: 14/09/2021 13:51:14 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; +-- ---------------------------- +-- Table structure for flyway_schema_history +-- ---------------------------- +DROP TABLE IF EXISTS `flyway_schema_history`; +CREATE TABLE `flyway_schema_history` ( + `installed_rank` int(11) NOT NULL, + `version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `description` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `script` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `checksum` int(11) NULL DEFAULT NULL, + `installed_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `installed_on` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, + `execution_time` int(11) NOT NULL, + `success` tinyint(1) NOT NULL, + PRIMARY KEY (`installed_rank`) USING BTREE, + INDEX `flyway_schema_history_s_idx`(`success`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of flyway_schema_history +-- ---------------------------- +INSERT INTO `flyway_schema_history` VALUES (1, '1.0', 'create system', 'SQL', 'V1.0__create_system.sql', -1801642195, 'root', '2021-05-10 11:27:28', 996, 1); + -- ---------------------------- -- Table structure for sys_config -- ---------------------------- DROP TABLE IF EXISTS `sys_config`; CREATE TABLE `sys_config` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数id', - `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数名称', - `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键名', - `config_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键值', - `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '系统内置', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数id', + `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数名称', + `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键名', + `config_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数键值', + `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '系统内置', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数配置表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_config -- ---------------------------- -INSERT INTO `sys_config` VALUES ('1377930337229471746', '测试配置', 'test_config_key', 'userinfo', '0', '1170896100656156674', '2021-04-02 18:26:07.764', '1170896100656156674', '2021-04-03 08:39:08.729', '0', NULL); +INSERT INTO `sys_config` VALUES ('1377930337229471746', '测试配置', 'test_config_key', 'userinfo', '0'); -- ---------------------------- -- Table structure for sys_dept -- ---------------------------- DROP TABLE IF EXISTS `sys_dept`; CREATE TABLE `sys_dept` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', - `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '父部门id', - `ancestors` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', - `dept_sort` decimal(20, 0) NULL DEFAULT 0 COMMENT '显示顺序', - `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', - `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', - `dept_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0、正常;1、停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', + `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '父部门id', + `ancestors` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', + `dept_sort` decimal(20, 0) NULL DEFAULT 0 COMMENT '显示顺序', + `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `dept_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0、正常;1、停用)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_dept -- ---------------------------- -INSERT INTO `sys_dept` VALUES ('1', '0', '0', '总公司', 0, NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1371702174283571201', '3', '0,1,3', '财务部门', 5, NULL, NULL, '0', '1170896100656156674', '2021-03-16 13:57:38', '1170896100656156674', '2021-04-02 18:49:25', '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935436483919873', '2', '0,1,2', '研发部门', 1, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:24', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935480696078337', '2', '0,1,2', '测试部门', 3, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:34', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935517522067457', '2', '0,1,2', '产品部门', 5, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:43', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935562556309505', '2', '0,1,2', '运维部门', 7, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:46:54', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377935601739497474', '2', '0,1,2', '市场部门', 8, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:47:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('1377936163021258753', '3', '0,1,3', '市场部门', 3, NULL, NULL, '0', '1170896100656156674', '2021-04-02 18:49:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('2', '1', '0,1', '深圳总公司', 1, NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_dept` VALUES ('3', '1', '0,1', '长沙分公司', 2, '22323', '11111', '0', NULL, NULL, '1170896100656156674', '2021-03-16 13:57:27', '0', NULL); +INSERT INTO `sys_dept` VALUES ('1', '0', '0', '总公司', 0, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1371702174283571201', '3', '0,1,3', '财务部门', 5, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935436483919873', '2', '0,1,2', '研发部门', 1, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935480696078337', '2', '0,1,2', '测试部门', 3, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935517522067457', '2', '0,1,2', '产品部门', 5, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935562556309505', '2', '0,1,2', '运维部门', 7, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377935601739497474', '2', '0,1,2', '市场部门', 8, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('1377936163021258753', '3', '0,1,3', '市场部门', 3, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('2', '1', '0,1', '深圳总公司', 1, NULL, NULL, '0'); +INSERT INTO `sys_dept` VALUES ('3', '1', '0,1', '长沙分公司', 2, '22323', '11111', '0'); -- ---------------------------- -- Table structure for sys_dict_data -- ---------------------------- DROP TABLE IF EXISTS `sys_dict_data`; CREATE TABLE `sys_dict_data` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典id', - `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', - `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', - `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典键值', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `dict_sort` int(11) NULL DEFAULT 0 COMMENT '字典排序', - `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', - `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', - `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典id', + `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', + `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', + `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典键值', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', + `dict_sort` int(11) NULL DEFAULT 0 COMMENT '字典排序', + `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', + `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', + `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_dict_data -- ---------------------------- -INSERT INTO `sys_dict_data` VALUES ('1372709863595810818', NULL, '男', '1', 'sex', 1, NULL, 'primary', '0', '1170896100656156674', '2021-03-19 08:41:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372709863595810819', NULL, '女', '2', 'sex', 2, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:41:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372709863595810820', NULL, '未知', '3', 'sex', 3, NULL, 'info', '0', '1170896100656156674', '2021-03-19 08:41:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979960', NULL, '正常', '0', 'dict_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979962', NULL, '正常', '0', 'role_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979966', NULL, '正常', '0', 'dept_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979967', NULL, '正常', '0', 'post_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979969', NULL, '正常', '0', 'user_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710732080979980', NULL, '正常', '0', 'res_status', 1, NULL, 'success', '0', '1170896100656156674', '2021-03-19 08:45:17', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986241', NULL, '禁用', '1', 'user_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986242', NULL, '禁用', '1', 'dict_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986243', NULL, '禁用', '1', 'role_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986245', NULL, '禁用', '1', 'dept_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986248', NULL, '禁用', '1', 'post_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372710783326986281', NULL, '禁用', '1', 'res_status', 2, NULL, 'danger', '0', '1170896100656156674', '2021-03-19 08:45:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310657', NULL, '管理员', '0', 'user_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310670', NULL, '模块权限', '0', 'menu_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310673', NULL, '模块', '0', 'module_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711039930310678', NULL, '模块', '0', 'power_type', 1, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:30', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768769', NULL, '普通用户', '1', 'user_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768771', NULL, '菜单权限', '1', 'menu_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768774', NULL, '操作', '1', 'module_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768776', NULL, 'GET', 'GET', 'http_method', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768777', NULL, 'POST', 'POST', 'http_method', 3, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1372711076852768779', NULL, '菜单', '1', 'power_type', 2, NULL, NULL, '0', '1170896100656156674', '2021-03-19 08:46:39', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376409914658590721', NULL, '全部数据权限', '1', 'data_scope', 1, NULL, 'primary', '0', '1170896100656156674', '2021-03-29 13:44:31', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376409951539105794', NULL, '自定数据权限', '2', 'data_scope', 2, NULL, 'success', '0', '1170896100656156674', '2021-03-29 13:44:40', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376409996724342786', NULL, '本部门数据权限', '3', 'data_scope', 3, NULL, 'danger', '0', '1170896100656156674', '2021-03-29 13:44:50', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1376410032313012226', NULL, '本部门及以下数据权限', '4', 'data_scope', 4, NULL, 'error', '0', '1170896100656156674', '2021-03-29 13:44:59', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1378139151967047682', NULL, '是', '0', 'config_type', 0, NULL, 'success', '0', '1170896100656156674', '2021-04-03 08:15:53', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1378139197374582785', NULL, '否', '1', 'config_type', 1, NULL, 'danger', '0', '1170896100656156674', '2021-04-03 08:16:04', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234283315372034', NULL, '立即执行', '1', 'misfire_policy_type', 1, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 08:47:33', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234361887268865', NULL, '执行一次', '2', 'misfire_policy_type', 2, NULL, 'success', '0', '1170896100656156674', '2021-04-06 08:47:51', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234431768567809', NULL, '放弃执行', '3', 'misfire_policy_type', 3, NULL, 'danger', '0', '1170896100656156674', '2021-04-06 08:48:08', '1170896100656156674', '2021-04-06 08:48:15', '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234652439289857', NULL, '允许', '0', 'concurrent_type', 0, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 08:49:01', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234729853558786', NULL, '禁止', '1', 'concurrent_type', 1, NULL, 'error', '0', '1170896100656156674', '2021-04-06 08:49:19', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234884933754882', NULL, '正常', '0', 'job_status', 0, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 08:49:56', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379234956018819074', NULL, '暂停', '1', 'job_status', 1, NULL, 'danger', '0', '1170896100656156674', '2021-04-06 08:50:13', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379240904900845569', NULL, '默认', 'DEFAULT', 'job_group', 1, NULL, 'primary', '0', '1170896100656156674', '2021-04-06 09:13:51', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_data` VALUES ('1379240969895780354', NULL, '系统', 'SYSTEM', 'job_group', 2, NULL, 'info', '0', '1170896100656156674', '2021-04-06 09:14:07', NULL, NULL, '0', NULL); +INSERT INTO `sys_dict_data` VALUES ('1372709863595810818', NULL, '男', '1', 'sex', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372709863595810819', NULL, '女', '2', 'sex', 2, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372709863595810820', NULL, '未知', '3', 'sex', 3, NULL, 'info', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979960', NULL, '正常', '0', 'dict_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979962', NULL, '正常', '0', 'role_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979966', NULL, '正常', '0', 'dept_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979967', NULL, '正常', '0', 'post_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979969', NULL, '正常', '0', 'user_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710732080979980', NULL, '正常', '0', 'res_status', 1, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986241', NULL, '禁用', '1', 'user_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986242', NULL, '禁用', '1', 'dict_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986243', NULL, '禁用', '1', 'role_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986245', NULL, '禁用', '1', 'dept_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986248', NULL, '禁用', '1', 'post_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372710783326986281', NULL, '禁用', '1', 'res_status', 2, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310657', NULL, '管理员', '0', 'user_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310670', NULL, '模块权限', '0', 'menu_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310673', NULL, '模块', '0', 'module_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711039930310678', NULL, '模块', '0', 'power_type', 1, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768769', NULL, '普通用户', '1', 'user_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768771', NULL, '菜单权限', '1', 'menu_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768774', NULL, '操作', '1', 'module_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768776', NULL, 'GET', 'GET', 'http_method', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768777', NULL, 'POST', 'POST', 'http_method', 3, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1372711076852768779', NULL, '菜单', '1', 'power_type', 2, NULL, NULL, '0'); +INSERT INTO `sys_dict_data` VALUES ('1376409914658590721', NULL, '全部数据权限', '1', 'data_scope', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1376409951539105794', NULL, '自定数据权限', '2', 'data_scope', 2, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1376409996724342786', NULL, '本部门数据权限', '3', 'data_scope', 3, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1376410032313012226', NULL, '本部门及以下数据权限', '4', 'data_scope', 4, NULL, 'error', '0'); +INSERT INTO `sys_dict_data` VALUES ('1378139151967047682', NULL, '是', '0', 'config_type', 0, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1378139197374582785', NULL, '否', '1', 'config_type', 1, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234283315372034', NULL, '立即执行', '1', 'misfire_policy_type', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234361887268865', NULL, '执行一次', '2', 'misfire_policy_type', 2, NULL, 'success', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234431768567809', NULL, '放弃执行', '3', 'misfire_policy_type', 3, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234652439289857', NULL, '允许', '0', 'concurrent_type', 0, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234729853558786', NULL, '禁止', '1', 'concurrent_type', 1, NULL, 'error', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234884933754882', NULL, '正常', '0', 'job_status', 0, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379234956018819074', NULL, '暂停', '1', 'job_status', 1, NULL, 'danger', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379240904900845569', NULL, '默认', 'DEFAULT', 'job_group', 1, NULL, 'primary', '0'); +INSERT INTO `sys_dict_data` VALUES ('1379240969895780354', NULL, '系统', 'SYSTEM', 'job_group', 2, NULL, 'info', '0'); -- ---------------------------- -- Table structure for sys_dict_type -- ---------------------------- DROP TABLE IF EXISTS `sys_dict_type`; CREATE TABLE `sys_dict_type` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典主键', - `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', - `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', - `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典主键', + `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', + `dict_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_dict_type -- ---------------------------- -INSERT INTO `sys_dict_type` VALUES ('1372709749485576194', '性别', 'sex', '0', '1170896100656156674', '2021-03-19 08:41:23', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372710292954128385', '用户类型', 'user_type', '0', '1170896100656156674', '2021-03-19 08:43:32', '1170896100656156674', '2021-03-19 08:45:56', '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372710383374934017', '用户状态', 'user_status', '0', '1170896100656156674', '2021-03-19 08:43:54', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372710383374934018', '字典状态', 'dict_status', '0', '1170896100656156674', '2021-03-19 08:43:54', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372714386955558914', '角色状态', 'role_status', '0', '1170896100656156674', '2021-03-19 08:59:48', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372714386955558915', '部门状态', 'dept_status', '0', '1170896100656156674', '2021-03-19 08:59:48', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372714386955558916', '岗位状态', 'post_status', '0', '1170896100656156674', '2021-03-19 08:59:48', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720345916502017', '权限类型', 'menu_type', '0', '1170896100656156674', '2021-03-19 09:23:29', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720409946746881', '模块类型', 'module_type', '0', '1170896100656156674', '2021-03-19 09:23:44', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720457925390338', '请求方式', 'http_method', '0', '1170896100656156674', '2021-03-19 09:23:56', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372720504272449538', '菜单类型', 'power_type', '0', '1170896100656156674', '2021-03-19 09:24:07', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1372742181504978945', '资源状态', 'res_status', '0', '1170896100656156674', '2021-03-19 10:50:15', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1376409832819331073', '数据范围', 'data_scope', '0', '1170896100656156674', '2021-03-29 13:44:11', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1378139043670118402', '参数配置系统内置选项', 'config_type', '0', '1170896100656156674', '2021-04-03 08:15:27', '1170896100656156674', '2021-04-03 08:16:51', '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379234181460893697', '任务计划执行错误策略', 'misfire_policy_type', '0', '1170896100656156674', '2021-04-06 08:47:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379234566711910401', '任务是否并发执行', 'concurrent_type', '0', '1170896100656156674', '2021-04-06 08:48:40', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379234800548552706', '任务状态', 'job_status', '0', '1170896100656156674', '2021-04-06 08:49:36', NULL, NULL, '0', NULL); -INSERT INTO `sys_dict_type` VALUES ('1379240777616302082', '任务分组', 'job_group', '0', '1170896100656156674', '2021-04-06 09:13:21', NULL, NULL, '0', NULL); +INSERT INTO `sys_dict_type` VALUES ('1372709749485576194', '性别', 'sex', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372710292954128385', '用户类型', 'user_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372710383374934017', '用户状态', 'user_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372710383374934018', '字典状态', 'dict_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372714386955558914', '角色状态', 'role_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372714386955558915', '部门状态', 'dept_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372714386955558916', '岗位状态', 'post_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720345916502017', '权限类型', 'menu_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720409946746881', '模块类型', 'module_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720457925390338', '请求方式', 'http_method', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372720504272449538', '菜单类型', 'power_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1372742181504978945', '资源状态', 'res_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1376409832819331073', '数据范围', 'data_scope', '0'); +INSERT INTO `sys_dict_type` VALUES ('1378139043670118402', '参数配置系统内置选项', 'config_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379234181460893697', '任务计划执行错误策略', 'misfire_policy_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379234566711910401', '任务是否并发执行', 'concurrent_type', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379234800548552706', '任务状态', 'job_status', '0'); +INSERT INTO `sys_dict_type` VALUES ('1379240777616302082', '任务分组', 'job_group', '0'); -- ---------------------------- -- Table structure for sys_post -- ---------------------------- DROP TABLE IF EXISTS `sys_post`; CREATE TABLE `sys_post` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位ID', - `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位编码', - `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位名称', - `post_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '显示顺序', - `post_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '岗位状态(0、正常;1、停用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位ID', + `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位编码', + `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '岗位名称', + `post_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '显示顺序', + `post_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '岗位状态(0、正常;1、停用)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '岗位表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_post -- ---------------------------- -INSERT INTO `sys_post` VALUES ('1372012058585690114', 'ceo', '董事长', 1.00, '0', '1170896100656156674', '2021-03-17 10:29:00', '1170896100656156674', '2021-03-17 13:12:30', '0', NULL); -INSERT INTO `sys_post` VALUES ('1372053095446319106', 'xxx', '研发经理', 2.00, '0', '1170896100656156674', '2021-03-17 13:12:04', NULL, NULL, '0', NULL); -INSERT INTO `sys_post` VALUES ('1372053161728905217', 'test', '测试经理', 3.00, '0', '1170896100656156674', '2021-03-17 13:12:20', NULL, NULL, '0', NULL); -INSERT INTO `sys_post` VALUES ('1372053279836311554', 'hr', '人力资源', 4.00, '0', '1170896100656156674', '2021-03-17 13:12:48', NULL, NULL, '0', NULL); +INSERT INTO `sys_post` VALUES ('1372012058585690114', 'ceo', '董事长', 1.00, '0'); +INSERT INTO `sys_post` VALUES ('1372053095446319106', 'xxx', '研发经理', 2.00, '0'); +INSERT INTO `sys_post` VALUES ('1372053161728905217', 'test', '测试经理', 3.00, '0'); +INSERT INTO `sys_post` VALUES ('1372053279836311554', 'hr', '人力资源', 4.00, '0'); -- ---------------------------- -- Table structure for sys_resources -- ---------------------------- DROP TABLE IF EXISTS `sys_resources`; CREATE TABLE `sys_resources` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id', - `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', - `parent_ids` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级ids', - `res_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源名称', - `res_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源code', - `res_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源path', - `http_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请求方式', - `res_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态(0、正常;1、禁用)', - `res_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型(0、模块;1、链接)', - `res_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序', - `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识(0:正常;1:已删除)', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id', + `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级id', + `parent_ids` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级ids', + `res_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源名称', + `res_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源code', + `res_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源path', + `http_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请求方式', + `res_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态(0、正常;1、禁用)', + `res_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型(0、模块;1、链接)', + `res_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '资源表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_resources -- ---------------------------- -INSERT INTO `sys_resources` VALUES ('1173417638056017922', '0', '0', '系统管理', NULL, NULL, NULL, '0', '0', 100.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173417760584220674', '1173417638056017922', '1173416959543459841,1173417638056017922', '用户管理', NULL, NULL, NULL, '0', '0', 10.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173494683788189698', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户添加', 'user:save', '/system-center/system/user/save', 'POST', '0', '1', 2.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:11:59', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173519815223037953', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户修改', 'user:update', '/system-center/system/user/update', 'POST', '0', '1', 5.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:12:03', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173519895434907649', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除', 'user:delete', '/system-center/system/user/delete', 'POST', '0', '1', 7.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:12:26', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173519984786165761', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除(批量)', 'user:batch:delete', '/system-center/system/user/deleteBatch', 'POST', '0', '1', 12.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:13:18', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173520061013446658', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '重置密码', 'user:reset:pass', '/system-center/system/user/resetPassword', 'POST', '0', '1', 13.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173520251158024193', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '授权角色', 'user:auth:role', '/system-center/system/user/saveAuthRole', 'POST', '0', '1', 15.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:14:08', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173521725967654914', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户查询', 'user:list', '/system-center/system/user/page', 'GET', '0', '1', 1.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:11:51', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173786240433037313', '1173417638056017922', '1173416959543459841,1173417638056017922', '角色管理', NULL, NULL, NULL, '0', '0', 20.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173786896229244930', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色查询', 'role:list', '/system-center/system/role/page', 'GET', '0', '1', 3.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:15:56', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787141281456130', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色添加', 'role:save', '/system-center/system/role/save', 'POST', '0', '1', 7.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:33', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787273578192898', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色修改', 'role:update', '/system-center/system/role/update', 'POST', '0', '1', 10.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:38', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787371326447617', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除', 'role:delete', '/system-center/system/role/delete', 'POST', '0', '1', 15.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:44', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787467954823170', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除(批量)', 'role:batch:delete', '/system-center/system/role/deleteBatch', 'POST', '0', '1', 17.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:16:58', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173787686142517250', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '保存授权权限', 'role:auth:resource', '/system-center/system/role/saveAuthResource', 'POST', '0', '1', 25.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173792738055856130', '1173417638056017922', '1173416959543459841,1173417638056017922', '资源管理', NULL, NULL, NULL, '0', '0', 30.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:02:36', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793141136859137', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源添加', 'module:add', '/system-center/system/resources/save', 'POST', '0', '1', 7.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:43', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793218580488194', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源修改', 'module:update', '/system-center/system/resources/update', 'POST', '0', '1', 9.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:48', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793287136387073', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源删除', 'module:delete', '/system-center/system/resources/delete', 'POST', '0', '1', 11.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:53', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1173793449908936705', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源查询', 'module:list', '/system-center/system/resources/getResourceTreeTableList', 'GET', '0', '1', 2.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:17:35', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938290946772993', '1173417638056017922', '1173416959543459841,1173417638056017922', '字典管理', NULL, NULL, NULL, '0', '0', 60.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:04:18', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938414578077698', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典查询', 'dict:list', '/system-center/system/dict/getDictTreeTableList', 'GET', '0', '1', 5.00, NULL, NULL, '1170896100656156674', '2021-04-02 18:24:23', '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938659106000810', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典修改', 'dict:update', '/system-center/system/dict/update', 'POST', '0', '1', 15.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938659106000811', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典删除', 'dict:delete', '/system-center/system/dict/delete', 'POST', '0', '1', 20.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1208938659106000898', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典添加', 'dict:save', '/system-center/system/dict/save', 'POST', '0', '1', 10.00, NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924533432627201', '1173417638056017922', '1173416959543459841,1173417638056017922', '部门管理', NULL, NULL, NULL, '0', '0', 40.00, '1170896100656156674', '2021-04-02 18:03:04', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924655306518530', '1173417638056017922', '1173416959543459841,1173417638056017922', '岗位管理', NULL, NULL, NULL, '0', '0', 50.00, '1170896100656156674', '2021-04-02 18:03:33', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924913415598081', '1173417638056017922', '1173416959543459841,1173417638056017922', '配置管理', NULL, NULL, NULL, '0', '0', 70.00, '1170896100656156674', '2021-04-02 18:04:35', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377924955010510850', '1173417638056017922', '1173416959543459841,1173417638056017922', '日志管理', NULL, NULL, NULL, '0', '0', 80.00, '1170896100656156674', '2021-04-02 18:04:45', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928656441847810', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门查询', 'dept:list', '/system-center/system/dept/getDeptTreeTableList', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:19:27', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928808594419714', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门添加', 'dept:save', '/system-center/system/dept/save', 'POST', '0', '1', 4.00, '1170896100656156674', '2021-04-02 18:20:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928808594419715', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门修改', 'dept:update', '/system-center/system/dept/update', 'POST', '0', '1', 5.00, '1170896100656156674', '2021-04-02 18:20:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377928808594419716', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门删除', 'dept:delete', '/system-center/system/dept/delete', 'POST', '0', '1', 6.00, '1170896100656156674', '2021-04-02 18:20:03', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642690', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位查询', 'post:list', '/system-center/system/post/page', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642691', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位添加', 'post:save', '/system-center/system/post/save', 'GET', '0', '1', 4.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642692', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位修改', 'post:update', '/system-center/system/post/update', 'GET', '0', '1', 6.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642693', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除', 'post:delete', '/system-center/system/post/delete', 'GET', '0', '1', 8.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377929323734642694', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除(批量)', 'post:batch:delete', '/system-center/system/post/deleteBatch', 'GET', '0', '1', 10.00, '1170896100656156674', '2021-04-02 18:22:06', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821505', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置查询', 'config:list', '/system-center/system/config/page', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821506', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置添加', 'config:save', '/system-center/system/config/save', 'POST', '0', '1', 4.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821507', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置修改', 'config:update', '/system-center/system/config/update', 'POST', '0', '1', 5.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821508', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除', 'config:delete', '/system-center/system/config/delete', 'POST', '0', '1', 7.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377930633724821509', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除(批量)', 'config:batch:delete', '/system-center/system/config/deleteBatch', 'POST', '0', '1', 9.00, '1170896100656156674', '2021-04-02 18:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1377931926581280770', '1377924955010510850', '1173416959543459841,1173417638056017922,1377924955010510850', '日志查询', 'log:list', '/system-center/system/log/page', 'GET', '0', '1', 2.00, '1170896100656156674', '2021-04-02 18:32:27', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379319785074839553', '1173417638056017922', '0,1173417638056017922', '任务管理', NULL, NULL, NULL, '0', '0', 90.00, '1170896100656156674', '2021-04-06 14:27:18', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734722', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务查询', 'job:list', '/system-center/monitor/job/page', 'GET', '0', '1', 1.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734723', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务添加', 'job:save', '/system-center/monitor/job/save', 'POST', '0', '1', 3.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734724', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务修改', 'job:update', '/system-center/monitor/job/update', 'POST', '0', '1', 5.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734725', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除', 'job:delete', '/system-center/monitor/job/delete', 'POST', '0', '1', 7.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734726', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除(批量)', 'job:batch:delete', '/system-center/monitor/job/deleteBatch', 'POST', '0', '1', 9.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734727', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '切换状态', 'job:change:status', '/system-center/monitor/job/changeStatus', 'POST', '0', '1', 11.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734728', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '执行一次', 'job:run', '/system-center/monitor/job/run', 'POST', '0', '1', 14.00, '1170896100656156674', '2021-04-06 14:29:08', NULL, NULL, '0', NULL); -INSERT INTO `sys_resources` VALUES ('1379320248616734729', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '调度日志', 'job:task:log', '/system-center/monitor/jobLog/page', 'GET', '0', '1', 16.00, '1170896100656156674', '2021-04-06 14:29:08', '1170896100656156674', '2021-04-06 15:42:19', '0', NULL); +INSERT INTO `sys_resources` VALUES ('1173417638056017922', '0', '0', '系统管理', NULL, NULL, NULL, '0', '0', 100.00); +INSERT INTO `sys_resources` VALUES ('1173417760584220674', '1173417638056017922', '1173416959543459841,1173417638056017922', '用户管理', NULL, NULL, NULL, '0', '0', 10.00); +INSERT INTO `sys_resources` VALUES ('1173494683788189698', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户添加', 'user:save', '/system-center/system/user/save', 'POST', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1173519815223037953', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户修改', 'user:update', '/system-center/system/user/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1173519895434907649', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除', 'user:delete', '/system-center/system/user/delete', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1173519984786165761', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户删除(批量)', 'user:batch:delete', '/system-center/system/user/deleteBatch', 'POST', '0', '1', 12.00); +INSERT INTO `sys_resources` VALUES ('1173520061013446658', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '重置密码', 'user:reset:pass', '/system-center/system/user/resetPassword', 'POST', '0', '1', 13.00); +INSERT INTO `sys_resources` VALUES ('1173520251158024193', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '授权角色', 'user:auth:role', '/system-center/system/user/saveAuthRole', 'POST', '0', '1', 15.00); +INSERT INTO `sys_resources` VALUES ('1173521725967654914', '1173417760584220674', '1173416959543459841,1173417638056017922,1173417760584220674', '用户查询', 'user:list', '/system-center/system/user/page', 'GET', '0', '1', 1.00); +INSERT INTO `sys_resources` VALUES ('1173786240433037313', '1173417638056017922', '1173416959543459841,1173417638056017922', '角色管理', NULL, NULL, NULL, '0', '0', 20.00); +INSERT INTO `sys_resources` VALUES ('1173786896229244930', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色查询', 'role:list', '/system-center/system/role/page', 'GET', '0', '1', 3.00); +INSERT INTO `sys_resources` VALUES ('1173787141281456130', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色添加', 'role:save', '/system-center/system/role/save', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1173787273578192898', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色修改', 'role:update', '/system-center/system/role/update', 'POST', '0', '1', 10.00); +INSERT INTO `sys_resources` VALUES ('1173787371326447617', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除', 'role:delete', '/system-center/system/role/delete', 'POST', '0', '1', 15.00); +INSERT INTO `sys_resources` VALUES ('1173787467954823170', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '角色删除(批量)', 'role:batch:delete', '/system-center/system/role/deleteBatch', 'POST', '0', '1', 17.00); +INSERT INTO `sys_resources` VALUES ('1173787686142517250', '1173786240433037313', '1173416959543459841,1173417638056017922,1173786240433037313', '保存授权权限', 'role:auth:resource', '/system-center/system/role/saveAuthResource', 'POST', '0', '1', 25.00); +INSERT INTO `sys_resources` VALUES ('1173792738055856130', '1173417638056017922', '1173416959543459841,1173417638056017922', '资源管理', NULL, NULL, NULL, '0', '0', 30.00); +INSERT INTO `sys_resources` VALUES ('1173793141136859137', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源添加', 'module:add', '/system-center/system/resources/save', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1173793218580488194', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源修改', 'module:update', '/system-center/system/resources/update', 'POST', '0', '1', 9.00); +INSERT INTO `sys_resources` VALUES ('1173793287136387073', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源删除', 'module:delete', '/system-center/system/resources/delete', 'POST', '0', '1', 11.00); +INSERT INTO `sys_resources` VALUES ('1173793449908936705', '1173792738055856130', '1173416959543459841,1173417638056017922,1173792738055856130', '资源查询', 'module:list', '/system-center/system/resources/getResourceTreeTableList', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1208938290946772993', '1173417638056017922', '1173416959543459841,1173417638056017922', '字典管理', NULL, NULL, NULL, '0', '0', 60.00); +INSERT INTO `sys_resources` VALUES ('1208938414578077698', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典查询', 'dict:list', '/system-center/system/dict/getDictTreeTableList', 'GET', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1208938659106000810', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典修改', 'dict:update', '/system-center/system/dict/update', 'POST', '0', '1', 15.00); +INSERT INTO `sys_resources` VALUES ('1208938659106000811', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典删除', 'dict:delete', '/system-center/system/dict/delete', 'POST', '0', '1', 20.00); +INSERT INTO `sys_resources` VALUES ('1208938659106000898', '1208938290946772993', '1173416959543459841,1173417638056017922,1208938290946772993', '字典添加', 'dict:save', '/system-center/system/dict/save', 'POST', '0', '1', 10.00); +INSERT INTO `sys_resources` VALUES ('1377924533432627201', '1173417638056017922', '1173416959543459841,1173417638056017922', '部门管理', NULL, NULL, NULL, '0', '0', 40.00); +INSERT INTO `sys_resources` VALUES ('1377924655306518530', '1173417638056017922', '1173416959543459841,1173417638056017922', '岗位管理', NULL, NULL, NULL, '0', '0', 50.00); +INSERT INTO `sys_resources` VALUES ('1377924913415598081', '1173417638056017922', '1173416959543459841,1173417638056017922', '配置管理', NULL, NULL, NULL, '0', '0', 70.00); +INSERT INTO `sys_resources` VALUES ('1377924955010510850', '1173417638056017922', '1173416959543459841,1173417638056017922', '日志管理', NULL, NULL, NULL, '0', '0', 80.00); +INSERT INTO `sys_resources` VALUES ('1377928656441847810', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门查询', 'dept:list', '/system-center/system/dept/getDeptTreeTableList', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1377928808594419714', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门添加', 'dept:save', '/system-center/system/dept/save', 'POST', '0', '1', 4.00); +INSERT INTO `sys_resources` VALUES ('1377928808594419715', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门修改', 'dept:update', '/system-center/system/dept/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1377928808594419716', '1377924533432627201', '1173416959543459841,1173417638056017922,1377924533432627201', '部门删除', 'dept:delete', '/system-center/system/dept/delete', 'POST', '0', '1', 6.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642690', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位查询', 'post:list', '/system-center/system/post/page', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642691', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位添加', 'post:save', '/system-center/system/post/save', 'GET', '0', '1', 4.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642692', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位修改', 'post:update', '/system-center/system/post/update', 'GET', '0', '1', 6.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642693', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除', 'post:delete', '/system-center/system/post/delete', 'GET', '0', '1', 8.00); +INSERT INTO `sys_resources` VALUES ('1377929323734642694', '1377924655306518530', '1173416959543459841,1173417638056017922,1377924655306518530', '岗位删除(批量)', 'post:batch:delete', '/system-center/system/post/deleteBatch', 'GET', '0', '1', 10.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821505', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置查询', 'config:list', '/system-center/system/config/page', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821506', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置添加', 'config:save', '/system-center/system/config/save', 'POST', '0', '1', 4.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821507', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置修改', 'config:update', '/system-center/system/config/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821508', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除', 'config:delete', '/system-center/system/config/delete', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1377930633724821509', '1377924913415598081', '1173416959543459841,1173417638056017922,1377924913415598081', '配置删除(批量)', 'config:batch:delete', '/system-center/system/config/deleteBatch', 'POST', '0', '1', 9.00); +INSERT INTO `sys_resources` VALUES ('1377931926581280770', '1377924955010510850', '1173416959543459841,1173417638056017922,1377924955010510850', '日志查询', 'log:list', '/system-center/system/log/page', 'GET', '0', '1', 2.00); +INSERT INTO `sys_resources` VALUES ('1379319785074839553', '1173417638056017922', '0,1173417638056017922', '任务管理', NULL, NULL, NULL, '0', '0', 90.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734722', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务查询', 'job:list', '/system-center/monitor/job/page', 'GET', '0', '1', 1.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734723', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务添加', 'job:save', '/system-center/monitor/job/save', 'POST', '0', '1', 3.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734724', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务修改', 'job:update', '/system-center/monitor/job/update', 'POST', '0', '1', 5.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734725', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除', 'job:delete', '/system-center/monitor/job/delete', 'POST', '0', '1', 7.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734726', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '任务删除(批量)', 'job:batch:delete', '/system-center/monitor/job/deleteBatch', 'POST', '0', '1', 9.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734727', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '切换状态', 'job:change:status', '/system-center/monitor/job/changeStatus', 'POST', '0', '1', 11.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734728', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '执行一次', 'job:run', '/system-center/monitor/job/run', 'POST', '0', '1', 14.00); +INSERT INTO `sys_resources` VALUES ('1379320248616734729', '1379319785074839553', '0,1173417638056017922,1379319785074839553', '调度日志', 'job:task:log', '/system-center/monitor/jobLog/page', 'GET', '0', '1', 16.00); -- ---------------------------- -- Table structure for sys_role -- ---------------------------- DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - `role_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', - `role_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色权限字符串', - `role_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色状态(0、正常;1、禁用)', - `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围(1、全部数据权限;2、自定数据权限;3、本部门数据权限;4、本部门及以下数据权限)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + `role_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称', + `role_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色权限字符串', + `role_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色状态(0、正常;1、禁用)', + `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围(1、全部数据权限;2、自定数据权限;3、本部门数据权限;4、本部门及以下数据权限)', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of sys_role -- ---------------------------- -INSERT INTO `sys_role` VALUES ('1171709223680184321', '管理员', 'ROLE_ADMIN', '0', '1', NULL, NULL, '1170896100656156674', '2021-03-29 16:36:53', '0', '备注'); -INSERT INTO `sys_role` VALUES ('1171953892250918913', '开发组长', 'ROLE_DEVELOP', '0', '4', NULL, NULL, '1170896100656156674', '2021-03-31 08:02:34', '0', NULL); -INSERT INTO `sys_role` VALUES ('1171953965877731330', '测试组长', 'ROLE_TEST', '0', '4', NULL, NULL, '1170896100656156674', '2021-03-29 15:40:37', '0', NULL); -INSERT INTO `sys_role` VALUES ('1171954063797952514', '项目经理', 'ROLE_MANAGE', '1', '1', NULL, NULL, NULL, NULL, '0', NULL); -INSERT INTO `sys_role` VALUES ('1339373635128303617', 'test2', 'ROLE_AAD', '1', '2', NULL, NULL, '1170896100656156674', '2021-03-29 14:35:16', '0', NULL); +INSERT INTO `sys_role` VALUES ('1171709223680184321', '管理员', 'ROLE_ADMIN', '0', '1'); +INSERT INTO `sys_role` VALUES ('1171953892250918913', '开发组长', 'ROLE_DEVELOP', '0', '4'); +INSERT INTO `sys_role` VALUES ('1171953965877731330', '测试组长', 'ROLE_TEST', '0', '4'); +INSERT INTO `sys_role` VALUES ('1171954063797952514', '项目经理', 'ROLE_MANAGE', '1', '1'); +INSERT INTO `sys_role` VALUES ('1339373635128303617', 'test2', 'ROLE_AAD', '1', '2'); -- ---------------------------- -- Table structure for sys_role_dept -- ---------------------------- DROP TABLE IF EXISTS `sys_role_dept`; CREATE TABLE `sys_role_dept` ( - `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', - PRIMARY KEY (`role_id`, `dept_id`) USING BTREE + `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门id', + PRIMARY KEY (`role_id`, `dept_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- @@ -342,9 +324,9 @@ INSERT INTO `sys_role_dept` VALUES ('1339373635128303617', '2'); -- ---------------------------- DROP TABLE IF EXISTS `sys_role_res`; CREATE TABLE `sys_role_res` ( - `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - `res_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '资源id', - PRIMARY KEY (`role_id`, `res_id`) USING BTREE + `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + `res_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '资源id', + PRIMARY KEY (`role_id`, `res_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和资源关联表' ROW_FORMAT = Dynamic; -- ---------------------------- @@ -418,24 +400,24 @@ INSERT INTO `sys_role_res` VALUES ('1171953892250918913', '1173521725967654914') -- ---------------------------- DROP TABLE IF EXISTS `sys_user_info`; CREATE TABLE `sys_user_info` ( - `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', - `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门id', - `username` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名', - `password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', - `nick_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称', - `user_type` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '用户类型(0、管理员;1、普通用户)', - `email` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户邮箱', - `phone_number` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码', - `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别(0、男;1、女)', - `avatar_path` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', - `user_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0、正常;1、禁用)', - `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', - `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', - `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', - `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', - PRIMARY KEY (`id`) USING BTREE + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', + `dept_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门id', + `username` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名', + `password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', + `nick_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称', + `user_type` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '用户类型(0、管理员;1、普通用户)', + `email` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户邮箱', + `phone_number` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别(0、男;1、女)', + `avatar_path` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', + `user_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0、正常;1、禁用)', + `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', + `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', + `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标识', + `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic; -- ---------------------------- @@ -451,9 +433,9 @@ INSERT INTO `sys_user_info` VALUES ('1339368705646702593', '3', '12345676', '{bc -- ---------------------------- DROP TABLE IF EXISTS `sys_user_post`; CREATE TABLE `sys_user_post` ( - `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', - `post_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位id', - PRIMARY KEY (`user_id`, `post_id`) USING BTREE + `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', + `post_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位id', + PRIMARY KEY (`user_id`, `post_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户与岗位关联表' ROW_FORMAT = Dynamic; -- ---------------------------- @@ -470,9 +452,9 @@ INSERT INTO `sys_user_post` VALUES ('1339368705646702593', '1372012058585690114' -- ---------------------------- DROP TABLE IF EXISTS `sys_user_role`; CREATE TABLE `sys_user_role` ( - `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', - `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', - PRIMARY KEY (`user_id`, `role_id`) USING BTREE + `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id', + `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色id', + PRIMARY KEY (`user_id`, `role_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户角色关联表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Gitee