修改 菜单管理接口修改
This commit is contained in:
parent
adc270d0ef
commit
c503229c26
@ -31,5 +31,9 @@ public class SystemController {
|
|||||||
public ResponseEntity getMenu() {
|
public ResponseEntity getMenu() {
|
||||||
return ResponseEntity.ok(systemService.getMenu());
|
return ResponseEntity.ok(systemService.getMenu());
|
||||||
}
|
}
|
||||||
|
@GetMapping("/menu-all")
|
||||||
|
public ResponseEntity getMenuAll() {
|
||||||
|
return ResponseEntity.ok(systemService.getMenuAll());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,6 @@ public interface SystemMapper {
|
|||||||
List<SystemMenu> getAllMenus();
|
List<SystemMenu> getAllMenus();
|
||||||
@Select("SELECT * from menu_data_item where id in (select system_role_menu.menu_id from system_role_menu where role_id=#{roleId})")
|
@Select("SELECT * from menu_data_item where id in (select system_role_menu.menu_id from system_role_menu where role_id=#{roleId})")
|
||||||
List<MenuDataItem> getMenus(String roleId);
|
List<MenuDataItem> getMenus(String roleId);
|
||||||
|
@Select("SELECT * from menu_data_item")
|
||||||
|
List<MenuDataItem> getMenusAll();
|
||||||
}
|
}
|
||||||
|
@ -4,4 +4,6 @@ import com.guaiguailang.harmony.domain.vo.ResponseResult;
|
|||||||
|
|
||||||
public interface SystemService {
|
public interface SystemService {
|
||||||
ResponseResult getMenu();
|
ResponseResult getMenu();
|
||||||
|
|
||||||
|
ResponseResult getMenuAll();
|
||||||
}
|
}
|
||||||
|
@ -31,10 +31,17 @@ public class SystemServiceImpl implements SystemService {
|
|||||||
public ResponseResult getMenu() {
|
public ResponseResult getMenu() {
|
||||||
// 获取用户角色
|
// 获取用户角色
|
||||||
Long uid = Long.parseLong(StpUtil.getLoginId().toString());
|
Long uid = Long.parseLong(StpUtil.getLoginId().toString());
|
||||||
|
log.info("获得用户id:"+uid);
|
||||||
UserInfo userInfo = userMapper.getUserById(uid);
|
UserInfo userInfo = userMapper.getUserById(uid);
|
||||||
|
log.info("获得用户权限:"+userInfo.getRoleId());
|
||||||
// 获取所有激活的状态菜单
|
// 获取所有激活的状态菜单
|
||||||
List<MenuDataItem> menus = systemMapper.getMenus(userInfo.getRoleId());
|
List<MenuDataItem> menus = systemMapper.getMenus(userInfo.getRoleId());
|
||||||
|
return ResponseResult.success(menus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult getMenuAll() {
|
||||||
|
List<MenuDataItem> menus = systemMapper.getMenusAll();
|
||||||
return ResponseResult.success(menus);
|
return ResponseResult.success(menus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user