更新用户权限

This commit is contained in:
2025-12-08 11:55:09 +08:00
parent 76a76d5ef7
commit df41eeab00
6 changed files with 31 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -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("权限更新失败");
}
}
}

View File

@@ -65,5 +65,7 @@ public interface IDataFeignClient {
SdmResponse<List<BatchAddFileInfoResp>> batchAddFileInfo(@RequestBody UploadFilesReq req);
@PostMapping("/data/updatePermission")
SdmResponse updatePermission(@RequestBody UpdatePermissionReq req);
}