From fb5fd21a5515976a50e31c02bbea69a17833fbd5 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 14 十一月 2023 14:34:48 +0800
Subject: [PATCH] 实现角色管理中的设置权限的功能
---
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
index 9cc6bd7..544e773 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
@@ -186,6 +186,41 @@
}
+
+ /**
+ * 璁剧疆瑙掕壊鏉冮檺
+ * @param id 瑙掕壊ID
+ * @return 鏄惁鎴愬姛
+ */
+ @Operation(summary = "璁剧疆瑙掕壊鏉冮檺", description = "鎻愪氦瑙掕壊ID锛屽強鎵�閫夋嫨鐨勬潈闄怚D闆嗗悎锛堟暟缁勶級")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = Boolean.class))}
+ )
+ })
+ @GetMapping(path = "setPrivs", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+ @SsoAop("-1")//@SsoAop(power = "-1")
+ public BaseResponse<Boolean> setPrivileges(@Parameter(description = "瀹炰綋id", required = true) Long id,
+ @Parameter(description = "鏉冮檺id鏁扮粍") Long[] privIds){
+ Long[] privIds_lg = null ;
+ if(privIds != null && privIds.length > 0){
+ privIds_lg = new Long[privIds.length] ;
+ int index = 0 ;
+ for(Long privId : privIds){
+ privIds_lg[index++] = privId ;
+ }
+ }
+ try {
+ this.sv.setRoles(id, privIds_lg);
+ } catch (Exception e) {
+ log.error("淇濆瓨鐢ㄦ埛寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ return BaseResponseUtils.buildSuccess(true) ;
+ }
/**
* 鍒犻櫎瑙掕壊
* @param id 瑙掕壊ID
--
Gitblit v1.8.0