diff --git a/continew-system/src/main/java/top/continew/admin/system/model/req/StorageReq.java b/continew-system/src/main/java/top/continew/admin/system/model/req/StorageReq.java index 18e3635e..702db61b 100644 --- a/continew-system/src/main/java/top/continew/admin/system/model/req/StorageReq.java +++ b/continew-system/src/main/java/top/continew/admin/system/model/req/StorageReq.java @@ -47,7 +47,7 @@ public class StorageReq implements Serializable { /** * 名称 */ - @Schema(description = "名称", example = "存储1") + @Schema(description = "名称", example = "S3对象存储") @NotBlank(message = "名称不能为空") @Length(max = 100, message = "名称长度不能超过 {max} 个字符") private String name; @@ -55,7 +55,7 @@ public class StorageReq implements Serializable { /** * 编码 */ - @Schema(description = "编码", example = "local") + @Schema(description = "编码", example = "s3_aliyun") @NotBlank(message = "编码不能为空") @Pattern(regexp = RegexConstants.GENERAL_CODE, message = "编码长度为 2-30 个字符,支持大小写字母、数字、下划线,以字母开头") private String code; @@ -70,7 +70,7 @@ public class StorageReq implements Serializable { /** * Access Key */ - @Schema(description = "Access Key", example = "") + @Schema(description = "Access Key", example = "LBAI4Fp4dXYcZamU5EXTBdTa") @Length(max = 255, message = "Access Key长度不能超过 {max} 个字符") @NotBlank(message = "Access Key不能为空", groups = ValidationGroup.Storage.OSS.class) private String accessKey; @@ -78,14 +78,13 @@ public class StorageReq implements Serializable { /** * Secret Key */ - @Schema(description = "Secret Key", example = "") - @NotBlank(message = "Secret Key不能为空", groups = ValidationGroup.Storage.OSS.class) + @Schema(description = "Secret Key", example = "RSA 公钥加密的 Secret Key") private String secretKey; /** * Endpoint */ - @Schema(description = "Endpoint", example = "") + @Schema(description = "Endpoint", example = "http://oss-cn-shanghai.aliyuncs.com") @Length(max = 255, message = "Endpoint长度不能超过 {max} 个字符") @NotBlank(message = "Endpoint不能为空", groups = ValidationGroup.Storage.OSS.class) @Pattern(regexp = RegexConstants.URL_HTTP, message = "Endpoint格式不正确", groups = ValidationGroup.Storage.OSS.class) @@ -94,7 +93,7 @@ public class StorageReq implements Serializable { /** * Bucket/存储路径 */ - @Schema(description = "Bucket/存储路径", example = "C:/continew-admin/data/file/") + @Schema(description = "Bucket/存储路径", example = "continew-admin") @Length(max = 255, message = "Bucket长度不能超过 {max} 个字符", groups = ValidationGroup.Storage.OSS.class) @Length(max = 255, message = "存储路径长度不能超过 {max} 个字符", groups = ValidationGroup.Storage.Local.class) @NotBlank(message = "Bucket不能为空", groups = ValidationGroup.Storage.OSS.class) @@ -104,7 +103,7 @@ public class StorageReq implements Serializable { /** * 域名/访问路径 */ - @Schema(description = "域名/访问路径", example = "http://localhost:8000/file") + @Schema(description = "域名/访问路径", example = "https://continew-admin.file.continew.top/") @Length(max = 255, message = "域名长度不能超过 {max} 个字符", groups = ValidationGroup.Storage.OSS.class) @Length(max = 255, message = "访问路径长度不能超过 {max} 个字符", groups = ValidationGroup.Storage.Local.class) @NotBlank(message = "访问路径不能为空", groups = ValidationGroup.Storage.Local.class) diff --git a/continew-system/src/main/java/top/continew/admin/system/model/resp/StorageResp.java b/continew-system/src/main/java/top/continew/admin/system/model/resp/StorageResp.java index d728de06..6bce6139 100644 --- a/continew-system/src/main/java/top/continew/admin/system/model/resp/StorageResp.java +++ b/continew-system/src/main/java/top/continew/admin/system/model/resp/StorageResp.java @@ -21,7 +21,6 @@ import lombok.Data; import top.continew.admin.common.base.model.resp.BaseDetailResp; import top.continew.admin.common.enums.DisEnableStatusEnum; import top.continew.admin.system.enums.StorageTypeEnum; -import top.continew.starter.security.mask.annotation.JsonMask; import java.io.Serial; @@ -68,13 +67,6 @@ public class StorageResp extends BaseDetailResp { @Schema(description = "Access Key", example = "") private String accessKey; - /** - * Secret Key - */ - @Schema(description = "Secret Key", example = "") - @JsonMask(left = 4, right = 3) - private String secretKey; - /** * Endpoint */ diff --git a/continew-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java b/continew-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java index a0ad7058..ca6b95ed 100644 --- a/continew-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java +++ b/continew-system/src/main/java/top/continew/admin/system/service/impl/StorageServiceImpl.java @@ -28,9 +28,9 @@ import org.dromara.x.file.storage.core.FileStorageServiceBuilder; import org.dromara.x.file.storage.core.platform.FileStorage; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import top.continew.admin.common.model.req.CommonStatusUpdateReq; import top.continew.admin.common.base.service.BaseServiceImpl; import top.continew.admin.common.enums.DisEnableStatusEnum; +import top.continew.admin.common.model.req.CommonStatusUpdateReq; import top.continew.admin.common.util.SecureUtils; import top.continew.admin.system.enums.StorageTypeEnum; import top.continew.admin.system.mapper.StorageMapper; @@ -40,7 +40,6 @@ import top.continew.admin.system.model.req.StorageReq; import top.continew.admin.system.model.resp.StorageResp; import top.continew.admin.system.service.FileService; import top.continew.admin.system.service.StorageService; -import top.continew.starter.core.constant.StringConstants; import top.continew.starter.core.util.ExceptionUtils; import top.continew.starter.core.util.SpringWebUtils; import top.continew.starter.core.util.validation.CheckUtils; @@ -68,6 +67,7 @@ public class StorageServiceImpl extends BaseServiceImpl SecureUtils.decryptByRsaPrivateKey(encryptSecretKey));