|
@@ -23,6 +23,7 @@ import cn.com.qmth.examcloud.commons.web.helpers.tree.EleTreeNode;
|
|
|
import cn.com.qmth.examcloud.commons.web.helpers.tree.TreeUtil;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.controller.bean.PrivilegeGroupBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.controller.bean.UpdateRolePrivilegeRelationsReq;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.AppRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.PrivilegeGroupRepo;
|
|
@@ -32,6 +33,7 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.App;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.Privilege;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.PrivilegeGroup;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.RolePrivilegeRelation;
|
|
|
+import cn.com.qmth.examcloud.core.basic.service.RolePrivilegeService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
/**
|
|
@@ -60,6 +62,9 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
RolePrivilegeRelationRepo rolePrivilegeRelationRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ RolePrivilegeService rolePrivilegeService;
|
|
|
+
|
|
|
@ApiOperation(value = "查询权限组")
|
|
|
@GetMapping("getPrivilegeGroupList")
|
|
|
public List<PrivilegeGroupBean> getPrivilegeGroupList() {
|
|
@@ -110,6 +115,15 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
|
return pIdSet;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "更新角色权限关联")
|
|
|
+ @PostMapping("updateRolePrivilegeRelations")
|
|
|
+ public void updateRolePrivilegeRelations(@RequestBody UpdateRolePrivilegeRelationsReq req) {
|
|
|
+ Long rootOrgId = Long.parseLong(req.getRootOrgId());
|
|
|
+ Long roleId = Long.parseLong(req.getRoleId());
|
|
|
+ Set<Long> privilegeIdSet = req.getPrivilegeIdSet();
|
|
|
+ rolePrivilegeService.updateRolePrivilegeRelations(rootOrgId, roleId, privilegeIdSet);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "增加权限")
|
|
|
@PostMapping("addPrivilege")
|
|
|
public Privilege addPrivilege(@RequestBody Privilege privilege) {
|