|
@@ -118,6 +118,9 @@ public class PaperService {
|
|
@Value("${upyun.radioType}")
|
|
@Value("${upyun.radioType}")
|
|
protected String radioType;
|
|
protected String radioType;
|
|
|
|
|
|
|
|
+ @Value("${upyun.audio.maxsize}")
|
|
|
|
+ protected String maxsize;
|
|
|
|
+
|
|
@Value("${upyun.audio.uploadUrl}")
|
|
@Value("${upyun.audio.uploadUrl}")
|
|
protected String upyunRadioPath;
|
|
protected String upyunRadioPath;
|
|
|
|
|
|
@@ -1000,6 +1003,12 @@ public class PaperService {
|
|
}
|
|
}
|
|
byte[] bufs = new byte[1024 * 10];
|
|
byte[] bufs = new byte[1024 * 10];
|
|
for(MultipartFile file: files){
|
|
for(MultipartFile file: files){
|
|
|
|
+ //判断文件大小
|
|
|
|
+ long fileSize = file.getSize();
|
|
|
|
+ int size = Integer.parseInt(maxsize);
|
|
|
|
+ if(fileSize>size * 1048576){
|
|
|
|
+ throw new RuntimeException("音频文件超过5M");
|
|
|
|
+ }
|
|
//新建MP3文件
|
|
//新建MP3文件
|
|
String questionId = "";
|
|
String questionId = "";
|
|
String numbers[] = file.getOriginalFilename().split("_");
|
|
String numbers[] = file.getOriginalFilename().split("_");
|