Commit 2b8b3f44 authored by Quxl's avatar Quxl
parents ee36ed59 29a0018a
...@@ -41,9 +41,11 @@ public class AliyunApiController { ...@@ -41,9 +41,11 @@ public class AliyunApiController {
private String accessKeySecret; private String accessKeySecret;
@Value("${aliyun.video.templateId}") @Value("${aliyun.video.templateGroupId}")
private String templateId; private String templateGroupId;
@Value("${aliyun.video.cateID}")
private String cateID;
@Autowired @Autowired
private Messages messages; private Messages messages;
...@@ -60,7 +62,7 @@ public class AliyunApiController { ...@@ -60,7 +62,7 @@ public class AliyunApiController {
public Object createUploadVideo(HttpServletRequest request) { public Object createUploadVideo(HttpServletRequest request) {
String fileName = request.getParameter("fileName"); String fileName = request.getParameter("fileName");
String title = request.getParameter("title"); String title = request.getParameter("title");
String cateId = request.getParameter("cateId"); //String cateId = request.getParameter("cateId");
String tags = request.getParameter("tags"); String tags = request.getParameter("tags");
String description = request.getParameter("description"); String description = request.getParameter("description");
...@@ -73,16 +75,17 @@ public class AliyunApiController { ...@@ -73,16 +75,17 @@ public class AliyunApiController {
Map<String,Object> params = new HashMap<String,Object>(); Map<String,Object> params = new HashMap<String,Object>();
params.put("fileName", fileName); params.put("fileName", fileName);
params.put("title", title); params.put("title", title);
params.put("cateId", cateId); params.put("cateId", cateID);
params.put("tags", tags); params.put("tags", tags);
params.put("description", description); params.put("description", description);
params.put("templateGroupId", templateGroupId);
AliyunUtil aliyunUtil = new AliyunUtil(accessKeyId,accessKeySecret); AliyunUtil aliyunUtil = new AliyunUtil(accessKeyId,accessKeySecret);
CreateUploadVideoResponse response = aliyunUtil.createUploadVideo(params); CreateUploadVideoResponse response = aliyunUtil.createUploadVideo(params);
return Rjx.jsonOk().set("RequestId", response.getRequestId()).set("UploadAuth", response.getUploadAuth()) return Rjx.jsonOk().set("RequestId", response.getRequestId()).set("UploadAuth", response.getUploadAuth())
.set("UploadAddress", response.getUploadAddress()) .set("UploadAddress", response.getUploadAddress())
.set("VideoId", response.getVideoId()).set("templateId", templateId); .set("VideoId", response.getVideoId());
} }
...@@ -101,7 +104,7 @@ public class AliyunApiController { ...@@ -101,7 +104,7 @@ public class AliyunApiController {
AliyunUtil aliyunUtil = new AliyunUtil(accessKeyId,accessKeySecret); AliyunUtil aliyunUtil = new AliyunUtil(accessKeyId,accessKeySecret);
RefreshUploadVideoResponse response = aliyunUtil.refreshUploadVideo(videoId); RefreshUploadVideoResponse response = aliyunUtil.refreshUploadVideo(videoId);
if(response != null) { if(response != null) {
return Rjx.jsonOk().set("RequestId", response.getRequestId()).set("UploadAuth", response.getUploadAuth()).set("UploadAddress", response.getUploadAddress()).set("templateId", templateId); return Rjx.jsonOk().set("RequestId", response.getRequestId()).set("UploadAuth", response.getUploadAuth()).set("UploadAddress", response.getUploadAddress());
}else { }else {
return Rjx.jsonErr().setCode(-1).setMessage("InvalidVideo.NotFound : The video does not exist."); return Rjx.jsonErr().setCode(-1).setMessage("InvalidVideo.NotFound : The video does not exist.");
} }
......
...@@ -61,6 +61,7 @@ public class AliyunUtil { ...@@ -61,6 +61,7 @@ public class AliyunUtil {
request.setTags(params.get("tags")+""); request.setTags(params.get("tags")+"");
// 可选,视频描述 // 可选,视频描述
request.setDescription(params.get("description")+""); request.setDescription(params.get("description")+"");
request.setTemplateGroupId(params.get("templateGroupId")+"");
response = aliyunClient.getAcsResponse(request); response = aliyunClient.getAcsResponse(request);
} catch (ServerException e) { } catch (ServerException e) {
System.out.println("CreateUploadVideoRequest Server Exception:"); System.out.println("CreateUploadVideoRequest Server Exception:");
......
...@@ -37,5 +37,6 @@ spring.datasource.min-idle=10 ...@@ -37,5 +37,6 @@ spring.datasource.min-idle=10
aliyun.sts.accessKeyId=LTAIOtHCCpDLXYp8 aliyun.sts.accessKeyId=LTAIOtHCCpDLXYp8
aliyun.sts.accessKeySecret=9XTHW7P9TTRvCsBHBSclOue2tdWOoa aliyun.sts.accessKeySecret=9XTHW7P9TTRvCsBHBSclOue2tdWOoa
#\u89C6\u9891\u8F6C\u7801ID #\u89C6\u9891\u8F6C\u7801ID
aliyun.video.templateId=d9f4a79cba14ce4cbc98d6516d35bf37 aliyun.video.templateGroupId=d9f4a79cba14ce4cbc98d6516d35bf37
aliyun.video.cateID=1000018494
opt.project.type=1 opt.project.type=1
\ No newline at end of file
...@@ -36,5 +36,6 @@ spring.datasource.min-idle=10 ...@@ -36,5 +36,6 @@ spring.datasource.min-idle=10
aliyun.sts.accessKeyId=LTAIOtHCCpDLXYp8 aliyun.sts.accessKeyId=LTAIOtHCCpDLXYp8
aliyun.sts.accessKeySecret=9XTHW7P9TTRvCsBHBSclOue2tdWOoa aliyun.sts.accessKeySecret=9XTHW7P9TTRvCsBHBSclOue2tdWOoa
#\u89C6\u9891\u8F6C\u7801ID #\u89C6\u9891\u8F6C\u7801ID
aliyun.video.templateId=d9f4a79cba14ce4cbc98d6516d35bf37 aliyun.video.templateGroupId=d9f4a79cba14ce4cbc98d6516d35bf37
aliyun.video.cateID=1000018494
opt.project.type=1 opt.project.type=1
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment