Compare commits
2 Commits
aa209d807f
...
a859e28480
Author | SHA1 | Date | |
---|---|---|---|
a859e28480 | |||
059d1f0418 |
|
@ -19,7 +19,6 @@ import java.io.Serializable;
|
||||||
@Schema(description = "文件添加请求体", requiredProperties = {
|
@Schema(description = "文件添加请求体", requiredProperties = {
|
||||||
"name",
|
"name",
|
||||||
"type",
|
"type",
|
||||||
"path",
|
|
||||||
"size",
|
"size",
|
||||||
"fileView",
|
"fileView",
|
||||||
"biz",
|
"biz",
|
||||||
|
@ -40,13 +39,6 @@ public class FileInfoAddRequest implements Serializable {
|
||||||
@Schema(description = "文件类型", example = "png")
|
@Schema(description = "文件类型", example = "png")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件路径
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "文件路径不能为空")
|
|
||||||
@Schema(description = "文件路径", example = "user_avatar/file.png")
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件大小(KB)
|
* 文件大小(KB)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -18,7 +18,6 @@ import java.io.Serializable;
|
||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"type",
|
"type",
|
||||||
"path",
|
|
||||||
"size",
|
"size",
|
||||||
"fileView",
|
"fileView",
|
||||||
"biz",
|
"biz",
|
||||||
|
@ -46,13 +45,6 @@ public class FileInfoUpdateRequest implements Serializable {
|
||||||
@Schema(description = "文件类型", example = "png")
|
@Schema(description = "文件类型", example = "png")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件路径
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "文件路径不能为空")
|
|
||||||
@Schema(description = "文件路径", example = "user_avatar/file.png")
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件大小(KB)
|
* 文件大小(KB)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -38,11 +38,6 @@ public class FileInfo implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件路径
|
|
||||||
*/
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件大小(KB)
|
* 文件大小(KB)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,12 +32,6 @@ public class FileInfoVO implements Serializable {
|
||||||
@Schema(description = "文件类型", example = "png")
|
@Schema(description = "文件类型", example = "png")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件路径
|
|
||||||
*/
|
|
||||||
@Schema(description = "文件路径", example = "user_avatar/file.png")
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件大小(KB)
|
* 文件大小(KB)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo>
|
||||||
fileInfo = FileInfo.builder()
|
fileInfo = FileInfo.builder()
|
||||||
.name(fileName)
|
.name(fileName)
|
||||||
.type(fileType)
|
.type(fileType)
|
||||||
.path(filePath)
|
.path(fileName)
|
||||||
.size(fileSize)
|
.size(fileSize)
|
||||||
.fileView(view)
|
.fileView(view)
|
||||||
.biz(biz)
|
.biz(biz)
|
||||||
|
@ -104,7 +104,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo>
|
||||||
.build();
|
.build();
|
||||||
this.save(fileInfo);
|
this.save(fileInfo);
|
||||||
// 创建上传目录,如果不存在
|
// 创建上传目录,如果不存在
|
||||||
File file = new File(UPLOAD_DIR + filePath);
|
File file = new File(UPLOAD_DIR + fileName);
|
||||||
if (!file.getParentFile().exists()) {
|
if (!file.getParentFile().exists()) {
|
||||||
file.getParentFile().mkdirs();// 如果路径不存在则创建
|
file.getParentFile().mkdirs();// 如果路径不存在则创建
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user