|
@@ -10,26 +10,28 @@ import java.util.Map;
|
|
|
@Deprecated
|
|
@Deprecated
|
|
|
public enum UploadChannel {
|
|
public enum UploadChannel {
|
|
|
// 网盘上传(单个文件最大 20GiB)
|
|
// 网盘上传(单个文件最大 20GiB)
|
|
|
- disk(1, "file/", 1024L*1024*1024*20),
|
|
|
|
|
|
|
+ disk(101, "file/", 1024L*1024*1024*20, 1005),
|
|
|
// 视频上传(单个文件最大 10GiB)
|
|
// 视频上传(单个文件最大 10GiB)
|
|
|
- video(2, "video/playback/", 1024L*1024*1024*10),
|
|
|
|
|
|
|
+ video(102, "video/playback/", 1024L*1024*1024*10, 1002),
|
|
|
// 音频上传(单个文件最大 1GiB)
|
|
// 音频上传(单个文件最大 1GiB)
|
|
|
- audio(3, "audio/playback/", 1024L*1024*1024),
|
|
|
|
|
|
|
+ audio(103, "audio/playback/", 1024L*1024*1024, 1003),
|
|
|
// 用户头像上传(单个文件最大 2MiB)
|
|
// 用户头像上传(单个文件最大 2MiB)
|
|
|
- avatar(4, "image/a/", 1024L*1024*2),
|
|
|
|
|
|
|
+ avatar(104, "image/a/", 1024L*1024*2, 1001),
|
|
|
// 图片上传(单个文件最大 10MiB)
|
|
// 图片上传(单个文件最大 10MiB)
|
|
|
- image(5, "image/i/", 1024L*1024*10),
|
|
|
|
|
|
|
+ image(105, "image/i/", 1024L*1024*10, 1001),
|
|
|
// 用户状态照片上传(单个文件最大 100MiB)
|
|
// 用户状态照片上传(单个文件最大 100MiB)
|
|
|
- photo(6, "image/p/", 1024L*1024*100),
|
|
|
|
|
- img(7, "img/", 1024L*1024*10);
|
|
|
|
|
|
|
+ photo(106, "image/p/", 1024L*1024*100, 1001),
|
|
|
|
|
+ img(107, "img/", 1024L*1024*10, 1001);
|
|
|
|
|
|
|
|
private final int code;
|
|
private final int code;
|
|
|
private final String prefix;
|
|
private final String prefix;
|
|
|
private final long maxSize;
|
|
private final long maxSize;
|
|
|
- UploadChannel(int code, String prefix, long maxSize) {
|
|
|
|
|
|
|
+ private final int fileType;
|
|
|
|
|
+ UploadChannel(int code, String prefix, long maxSize, int fileType) {
|
|
|
this.code = code;
|
|
this.code = code;
|
|
|
this.prefix = prefix;
|
|
this.prefix = prefix;
|
|
|
this.maxSize = maxSize;
|
|
this.maxSize = maxSize;
|
|
|
|
|
+ this.fileType = fileType;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static Map<Integer, UploadChannel> map = new HashMap<>();
|
|
private static Map<Integer, UploadChannel> map = new HashMap<>();
|
|
@@ -60,4 +62,8 @@ public enum UploadChannel {
|
|
|
public long getMaxSize() {
|
|
public long getMaxSize() {
|
|
|
return maxSize;
|
|
return maxSize;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public int getFileType() {
|
|
|
|
|
+ return fileType;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|