refactor: 优化系统业务模块注释规范
- 移除CaptchaController和SysMenuServiceImpl的行尾注释 - 改为独立行注释格式 - 提升代码可读性和维护性
This commit is contained in:
parent
324266396d
commit
a7e9e0cf1d
@ -95,10 +95,13 @@ public class CaptchaController {
|
|||||||
// public Map<String, Object> arithmeticCaptcha() {
|
// public Map<String, Object> arithmeticCaptcha() {
|
||||||
// // 算术类型
|
// // 算术类型
|
||||||
// ArithmeticCaptcha arithmeticCaptcha = new ArithmeticCaptcha(100, 30);
|
// ArithmeticCaptcha arithmeticCaptcha = new ArithmeticCaptcha(100, 30);
|
||||||
// arithmeticCaptcha.setLen(3); // 几位数运算,默认是两位
|
// 几位数运算,默认是两位
|
||||||
// arithmeticCaptcha.getArithmeticString(); // 获取运算的公式:4-9+1=?
|
// arithmeticCaptcha.setLen(3);
|
||||||
|
// 获取运算的公式:4-9+1=?
|
||||||
|
// arithmeticCaptcha.getArithmeticString();
|
||||||
// // 获取验证码
|
// // 获取验证码
|
||||||
// String securityCode = arithmeticCaptcha.text();// 获取运算的结果:-4
|
// 获取运算的结果:-4
|
||||||
|
// String securityCode = arithmeticCaptcha.text();
|
||||||
// // 存放Redis验证码的key
|
// // 存放Redis验证码的key
|
||||||
// String codeKey = UUID.randomUUID().toString();
|
// String codeKey = UUID.randomUUID().toString();
|
||||||
// log.info("算术验证码Key:{},算术验证码:{}", codeKey, securityCode);
|
// log.info("算术验证码Key:{},算术验证码:{}", codeKey, securityCode);
|
||||||
|
|||||||
@ -57,7 +57,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
SysLoginUser loginUser = sysLoginUserMapper.selectById(CoderLoginUtil.getUserId());
|
SysLoginUser loginUser = sysLoginUserMapper.selectById(CoderLoginUtil.getUserId());
|
||||||
YUtil.isTrue(ObjectUtils.isEmpty(loginUser), "请先进行登录");
|
YUtil.isTrue(ObjectUtils.isEmpty(loginUser), "请先进行登录");
|
||||||
// 2、查询菜单数据
|
// 2、查询菜单数据
|
||||||
if (loginUser != null && CoderLoginUtil.getIsCoderAdmin()) { // 超级管理员,全部菜单权限
|
// 超级管理员,全部菜单权限
|
||||||
|
if (loginUser != null && CoderLoginUtil.getIsCoderAdmin()) {
|
||||||
List<SysMenuBo> sysMenuBos = sysMenuMapper.listMenuAdmin();
|
List<SysMenuBo> sysMenuBos = sysMenuMapper.listMenuAdmin();
|
||||||
YUtil.isTrue(CollectionUtil.isEmpty(sysMenuBos), "菜单权限全部被删除,禁止登录");
|
YUtil.isTrue(CollectionUtil.isEmpty(sysMenuBos), "菜单权限全部被删除,禁止登录");
|
||||||
List<SysMenuBo> menuList = sysMenuBos.parallelStream().filter(x -> {
|
List<SysMenuBo> menuList = sysMenuBos.parallelStream().filter(x -> {
|
||||||
@ -141,7 +142,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
public void saveRoleMenu(Long roleId, List<Long> menuIds) {
|
public void saveRoleMenu(Long roleId, List<Long> menuIds) {
|
||||||
// 1、删除该角色拥有的权限
|
// 1、删除该角色拥有的权限
|
||||||
sysMenuMapper.deleteMenuIdsByRoleId(roleId);
|
sysMenuMapper.deleteMenuIdsByRoleId(roleId);
|
||||||
if (menuIds.get(0) != -1) { // 取消当前角色所有权限,传递-1不进行保存操作
|
// 取消当前角色所有权限,传递-1不进行保存操作
|
||||||
|
if (menuIds.get(0) != -1) {
|
||||||
// 2、保存菜单权限
|
// 2、保存菜单权限
|
||||||
YUtil.isTrue(!sysMenuMapper.saveRoleMenu(roleId, menuIds), "分配失败,请重试");
|
YUtil.isTrue(!sysMenuMapper.saveRoleMenu(roleId, menuIds), "分配失败,请重试");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user