refactor(gateway): 优化代码中的字段名称和查询逻辑

- 将 AdminNoticeVo 中的 userCount 字段注释从"接受用户数"修改为"接收用户数"
- 修复 MenuServiceImpl 中上级菜单查询逻辑的错误,将条件从菜单 ID 修改为菜单 PID
This commit is contained in:
zhuangtianxiang 2025-01-16 21:36:21 +08:00
parent 1f6d9310b3
commit 8f5c5d1726
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ public class AdminNoticeVo {
*/ */
private Long id; private Long id;
/** /**
* 用户数 * 用户数
*/ */
private Long userCount; private Long userCount;
/** /**

View File

@ -48,7 +48,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuRepository, Menu> implement
if (baseMapper.exists(new LambdaQueryWrapper<Menu>().eq(Menu::getPermissions, dto.getPermissions()))) { if (baseMapper.exists(new LambdaQueryWrapper<Menu>().eq(Menu::getPermissions, dto.getPermissions()))) {
throw new ConstraintException("该权限已存在!请检查输入表单是否出错!"); throw new ConstraintException("该权限已存在!请检查输入表单是否出错!");
} }
if (baseMapper.selectOne(new LambdaQueryWrapper<Menu>().eq(Menu::getPid, dto.getPid())) == null && dto.getPid() != null) { if (baseMapper.selectOne(new LambdaQueryWrapper<Menu>().eq(Menu::getId, dto.getPid())) == null && dto.getPid() != null) {
throw new ConstraintException("上级菜单不存在!请检查输入表单是否出错!"); throw new ConstraintException("上级菜单不存在!请检查输入表单是否出错!");
} }
Menu menu = mapper.toEntity(dto); Menu menu = mapper.toEntity(dto);