【代码修复】SYSTEM:角色标识的提示不正确问题
parent
e893caf3ad
commit
d39681e98c
|
@ -18,8 +18,6 @@ public interface DictTypeConstants {
|
||||||
String LOGIN_TYPE = "system_login_type"; // 登录日志的类型
|
String LOGIN_TYPE = "system_login_type"; // 登录日志的类型
|
||||||
String LOGIN_RESULT = "system_login_result"; // 登录结果
|
String LOGIN_RESULT = "system_login_result"; // 登录结果
|
||||||
|
|
||||||
String ERROR_CODE_TYPE = "system_error_code_type"; // 错误码的类型枚举
|
|
||||||
|
|
||||||
String SMS_CHANNEL_CODE = "system_sms_channel_code"; // 短信渠道编码
|
String SMS_CHANNEL_CODE = "system_sms_channel_code"; // 短信渠道编码
|
||||||
String SMS_TEMPLATE_TYPE = "system_sms_template_type"; // 短信模板类型
|
String SMS_TEMPLATE_TYPE = "system_sms_template_type"; // 短信模板类型
|
||||||
String SMS_SEND_STATUS = "system_sms_send_status"; // 短信发送状态
|
String SMS_SEND_STATUS = "system_sms_send_status"; // 短信发送状态
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.permission;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
@ -61,7 +62,7 @@ public class RoleServiceImpl implements RoleService {
|
||||||
// 2. 插入到数据库
|
// 2. 插入到数据库
|
||||||
RoleDO role = BeanUtils.toBean(createReqVO, RoleDO.class)
|
RoleDO role = BeanUtils.toBean(createReqVO, RoleDO.class)
|
||||||
.setType(ObjectUtil.defaultIfNull(type, RoleTypeEnum.CUSTOM.getType()))
|
.setType(ObjectUtil.defaultIfNull(type, RoleTypeEnum.CUSTOM.getType()))
|
||||||
.setStatus(CommonStatusEnum.ENABLE.getStatus())
|
.setStatus(ObjUtil.defaultIfNull(createReqVO.getStatus(), CommonStatusEnum.ENABLE.getStatus()))
|
||||||
.setDataScope(DataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限
|
.setDataScope(DataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限
|
||||||
roleMapper.insert(role);
|
roleMapper.insert(role);
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,8 @@ public class RoleServiceImplTest extends BaseDbUnitTest {
|
||||||
public void testCreateRole() {
|
public void testCreateRole() {
|
||||||
// 准备参数
|
// 准备参数
|
||||||
RoleSaveReqVO reqVO = randomPojo(RoleSaveReqVO.class)
|
RoleSaveReqVO reqVO = randomPojo(RoleSaveReqVO.class)
|
||||||
.setId(null); // 防止 id 被赋值
|
.setId(null) // 防止 id 被赋值
|
||||||
|
.setStatus(randomCommonStatus());
|
||||||
|
|
||||||
// 调用
|
// 调用
|
||||||
Long roleId = roleService.createRole(reqVO, null);
|
Long roleId = roleService.createRole(reqVO, null);
|
||||||
|
@ -59,7 +60,6 @@ public class RoleServiceImplTest extends BaseDbUnitTest {
|
||||||
RoleDO roleDO = roleMapper.selectById(roleId);
|
RoleDO roleDO = roleMapper.selectById(roleId);
|
||||||
assertPojoEquals(reqVO, roleDO, "id");
|
assertPojoEquals(reqVO, roleDO, "id");
|
||||||
assertEquals(RoleTypeEnum.CUSTOM.getType(), roleDO.getType());
|
assertEquals(RoleTypeEnum.CUSTOM.getType(), roleDO.getType());
|
||||||
assertEquals(CommonStatusEnum.ENABLE.getStatus(), roleDO.getStatus());
|
|
||||||
assertEquals(DataScopeEnum.ALL.getScope(), roleDO.getDataScope());
|
assertEquals(DataScopeEnum.ALL.getScope(), roleDO.getDataScope());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ public class RoleServiceImplTest extends BaseDbUnitTest {
|
||||||
roleMapper.insert(roleDO);
|
roleMapper.insert(roleDO);
|
||||||
// 准备参数
|
// 准备参数
|
||||||
Long id = roleDO.getId();
|
Long id = roleDO.getId();
|
||||||
RoleSaveReqVO reqVO = randomPojo(RoleSaveReqVO.class, o -> o.setId(id));
|
RoleSaveReqVO reqVO = randomPojo(RoleSaveReqVO.class, o -> o.setId(id)
|
||||||
|
.setStatus(randomCommonStatus()));
|
||||||
|
|
||||||
// 调用
|
// 调用
|
||||||
roleService.updateRole(reqVO);
|
roleService.updateRole(reqVO);
|
||||||
|
|
Loading…
Reference in New Issue