更新用户权限
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.sdm.common.entity.req.data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "更新权限请求参数")
|
||||
public class UpdatePermissionReq {
|
||||
|
||||
// @NotBlank(message = "parentPath不能为空")
|
||||
@Schema(description = "父路径")
|
||||
private String parentPath;
|
||||
|
||||
// @NotBlank(message = "fileName不能为空")
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "工号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String jobNumber;
|
||||
|
||||
@Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String userName;
|
||||
|
||||
// @NotBlank(message = "effectiveTime不能为空")
|
||||
@Schema(description = "生效时间")
|
||||
private String effectiveTime;
|
||||
|
||||
@Schema(description = "权限值")
|
||||
private byte permission;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "文件ID")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "节点uuid")
|
||||
private String uuid;
|
||||
|
||||
@Schema(description = "类型: 0普通用户, 1组用户")
|
||||
private byte type; //0:普通用户 1:组用户
|
||||
|
||||
@Schema(description = "用户权限,key:用户ID,value:权限值")
|
||||
private Map<Long,Byte> userPermissions;
|
||||
}
|
||||
@@ -171,4 +171,16 @@ public class DataClientFeignClientImpl implements IDataFeignClient {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse updatePermission(UpdatePermissionReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = dataClient.updatePermission(req);
|
||||
log.info("权限更新成功:"+ response);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("权限更新失败:", e);
|
||||
return SdmResponse.failed("权限更新失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,5 +65,7 @@ public interface IDataFeignClient {
|
||||
SdmResponse<List<BatchAddFileInfoResp>> batchAddFileInfo(@RequestBody UploadFilesReq req);
|
||||
|
||||
|
||||
@PostMapping("/data/updatePermission")
|
||||
SdmResponse updatePermission(@RequestBody UpdatePermissionReq req);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user