Compare commits
No commits in common. "a859e2848094369f1311b6e223928b8012c61f28" and "aa209d807f9e454b9168e1ba8e825aee054c1550" have entirely different histories.
a859e28480
...
aa209d807f
|
@ -19,6 +19,7 @@ import java.io.Serializable;
|
||||||
@Schema(description = "文件添加请求体", requiredProperties = {
|
@Schema(description = "文件添加请求体", requiredProperties = {
|
||||||
"name",
|
"name",
|
||||||
"type",
|
"type",
|
||||||
|
"path",
|
||||||
"size",
|
"size",
|
||||||
"fileView",
|
"fileView",
|
||||||
"biz",
|
"biz",
|
||||||
|
@ -39,6 +40,13 @@ 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,6 +18,7 @@ import java.io.Serializable;
|
||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"type",
|
"type",
|
||||||
|
"path",
|
||||||
"size",
|
"size",
|
||||||
"fileView",
|
"fileView",
|
||||||
"biz",
|
"biz",
|
||||||
|
@ -45,6 +46,13 @@ 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,6 +38,11 @@ public class FileInfo implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
private String path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件大小(KB)
|
* 文件大小(KB)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,6 +32,12 @@ 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(fileName)
|
.path(filePath)
|
||||||
.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 + fileName);
|
File file = new File(UPLOAD_DIR + filePath);
|
||||||
if (!file.getParentFile().exists()) {
|
if (!file.getParentFile().exists()) {
|
||||||
file.getParentFile().mkdirs();// 如果路径不存在则创建
|
file.getParentFile().mkdirs();// 如果路径不存在则创建
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user