File tree Expand file tree Collapse file tree
continew-module-system/src/main/java/top/continew/admin/system/model/req
continew-webapi/src/main/java/top/continew/admin/controller/system Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ public class FileReq implements Serializable {
4141 * 名称
4242 */
4343 @ Schema (description = "名称" , example = "example" )
44- @ NotBlank (message = "文件名称不能为空 " )
45- @ Length (max = 255 , message = "文件名称长度不能超过 {max} 个字符" )
44+ @ NotBlank (message = "名称不能为空 " )
45+ @ Length (max = 255 , message = "名称长度不能超过 {max} 个字符" )
4646 private String originalName ;
4747
4848 /**
Original file line number Diff line number Diff line change 1919import cn .dev33 .satoken .annotation .SaCheckPermission ;
2020import io .swagger .v3 .oas .annotations .Operation ;
2121import io .swagger .v3 .oas .annotations .tags .Tag ;
22+ import jakarta .validation .Valid ;
2223import jakarta .validation .constraints .NotNull ;
2324import lombok .RequiredArgsConstructor ;
2425import org .dromara .x .file .storage .core .FileInfo ;
@@ -81,7 +82,8 @@ public FileUploadResp upload(@NotNull(message = "文件不能为空") MultipartF
8182 @ Operation (summary = "创建文件夹" , description = "创建文件夹" )
8283 @ SaCheckPermission ("system:file:createDir" )
8384 @ PostMapping ("/dir" )
84- public IdResp <Long > createDir (@ RequestBody FileReq req ) {
85+ public IdResp <Long > createDir (@ Valid @ RequestBody FileReq req ) {
86+ ValidationUtils .throwIfBlank (req .getParentPath (), "上级目录不能为空" );
8587 return new IdResp <>(baseService .createDir (req ));
8688 }
8789
You can’t perform that action at this time.
0 commit comments