ソースを参照

//vodeo

private_deployment
xhxu 2年前
コミット
3339b9160a
2個のファイルの変更11行の追加7行の削除
  1. +3
    -3
      suimangAdmin/src/main/java/com/iformall/controller/video/VideoController.java
  2. +8
    -4
      suimangVideo/src/main/java/com/iformall/language/LanguageDetect.java

+ 3
- 3
suimangAdmin/src/main/java/com/iformall/controller/video/VideoController.java ファイルの表示

@@ -94,9 +94,9 @@ public class VideoController extends BaseController {
title = multiReq.getOriginalFilename().substring(0,dot);
}
}
if(!fileFormat.endsWith("mp4") || !fileFormat.endsWith("mp3")){
return new ResultData(ErrorCode.PICTURE_ENDWIDTH_ERROR);
}
// if(!fileFormat.endsWith("mp4") || !fileFormat.endsWith("mp3")){
// return new ResultData(ErrorCode.PICTURE_ENDWIDTH_ERROR);
// }
VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoStream(title, multiReq.getInputStream(),fileFormat);
result.setSize(size);
return new ResultData(result);


+ 8
- 4
suimangVideo/src/main/java/com/iformall/language/LanguageDetect.java ファイルの表示

@@ -32,11 +32,15 @@ public class LanguageDetect {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
Resource[] resources = resolver.getResources("classpath:profiles/*");
for (Resource resource:resources) {
// InputStream inputStream = resource.getInputStream();
// String str = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
//// String str = new String(ByteStreams.toByteArray(inputStream));
// profile.add(str);
// inputStream.close();
InputStream inputStream = resource.getInputStream();
String str = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
// String str = new String(ByteStreams.toByteArray(inputStream));
profile.add(str);
inputStream.close();
byte[] bytes = new byte[0];
inputStream.read(bytes);
profile.add(new String(bytes));
}
} catch (IOException e) {
e.printStackTrace();


読み込み中…
キャンセル
保存