feat: 更改配置文件

This commit is contained in:
bunny 2024-10-24 16:58:48 +08:00
parent e124bcdadc
commit e5c71400ad
6 changed files with 16 additions and 11 deletions

View File

@ -484,14 +484,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
// 根据用户Id列表查询用户角色
List<Role> list = roleMapper.selectListByUserIds(ids);
List<Role> roleList = list.stream().filter(role -> !role.getRoleCode().equals("admin") || ids.contains(1L)).toList();
if (roleList.isEmpty()) throw new BunnyException(ResultCodeEnum.ADMIN_ROLE_CAN_NOT_DELETED);
// 如果有管理员不删除
ids.remove(1L);
List<Role> roleList = list.stream().filter(role -> role.getRoleCode().equals("admin") || ids.contains(1L)).toList();
if (!roleList.isEmpty()) throw new BunnyException(ResultCodeEnum.ADMIN_ROLE_CAN_NOT_DELETED);
// 逻辑删除
baseMapper.deleteBatchIds(ids);
removeBatchByIds(ids);
// 物理删除用户
// baseMapper.deleteBatchIdsWithPhysics(ids);

View File

@ -17,6 +17,11 @@ mybatis-plus:
global-config:
db-config:
logic-delete-field: isDeleted
logic-delete-value: 1 # 逻辑已删除值
logic-not-delete-value: 0 # 逻辑未删除值
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 查看日志
bunny:
master:

View File

@ -6,6 +6,9 @@ mybatis-plus:
global-config:
db-config:
logic-delete-field: isDeleted
configuration:
map-underscore-to-camel-case: true
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 查看日志
logging:
level:

View File

@ -6,6 +6,8 @@ mybatis-plus:
global-config:
db-config:
logic-delete-field: isDeleted
configuration:
map-underscore-to-camel-case: true
logging:
level:
@ -23,9 +25,6 @@ knife4j:
enable: true
production: true
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 查看日志
# rabbitmq:
# host: ${bunny.rabbitmq.host}
# port: ${bunny.rabbitmq.port}

View File

@ -70,7 +70,6 @@ spring:
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8

View File

@ -53,8 +53,10 @@
sys_user_role ur
WHERE u.id = ur.user_id
AND r.id = ur.role_id
AND r.id = #{userId}
AND ur.user_id = #{userId}
</select>
<!-- 根据用户Id列表查询用户角色 -->
<select id="selectListByUserIds" resultType="cn.bunny.dao.entity.system.Role">
SELECT r.*
FROM sys_role r,