From 9ca9a4efd10f109625e81c27b9531cffed55c0bf Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 14 十一月 2023 14:14:35 +0800 Subject: [PATCH] 1、设置id拦截器修改,处理实体没有setId方法的情况 2、用户管理中增加设置用户角色的方法 --- pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java index 9368a24..2e31985 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java @@ -235,6 +235,42 @@ /** + * 璁剧疆鐢ㄦ埛瑙掕壊 + * @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 = "setRoles", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @SsoAop("-1")//@SsoAop(power = "-1") + public BaseResponse<Boolean> setRoles(@Parameter(description = "瀹炰綋id", required = true) String id, + @Parameter(description = "瑙掕壊id鏁扮粍闆嗗悎") String[] roleIds){ + Long[] roleId_lg = null ; + if(roleIds != null && roleIds.length > 0){ + roleId_lg = new Long[roleIds.length] ; + int index = 0 ; + for(String roleId : roleIds){ + roleId_lg[index++] = Long.parseLong(roleId) ; + } + } + try { + this.sv.setRoles(Long.parseLong(id), roleId_lg); + } catch (Exception e) { + log.error("淇濆瓨鐢ㄦ埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + return BaseResponseUtils.buildSuccess(true) ; + } + + + /** * 鍒犻櫎鐢ㄦ埛 * @param id 鐢ㄦ埛ID * @return 鏄惁鎴愬姛 -- Gitblit v1.8.0