Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
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
曲欣亮
sentinel
Commits
4cb47f31
Commit
4cb47f31
authored
Feb 14, 2019
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加功能
parent
6eef0f0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
1 deletion
+95
-1
AliyunApiController.java
...main/java/com/egolm/film/api/web/AliyunApiController.java
+94
-0
application-pro.properties
src/main/resources/application-pro.properties
+1
-1
No files found.
src/main/java/com/egolm/film/api/web/AliyunApiController.java
View file @
4cb47f31
package
com
.
egolm
.
film
.
api
.
web
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -20,6 +21,9 @@ import com.aliyuncs.vod.model.v20170321.RefreshUploadVideoResponse;
import
com.egolm.common.HttpUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.exception.HttpRequestException
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.Messages
;
import
com.egolm.film.util.AliyunSign
;
import
com.egolm.film.util.AliyunUtil
;
...
...
@@ -49,6 +53,9 @@ public class AliyunApiController {
@Autowired
private
Messages
messages
;
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@ResponseBody
@ApiOperation
(
"获取点播授权Auth"
)
@ApiImplicitParams
({
...
...
@@ -245,4 +252,91 @@ public class AliyunApiController {
return
result
;
}
@ResponseBody
@ApiOperation
(
"修改视频信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"String"
,
required
=
false
,
value
=
"页码"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"String"
,
required
=
false
,
value
=
"每页显示数"
,
defaultValue
=
""
),
})
@RequestMapping
(
value
=
"/updateVideoInfo"
,
method
=
RequestMethod
.
GET
)
public
Object
updateVideoInfo
(
HttpServletRequest
request
)
{
String
index
=
request
.
getParameter
(
"index"
);
String
limit
=
request
.
getParameter
(
"limit"
);
Page
page
=
new
Page
();
page
.
setIndex
(
Long
.
valueOf
(
index
));
page
.
setLimit
(
Long
.
valueOf
(
limit
));
page
.
setLimitKey
(
"upload_time desc "
);
String
sql
=
"SELECT en_name,cn_name,upload_id,upload_state,upload_time from fc_member_film where upload_id is not null and upload_state=1 and cn_name != '' and cn_name = en_name and upload_time <='2019-02-14 12:36:47' "
;
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
limit
(
sql
,
page
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
for
(
Map
<
String
,
Object
>
map:
list
)
{
String
en_name
=
map
.
get
(
"en_name"
)+
""
;
String
cn_name
=
map
.
get
(
"cn_name"
)+
""
;
String
upload_id
=
map
.
get
(
"upload_id"
)+
""
;
System
.
out
.
println
(
upload_id
+
"----"
+
cn_name
+
"-----"
+
en_name
);
String
title
=
cn_name
;
Map
<
String
,
String
>
privateParams
=
new
HashMap
<
String
,
String
>();
privateParams
.
put
(
"Action"
,
"UpdateVideoInfo"
);
privateParams
.
put
(
"VideoId"
,
upload_id
);
privateParams
.
put
(
"Title"
,
title
);
privateParams
.
put
(
"CateId"
,
cateID
);
//生成公共参数,不需要修改
Map
<
String
,
String
>
publicParams
=
AliyunSign
.
generatePublicParamters
();
//生成OpenAPI地址,不需要修改
String
URL
=
AliyunSign
.
generateOpenAPIURL
(
publicParams
,
privateParams
);
//发送HTTP GET 请求
String
result
=
HttpUtil
.
get
(
URL
);
System
.
out
.
println
(
result
);
}
}
/*
//生成私有参数,不同API需要修改
return result;
*/
return
"处理完成"
;
}
@ResponseBody
@ApiOperation
(
"获取视频信息"
)
@ApiImplicitParams
({
})
@RequestMapping
(
value
=
"/getVideoList"
,
method
=
RequestMethod
.
GET
)
public
Object
getVideoList
(
HttpServletRequest
request
)
{
Map
<
String
,
String
>
privateParams
=
new
HashMap
<
String
,
String
>();
privateParams
.
put
(
"Action"
,
"GetVideoList"
);
privateParams
.
put
(
"CateId"
,
cateID
);
//生成公共参数,不需要修改
Map
<
String
,
String
>
publicParams
=
AliyunSign
.
generatePublicParamters
();
//生成OpenAPI地址,不需要修改
String
URL
=
AliyunSign
.
generateOpenAPIURL
(
publicParams
,
privateParams
);
//发送HTTP GET 请求
String
result
=
HttpUtil
.
get
(
URL
);
System
.
out
.
println
(
result
);
JSONObject
obj
=
JSONObject
.
parseObject
(
result
);
if
(
obj
.
containsKey
(
"VideoList"
))
{
JSONObject
VideoList
=
obj
.
getJSONObject
(
"VideoList"
);
JSONArray
Video
=
VideoList
.
getJSONArray
(
"Video"
);
for
(
int
i
=
0
;
i
<
Video
.
size
();
i
++)
{
JSONObject
v
=
Video
.
getJSONObject
(
i
);
if
(
v
.
getString
(
"Title"
).
contains
(
"测试"
))
{
System
.
out
.
println
(
v
.
getString
(
"VideoId"
));
}
}
}
return
"处理完成"
;
}
}
src/main/resources/application-pro.properties
View file @
4cb47f31
...
...
@@ -18,7 +18,7 @@ com.egolm.film.email.smtp.from=filmpassword@siff.com
com.egolm.film.email.smtp.username
=
filmpassword@siff.com
com.egolm.film.email.smtp.password
=
siffstvf2018
spring.datasource.url
=
jdbc:mysql://rm-uf690z5r42mm16f3r.mysql.rds.aliyuncs.com:3306/film_2019?useSSL=false&useUnicode=true&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://rm-uf690z5r42mm16f3r
ho
.mysql.rds.aliyuncs.com:3306/film_2019?useSSL=false&useUnicode=true&characterEncoding=utf8
spring.datasource.username
=
filmdb
spring.datasource.password
=
SMG@film#2018
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
...
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