Pārlūkot izejas kodu

refactor(gateway):优化菜单查询逻辑并添加注释

- 调整导入顺序,移除重复导入
-为菜单查询方法添加TODO注释,明确功能用途- 明确角色菜单查询逻辑,区分角色权限与用户权限
- 保留原有菜单查询核心逻辑不变
hxd 2 dienas atpakaļ
vecāks
revīzija
3d430ff570

+ 6 - 3
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/WebGatewayImpl.java

@@ -33,11 +33,10 @@ import com.hfln.portal.domain.gateway.WebGateway;
 import com.hfln.portal.domain.gateway.sms.SmsGateway;
 import com.hfln.portal.infrastructure.config.UserAuthService;
 import com.hfln.portal.infrastructure.config.UserContext;
-import com.hfln.portal.infrastructure.po.*;
-import com.hfln.portal.infrastructure.service.*;
 import com.hfln.portal.infrastructure.oss.OssClient;
 import com.hfln.portal.infrastructure.oss.OssUtils;
-import com.hfln.portal.infrastructure.po.TblOssFile;
+import com.hfln.portal.infrastructure.po.*;
+import com.hfln.portal.infrastructure.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -630,6 +629,8 @@ public class WebGatewayImpl implements WebGateway {
 
     @Override
     public List<MenuListDTO> queryMenuList(Integer disabledFlag) {
+        //TODO 不传任何参数,直接查询所有菜单,列表形式回显给前端,这个功能只有我们运维人员用
+
         // 查询所有未删除的菜单
         List<TblSystemMenu> allMenus = tblSystemMenuService.lambdaQuery()
                 .eq(TblSystemMenu::getIsDeleted, BasePO.DeleteFlag.NOT_DELETED)
@@ -679,10 +680,12 @@ public class WebGatewayImpl implements WebGateway {
         res.setRoleId(roleId);
 
         // 查询角色已选菜单ID
+        //TODO   查询前端传的roleId,显示这个角色所勾选的菜单
         List<Long> selectedMenuId = tblRoleMenuMapService.queryMenuIdByRoleId(roleId);
         res.setSelectedMenuId(selectedMenuId);
 
         // 查询所有菜单
+        //TODO   查询redis中当前用户的roleId,显示为机构超管的所有菜单
         List<TblSystemMenu> allMenus = tblSystemMenuService.lambdaQuery()
                 .eq(TblSystemMenu::getIsDeleted, BasePO.DeleteFlag.NOT_DELETED)
                 .list();