8 changed files with 232 additions and 121 deletions
@ -0,0 +1,72 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller.v2; |
|||
|
|||
import com.elink.esua.epdc.commons.api.version.ApiVersion; |
|||
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.SysRoleDTO; |
|||
import com.elink.esua.epdc.enums.AppMenuCategoryEnum; |
|||
import com.elink.esua.epdc.service.*; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 角色管理 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@ApiVersion(2) |
|||
@RestController |
|||
@RequestMapping("role" + Constant.VERSION_CONTROL) |
|||
public class SysRoleV2Controller { |
|||
@Autowired |
|||
private SysRoleService sysRoleService; |
|||
@Autowired |
|||
private SysRoleMenuService sysRoleMenuService; |
|||
@Autowired |
|||
private SysRoleDataScopeService sysRoleDataScopeService; |
|||
@Autowired |
|||
private AppRoleMenuService appRoleMenuService; |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<SysRoleDTO> get(@PathVariable("id") Long id) { |
|||
SysRoleDTO data = sysRoleService.get(id); |
|||
|
|||
//查询角色对应的菜单
|
|||
List<Long> menuIdList = sysRoleMenuService.getMenuIdList(id); |
|||
data.setMenuIdList(menuIdList); |
|||
|
|||
//查询角色对应的数据权限
|
|||
List<Long> deptIdList = sysRoleDataScopeService.getDeptIdList(id); |
|||
data.setDeptIdList(deptIdList); |
|||
|
|||
//查询角色对应app菜单权限
|
|||
List<Long> appMenuIdList = appRoleMenuService.getAppMenuIdListV2(id, AppMenuCategoryEnum.WORK.getValue()); |
|||
data.setAppMenuIdList(appMenuIdList); |
|||
//查询角色对应数据端菜单权限
|
|||
List<Long> analysisMenuIdList = appRoleMenuService.getAppMenuIdListV2(id, AppMenuCategoryEnum.ANALYSIS.getValue()); |
|||
data.setAnalysisMenuIdList(analysisMenuIdList); |
|||
|
|||
//查询角色对应的项目处理类型权限
|
|||
List<String> categoryIdList = sysRoleService.getCategoryIdList(id); |
|||
data.setCategoryIdList(categoryIdList); |
|||
|
|||
//查询角色对应的吹哨部门
|
|||
List<Long> whistleDeptIdList = sysRoleService.getWhistleDeptIdList(id); |
|||
data.setWhistleDeptIdList(whistleDeptIdList); |
|||
|
|||
return new Result<SysRoleDTO>().ok(data); |
|||
} |
|||
|
|||
|
|||
} |
|||
Loading…
Reference in new issue