@@ -94,9 +94,9 @@ public class VideoController extends BaseController { | |||||
title = multiReq.getOriginalFilename().substring(0,dot); | 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); | VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoStream(title, multiReq.getInputStream(),fileFormat); | ||||
result.setSize(size); | result.setSize(size); | ||||
return new ResultData(result); | return new ResultData(result); | ||||
@@ -604,7 +604,7 @@ public enum ErrorCode{ | |||||
PICTURE_ANALYZING_ERROR(40002, "您上传的图片无法解析,请检查"), | PICTURE_ANALYZING_ERROR(40002, "您上传的图片无法解析,请检查"), | ||||
PICTURE_SIZE_CUSTOMIZE(40003, "图片超过大小限制"), | PICTURE_SIZE_CUSTOMIZE(40003, "图片超过大小限制"), | ||||
PICTURE_W_H_CUSTOMIZE(40004, "图片不符合宽高限制"), | PICTURE_W_H_CUSTOMIZE(40004, "图片不符合宽高限制"), | ||||
PICTURE_ENDWIDTH_ERROR(40005, "格式不正确"), | |||||
PICTURE_ENDWIDTH_ERROR(40005, "格式只支持.mp3,.mp4"), | |||||
/** | /** | ||||
* 电费生成配置 | * 电费生成配置 | ||||
@@ -40,7 +40,7 @@ public class AiVideoHelper { | |||||
params.put("gen_txt",gen_txt); | params.put("gen_txt",gen_txt); | ||||
String response = doPost(uri+"/gen_dh_video", params); | String response = doPost(uri+"/gen_dh_video", params); | ||||
log.info("生成视频 request:"+params.toString()+" response:"+response); | |||||
log.info("生成视频 request:" + JSONObject.toJSONString(params) + " response:"+response); | |||||
AiVideoResult result = new AiVideoResult(); | AiVideoResult result = new AiVideoResult(); | ||||
@@ -80,6 +80,7 @@ public class AliyunVedioServer { | |||||
} | } | ||||
private static String toLanEndpoint(String bucket) { | private static String toLanEndpoint(String bucket) { | ||||
// return bucket; | |||||
return bucket.replace(".aliyuncs.com", "-internal.aliyuncs.com"); | return bucket.replace(".aliyuncs.com", "-internal.aliyuncs.com"); | ||||
} | } | ||||
private static OssUploadClient initOssClient(CreateUploadVideoResponse response) throws UnsupportedEncodingException { | private static OssUploadClient initOssClient(CreateUploadVideoResponse response) throws UnsupportedEncodingException { | ||||