Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
member-api
Commits
2b8b3f44
Commit
2b8b3f44
authored
Feb 14, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://key@gitlab.egolm.com/hanxu/siff-film-api.git
parents
ee36ed59
29a0018a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
AliyunApiController.java
...main/java/com/egolm/film/api/web/AliyunApiController.java
+9
-6
AliyunUtil.java
src/main/java/com/egolm/film/util/AliyunUtil.java
+1
-0
application-dev.properties
src/main/resources/application-dev.properties
+2
-1
application-pro.properties
src/main/resources/application-pro.properties
+2
-1
No files found.
src/main/java/com/egolm/film/api/web/AliyunApiController.java
View file @
2b8b3f44
...
@@ -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.template
Group
Id}"
)
private
String
templateId
;
private
String
template
Group
Id
;
@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"
,
cateI
d
);
params
.
put
(
"cateId"
,
cateI
D
);
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."
);
}
}
...
...
src/main/java/com/egolm/film/util/AliyunUtil.java
View file @
2b8b3f44
...
@@ -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:"
);
...
...
src/main/resources/application-dev.properties
View file @
2b8b3f44
...
@@ -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
src/main/resources/application-pro.properties
View file @
2b8b3f44
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment