Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
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
徐少华
midjourney-proxy
Commits
0e78c657
Commit
0e78c657
authored
Jun 15, 2020
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'feat:[1003010]华为云迁移OBS/MPC'
parent
c9b7cb66
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1661 additions
and
1025 deletions
+1661
-1025
aliyun.properties
...d-common-config/src/main/resources.prod/aliyun.properties
+23
-16
aliyun.properties
...d-common-config/src/main/resources.test/aliyun.properties
+22
-14
aliyun.properties
...ud-common-config/src/main/resources.uat/aliyun.properties
+23
-16
pom.xml
pcloud-common/pom.xml
+422
-407
AliyunConstant.java
.../main/java/com/pcloud/common/constant/AliyunConstant.java
+652
-572
OssUtils.java
...rc/main/java/com/pcloud/common/utils/aliyun/OssUtils.java
+0
-0
MPCTest.java
...ain/java/com/pcloud/common/utils/aliyun/test/MPCTest.java
+297
-0
ObsTest.java
...ain/java/com/pcloud/common/utils/aliyun/test/ObsTest.java
+193
-0
pom.xml
pom.xml
+29
-0
No files found.
pcloud-common-config/src/main/resources.prod/aliyun.properties
View file @
0e78c657
## main
## main
Ϊak sk
main.access.key.id
=
LTAIx8FODeVLN3bD
main.access.key.id
=
CROQ0IJRW2FW5NSERZBR
main.access.key.secret
=
eJbZwTzatZq4SMyDiQeh7NzIHkdAaO
main.access.key.secret
=
rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## OSS
## OSS
oss.region
=
oss-cn-hangzhou
oss.region
=
cn-east-2
oss.endpoint
=
http://oss-cn-hangzhou.aliyuncs.com
oss.endpoint
=
obs.cn-east-2.myhuaweicloud.com
file.bucket
=
whlg-oss-002
file.bucket
=
whlg-oss-prod-002
file.original.url
=
http://whlg-oss-002.oss-cn-hangzhou.aliyuncs.com/
file.original.url
=
http://whlg-oss-001.obs.cn-east-2.myhuaweicloud.com/
input.bucket
=
whlg-oss-prod-001
oss.region.bj
=
oss-cn-beijing
oss.region.bj
=
oss-cn-beijing
oss.endpoint.bj
=
http://oss-cn-beijing
-internal
.aliyuncs.com
oss.endpoint.bj
=
http://oss-cn-beijing.aliyuncs.com
live.bucket
=
whlg-oss-live
dev
live.bucket
=
whlg-oss-live
live.original.url
=
http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
live.original.url
=
http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
by.bucket
=
byfile-oss-01
by.bucket
=
byfile-oss-01
by.original.url
=
http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
by.original.url
=
http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
## mts
## mts
mts.region
=
cn-
hangzhou
mts.region
=
cn-
east-2
mts.endpoint
=
m
ts.cn-hangzhou.aliyuncs
.com
mts.endpoint
=
m
pc.cn-east-2.myhuaweicloud
.com
pipelineid
=
a63c988125054b07b1d3bd6e10c327de
pipelineid
=
a63c988125054b07b1d3bd6e10c327de
mp3TemplateId
=
d60210d2fd5bfcacce66238142437965
mts.projectId
=
07455135488025b22fe7c01fdb631c14
mp4TemplateId
=
67745f7eb8b7ca9bcf74d96c2364e6c1
mts.ak
=
8J56JHJN5P8OLR5ERKFU
mts.sk
=
xAlBYlowAhwa9c1Wi4JsX7XkZGFlzlWW3CBHdZWJ
mp3TemplateId
=
104257
mp4TemplateId
=
104256
m3u8TemplateId
=
283cd916aa504502b3704f3f5a45addc
m3u8TemplateId
=
283cd916aa504502b3704f3f5a45addc
mts.region.bj
=
cn-beijing
mts.region.bj
=
cn-beijing
...
@@ -33,9 +37,13 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
...
@@ -33,9 +37,13 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
## cdn
## cdn
file.domain.name
=
oss.5rs.me
file.domain.name
=
oss.5rs.me
file.cdn.url
=
https://oss.5rs.me/
file.cdn.url
=
https://oss.5rs.me/
oss.cdn.urls
=
http://file.chubanyun.me/,http://file.techdc.cn/,https://file.raysyun.com/,http://file.raysgo.com/,http
s://file.5rs.me/,https://oss.5rs.me/,http://live.chubanyun.me/,https://download.5rs.me/,http://rays-adviser.chubanyun.me/,https://byfile.1wlshu
.com/
oss.cdn.urls
=
http://file.chubanyun.me/,http://file.techdc.cn/,https://file.raysyun.com/,http://file.raysgo.com/,http
://oss.raysgo.com/,https://file.5rs.me/,https://oss.5rs.me/,http://live.chubanyun.me/,https://download.5rs.me/,http://rays-adviser.chubanyun.me/,https://byfile.1wlshu.com/,https://byfile.raysgo
.com/
rays.cdn.urls
=
https://file.5rs.me/,https://oss.5rs.me/
rays.cdn.urls
=
https://file.5rs.me/,https://oss.5rs.me/
file.cdn.url.download
=
https://download.5rs.me/
file.cdn.url.download
=
https://download.5rs.me/
file.cdn.url.live
=
http://live.chubanyun.me/
file.cdn.url.live
=
http://live.chubanyun.me/
file.cdn.url.by
=
https://byfile.1wlshu.com/
file.cdn.url.by
=
https://byfile.raysgo.com/
\ No newline at end of file
huawei.access.key
=
CROQ0IJRW2FW5NSERZBR
huawei.secret.key
=
rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
pcloud-common-config/src/main/resources.test/aliyun.properties
View file @
0e78c657
## main
## main
Ϊak sk
main.access.key.id
=
LTAIx8FODeVLN3bD
main.access.key.id
=
CROQ0IJRW2FW5NSERZBR
main.access.key.secret
=
eJbZwTzatZq4SMyDiQeh7NzIHkdAaO
main.access.key.secret
=
rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## OSS
## OSS
oss.region
=
oss-cn-hangzhou
oss.region
=
cn-east-2
oss.endpoint
=
http://oss-cn-hangzhou.aliyuncs.com
oss.endpoint
=
obs.cn-east-2.myhuaweicloud.com
file.bucket
=
whlg-oss-002
file.bucket
=
whlg-oss-test-002
file.original.url
=
http://whlg-oss-002.oss-cn-hangzhou.aliyuncs.com/
file.original.url
=
http://whlg-oss-001.obs.cn-east-2.myhuaweicloud.com/
input.bucket
=
whlg-oss-test-001
oss.region.bj
=
oss-cn-beijing
oss.region.bj
=
oss-cn-beijing
oss.endpoint.bj
=
http://oss-cn-beijing.aliyuncs.com
oss.endpoint.bj
=
http://oss-cn-beijing.aliyuncs.com
live.bucket
=
whlg-oss-live
dev
live.bucket
=
whlg-oss-live
live.original.url
=
http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
live.original.url
=
http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
by.bucket
=
byfile-oss-01
by.bucket
=
byfile-oss-01
by.original.url
=
http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
by.original.url
=
http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
## mts
## mts
mts.region
=
cn-
hangzhou
mts.region
=
cn-
east-2
mts.endpoint
=
m
ts.cn-hangzhou.aliyuncs
.com
mts.endpoint
=
m
pc.cn-east-2.myhuaweicloud
.com
pipelineid
=
a63c988125054b07b1d3bd6e10c327de
pipelineid
=
a63c988125054b07b1d3bd6e10c327de
mp3TemplateId
=
d60210d2fd5bfcacce66238142437965
mts.projectId
=
07455135488025b22fe7c01fdb631c14
mp4TemplateId
=
67745f7eb8b7ca9bcf74d96c2364e6c1
mts.ak
=
8J56JHJN5P8OLR5ERKFU
mts.sk
=
xAlBYlowAhwa9c1Wi4JsX7XkZGFlzlWW3CBHdZWJ
mp3TemplateId
=
104257
mp4TemplateId
=
104256
m3u8TemplateId
=
283cd916aa504502b3704f3f5a45addc
m3u8TemplateId
=
283cd916aa504502b3704f3f5a45addc
mts.region.bj
=
cn-beijing
mts.region.bj
=
cn-beijing
...
@@ -32,10 +36,14 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
...
@@ -32,10 +36,14 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
## cdn
## cdn
file.domain.name
=
oss.5rs.me
file.domain.name
=
oss.5rs.me
file.cdn.url
=
https://oss.
5rs.me
/
file.cdn.url
=
https://oss.
raysgo.com
/
oss.cdn.urls
=
http://file.chubanyun.me/,http://file.techdc.cn/,https://file.raysyun.com/,http://file.raysgo.com/,http://oss.raysgo.com/,https://file.5rs.me/,https://oss.5rs.me/,http://live.chubanyun.me/,https://download.5rs.me/,http://rays-adviser.chubanyun.me/,https://byfile.1wlshu.com/,https://byfile.raysgo.com/
oss.cdn.urls
=
http://file.chubanyun.me/,http://file.techdc.cn/,https://file.raysyun.com/,http://file.raysgo.com/,http://oss.raysgo.com/,https://file.5rs.me/,https://oss.5rs.me/,http://live.chubanyun.me/,https://download.5rs.me/,http://rays-adviser.chubanyun.me/,https://byfile.1wlshu.com/,https://byfile.raysgo.com/
,https://oss.raysyun.com/
rays.cdn.urls
=
https://file.5rs.me/,https://oss.5rs.me/
rays.cdn.urls
=
https://file.5rs.me/,https://oss.5rs.me/
file.cdn.url.download
=
https://download.5rs.me/
file.cdn.url.download
=
https://download.5rs.me/
file.cdn.url.live
=
http://live.chubanyun.me/
file.cdn.url.live
=
http://live.chubanyun.me/
file.cdn.url.by
=
https://byfile.raysgo.com/
file.cdn.url.by
=
https://byfile.raysgo.com/
huawei.access.key
=
CROQ0IJRW2FW5NSERZBR
huawei.secret.key
=
rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
pcloud-common-config/src/main/resources.uat/aliyun.properties
View file @
0e78c657
## main
## main
Ϊak sk
main.access.key.id
=
LTAIx8FODeVLN3bD
main.access.key.id
=
CROQ0IJRW2FW5NSERZBR
main.access.key.secret
=
eJbZwTzatZq4SMyDiQeh7NzIHkdAaO
main.access.key.secret
=
rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## OSS
## OSS
oss.region
=
oss-cn-hangzhou
oss.region
=
cn-east-2
oss.endpoint
=
http://oss-cn-hangzhou.aliyuncs.com
oss.endpoint
=
obs.cn-east-2.myhuaweicloud.com
file.bucket
=
whlg-oss-002
file.bucket
=
whlg-oss-uat-002
file.original.url
=
http://whlg-oss-002.oss-cn-hangzhou.aliyuncs.com/
file.original.url
=
http://whlg-oss-001.obs.cn-east-2.myhuaweicloud.com/
input.bucket
=
whlg-oss-uat-001
oss.region.bj
=
oss-cn-beijing
oss.region.bj
=
oss-cn-beijing
oss.endpoint.bj
=
http://oss-cn-beijing.aliyuncs.com
oss.endpoint.bj
=
http://oss-cn-beijing.aliyuncs.com
live.bucket
=
whlg-oss-live
dev
live.bucket
=
whlg-oss-live
live.original.url
=
http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
live.original.url
=
http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
by.bucket
=
byfile-oss-01
by.bucket
=
byfile-oss-01
by.original.url
=
http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
by.original.url
=
http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
## mts
## mts
mts.region
=
cn-
hangzhou
mts.region
=
cn-
east-2
mts.endpoint
=
m
ts.cn-hangzhou.aliyuncs
.com
mts.endpoint
=
m
pc.cn-east-2.myhuaweicloud
.com
pipelineid
=
a63c988125054b07b1d3bd6e10c327de
pipelineid
=
a63c988125054b07b1d3bd6e10c327de
mp3TemplateId
=
d60210d2fd5bfcacce66238142437965
mts.projectId
=
07455135488025b22fe7c01fdb631c14
mp4TemplateId
=
67745f7eb8b7ca9bcf74d96c2364e6c1
mts.ak
=
8J56JHJN5P8OLR5ERKFU
mts.sk
=
xAlBYlowAhwa9c1Wi4JsX7XkZGFlzlWW3CBHdZWJ
mp3TemplateId
=
104257
mp4TemplateId
=
104256
m3u8TemplateId
=
283cd916aa504502b3704f3f5a45addc
m3u8TemplateId
=
283cd916aa504502b3704f3f5a45addc
mts.region.bj
=
cn-beijing
mts.region.bj
=
cn-beijing
...
@@ -32,10 +36,14 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
...
@@ -32,10 +36,14 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
## cdn
## cdn
file.domain.name
=
oss.5rs.me
file.domain.name
=
oss.5rs.me
file.cdn.url
=
https://oss.
5rs.me
/
file.cdn.url
=
https://oss.
raysyun.com
/
oss.cdn.urls
=
http://file.chubanyun.me/,http://file.techdc.cn/,https://file.raysyun.com/,http://file.raysgo.com/,http
s://file.5rs.me/,https://oss.5rs.me/,http://live.chubanyun.me/,https://download.5rs.me/,http://rays-adviser.chubanyun.me/,https://byfile.1wlshu.com
oss.cdn.urls
=
http://file.chubanyun.me/,http://file.techdc.cn/,https://file.raysyun.com/,http://file.raysgo.com/,http
://oss.raysgo.com/,https://file.5rs.me/,https://oss.5rs.me/,http://live.chubanyun.me/,https://download.5rs.me/,http://rays-adviser.chubanyun.me/,https://byfile.1wlshu.com/,https://byfile.raysgo.com/,https://oss.raysyun.com/
rays.cdn.urls
=
https://file.5rs.me/,https://oss.5rs.me/
rays.cdn.urls
=
https://file.5rs.me/,https://oss.5rs.me/
file.cdn.url.download
=
https://download.5rs.me/
file.cdn.url.download
=
https://download.5rs.me/
file.cdn.url.live
=
http://live.chubanyun.me/
file.cdn.url.live
=
http://live.chubanyun.me/
file.cdn.url.by
=
https://byfile.1wlshu.com
file.cdn.url.by
=
https://byfile.raysgo.com/
\ No newline at end of file
huawei.access.key
=
CROQ0IJRW2FW5NSERZBR
huawei.secret.key
=
rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
pcloud-common/pom.xml
View file @
0e78c657
<project
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<groupId>
com.pcloud.common
</groupId>
<groupId>
com.pcloud.common
</groupId>
<artifactId>
pcloud-common-parent
</artifactId>
<artifactId>
pcloud-common-parent
</artifactId>
<version>
2.1.0-RELEASE
</version>
<version>
2.1.0-RELEASE
</version>
</parent>
</parent>
<artifactId>
pcloud-common
</artifactId>
<artifactId>
pcloud-common
</artifactId>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<version>
${pcloud-common.version}
</version>
<version>
${pcloud-common.version}
</version>
<name>
pcloud-common
</name>
<name>
pcloud-common
</name>
<url>
http://maven.apache.org
</url>
<url>
http://maven.apache.org
</url>
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.pcloud.common
</groupId>
<groupId>
com.pcloud.common
</groupId>
<artifactId>
pcloud-common-config
</artifactId>
<artifactId>
pcloud-common-config
</artifactId>
<version>
${pcloud-common-config.version}
</version>
<version>
${pcloud-common-config.version}
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
</dependency>
<!-- Spring Boot Begin -->
<!-- Spring Boot Begin -->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
</dependency>
<!-- Spring Boot Begin -->
<!-- Spring Boot Begin -->
<!-- Spring Cloud Begin -->
<!-- Spring Cloud Begin -->
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-config
</artifactId>
<artifactId>
spring-cloud-starter-config
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-feign
</artifactId>
<artifactId>
spring-cloud-starter-feign
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-ribbon
</artifactId>
<artifactId>
spring-cloud-starter-ribbon
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-turbine
</artifactId>
<artifactId>
spring-cloud-starter-turbine
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-hystrix
</artifactId>
<artifactId>
spring-cloud-starter-hystrix
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-hystrix-dashboard
</artifactId>
<artifactId>
spring-cloud-starter-hystrix-dashboard
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.retry
</groupId>
<groupId>
org.springframework.retry
</groupId>
<artifactId>
spring-retry
</artifactId>
<artifactId>
spring-retry
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-stream-rabbit
</artifactId>
<artifactId>
spring-cloud-starter-stream-rabbit
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-sleuth
</artifactId>
<artifactId>
spring-cloud-starter-sleuth
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-zipkin
</artifactId>
<artifactId>
spring-cloud-starter-zipkin
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.micrometer
</groupId>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-spring-legacy
</artifactId>
<artifactId>
micrometer-spring-legacy
</artifactId>
<version>
1.0.0-rc.2
</version>
<version>
1.0.0-rc.2
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.micrometer
</groupId>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-registry-influx
</artifactId>
<artifactId>
micrometer-registry-influx
</artifactId>
<version>
1.0.0-rc.2
</version>
<version>
1.0.0-rc.2
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.7.0
</version>
<version>
2.7.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.7.0
</version>
<version>
2.7.0
</version>
</dependency>
</dependency>
<!-- Spring Cloud End -->
<!-- Spring Cloud End -->
<!-- Common Dependency Begin -->
<!-- Common Dependency Begin -->
<dependency>
<dependency>
<groupId>
cglib
</groupId>
<groupId>
cglib
</groupId>
<artifactId>
cglib
</artifactId>
<artifactId>
cglib
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-classic
</artifactId>
<artifactId>
logback-classic
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-core
</artifactId>
<artifactId>
logback-core
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-access
</artifactId>
<artifactId>
logback-access
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-lang
</groupId>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
<artifactId>
commons-lang
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
<groupId>
commons-beanutils
</groupId>
<artifactId>
commons-beanutils
</artifactId>
<artifactId>
commons-beanutils
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<artifactId>
commons-logging
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-io
</groupId>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<artifactId>
commons-io
</artifactId>
</dependency>
</dependency>
<dependency>
<!-- <dependency>
<groupId>
com.squareup.okhttp3
</groupId>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>
okhttp
</artifactId>
<artifactId>okhttp</artifactId>
</dependency>
<version>3.6.0</version>
</dependency>-->
<dependency>
<groupId>
commons-codec
</groupId>
<dependency>
<artifactId>
commons-codec
</artifactId>
<groupId>
commons-codec
</groupId>
</dependency>
<artifactId>
commons-codec
</artifactId>
<dependency>
</dependency>
<groupId>
commons-collections
</groupId>
<dependency>
<artifactId>
commons-collections
</artifactId>
<groupId>
commons-collections
</groupId>
</dependency>
<artifactId>
commons-collections
</artifactId>
<dependency>
</dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<dependency>
<artifactId>
httpclient
</artifactId>
<groupId>
org.apache.httpcomponents
</groupId>
</dependency>
<artifactId>
httpclient
</artifactId>
<dependency>
</dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<dependency>
<artifactId>
httpcore
</artifactId>
<groupId>
org.apache.httpcomponents
</groupId>
</dependency>
<artifactId>
httpcore
</artifactId>
<dependency>
</dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<dependency>
<artifactId>
httpmime
</artifactId>
<groupId>
org.apache.httpcomponents
</groupId>
</dependency>
<artifactId>
httpmime
</artifactId>
<dependency>
</dependency>
<groupId>
redis.clients
</groupId>
<dependency>
<artifactId>
jedis
</artifactId>
<groupId>
redis.clients
</groupId>
</dependency>
<artifactId>
jedis
</artifactId>
<dependency>
</dependency>
<groupId>
net.sourceforge.jexcelapi
</groupId>
<dependency>
<artifactId>
jxl
</artifactId>
<groupId>
net.sourceforge.jexcelapi
</groupId>
</dependency>
<artifactId>
jxl
</artifactId>
<dependency>
</dependency>
<groupId>
org.jdom
</groupId>
<dependency>
<artifactId>
jdom2
</artifactId>
<groupId>
org.jdom
</groupId>
</dependency>
<artifactId>
jdom2
</artifactId>
<dependency>
</dependency>
<groupId>
com.alibaba
</groupId>
<dependency>
<artifactId>
fastjson
</artifactId>
<groupId>
com.alibaba
</groupId>
</dependency>
<artifactId>
fastjson
</artifactId>
<!-- Common Dependency End -->
</dependency>
<!-- Common Dependency End -->
<!-- sftp begin -->
<dependency>
<!-- sftp begin -->
<groupId>
com.jcraft
</groupId>
<dependency>
<artifactId>
jsch
</artifactId>
<groupId>
com.jcraft
</groupId>
</dependency>
<artifactId>
jsch
</artifactId>
<!-- sftp end -->
</dependency>
<!-- sftp end -->
<!-- google Begin -->
<dependency>
<!-- google Begin -->
<groupId>
com.google.guava
</groupId>
<dependency>
<artifactId>
guava
</artifactId>
<groupId>
com.google.guava
</groupId>
</dependency>
<artifactId>
guava
</artifactId>
<!-- google End -->
</dependency>
<!-- google End -->
<!-- ftp begin -->
<dependency>
<!-- ftp begin -->
<groupId>
commons-net
</groupId>
<dependency>
<artifactId>
commons-net
</artifactId>
<groupId>
commons-net
</groupId>
<version>
3.4
</version>
<artifactId>
commons-net
</artifactId>
</dependency>
<version>
3.4
</version>
<!-- ftp end -->
</dependency>
<!-- ftp end -->
<!-- logback-json -->
<!-- by shichunshan 2016/09/18 -->
<!-- logback-json -->
<dependency>
<!-- by shichunshan 2016/09/18 -->
<groupId>
ch.qos.logback.contrib
</groupId>
<dependency>
<artifactId>
logback-json-core
</artifactId>
<groupId>
ch.qos.logback.contrib
</groupId>
</dependency>
<artifactId>
logback-json-core
</artifactId>
<dependency>
</dependency>
<groupId>
ch.qos.logback.contrib
</groupId>
<dependency>
<artifactId>
logback-json-classic
</artifactId>
<groupId>
ch.qos.logback.contrib
</groupId>
</dependency>
<artifactId>
logback-json-classic
</artifactId>
<dependency>
</dependency>
<groupId>
ch.qos.logback.contrib
</groupId>
<dependency>
<artifactId>
logback-jackson
</artifactId>
<groupId>
ch.qos.logback.contrib
</groupId>
</dependency>
<artifactId>
logback-jackson
</artifactId>
</dependency>
<dependency>
<groupId>
commons-pool
</groupId>
<dependency>
<artifactId>
commons-pool
</artifactId>
<groupId>
commons-pool
</groupId>
</dependency>
<artifactId>
commons-pool
</artifactId>
<dependency>
</dependency>
<groupId>
org.javassist
</groupId>
<dependency>
<artifactId>
javassist
</artifactId>
<groupId>
org.javassist
</groupId>
</dependency>
<artifactId>
javassist
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<groupId>
org.freemarker
</groupId>
<dependency>
<artifactId>
freemarker
</artifactId>
<groupId>
org.freemarker
</groupId>
</dependency>
<artifactId>
freemarker
</artifactId>
</dependency>
<!-- 图片处理工具 added by songx at 2017-05-17 -->
<dependency>
<!-- 图片处理工具 added by songx at 2017-05-17 -->
<groupId>
net.coobird
</groupId>
<dependency>
<artifactId>
thumbnailator
</artifactId>
<groupId>
net.coobird
</groupId>
</dependency>
<artifactId>
thumbnailator
</artifactId>
</dependency>
<!-- 压缩工具 added by songx at 2017-05-24 -->
<dependency>
<!-- 压缩工具 added by songx at 2017-05-24 -->
<groupId>
com.github.junrar
</groupId>
<dependency>
<artifactId>
junrar
</artifactId>
<groupId>
com.github.junrar
</groupId>
</dependency>
<artifactId>
junrar
</artifactId>
</dependency>
<!-- 二维码 added by songx at 2017-05-24 -->
<dependency>
<!-- 二维码 added by songx at 2017-05-24 -->
<groupId>
com.google.zxing
</groupId>
<dependency>
<artifactId>
core
</artifactId>
<groupId>
com.google.zxing
</groupId>
</dependency>
<artifactId>
core
</artifactId>
<dependency>
</dependency>
<groupId>
com.google.zxing
</groupId>
<dependency>
<artifactId>
javase
</artifactId>
<groupId>
com.google.zxing
</groupId>
</dependency>
<artifactId>
javase
</artifactId>
</dependency>
<!-- 影音转换工具jar add by gaop at 2017-6-9 16:50:19 -->
<dependency>
<!-- 影音转换工具jar add by gaop at 2017-6-9 16:50:19 -->
<groupId>
com.jave
</groupId>
<dependency>
<artifactId>
jave
</artifactId>
<groupId>
com.jave
</groupId>
<version>
1.0.3
</version>
<artifactId>
jave
</artifactId>
</dependency>
<version>
1.0.3
</version>
</dependency>
<!-- 阿里云媒体转码SDK包 added by songx at 2017-06-22 -->
<dependency>
<!-- 阿里云媒体转码SDK包 added by songx at 2017-06-22 -->
<groupId>
com.aliyun
</groupId>
<dependency>
<artifactId>
aliyun-java-sdk-core
</artifactId>
<groupId>
com.aliyun
</groupId>
</dependency>
<artifactId>
aliyun-java-sdk-core
</artifactId>
<dependency>
</dependency>
<groupId>
com.aliyun.oss
</groupId>
<dependency>
<artifactId>
aliyun-sdk-oss
</artifactId>
<groupId>
com.aliyun.oss
</groupId>
</dependency>
<artifactId>
aliyun-sdk-oss
</artifactId>
<dependency>
</dependency>
<groupId>
com.aliyun
</groupId>
<dependency>
<artifactId>
aliyun-java-sdk-mts
</artifactId>
<groupId>
com.aliyun
</groupId>
</dependency>
<artifactId>
aliyun-java-sdk-mts
</artifactId>
</dependency>
<!-- Jackson Begin -->
<!--华为云媒体转码SDK包 -->
<dependency>
<dependency>
<groupId>
org.codehaus.jackson
</groupId>
<groupId>
com.huawei.mpc
</groupId>
<artifactId>
jackson-mapper-asl
</artifactId>
<artifactId>
cloud-java-sdk-mpc
</artifactId>
</dependency>
</dependency>
<!-- Jackson End -->
<dependency>
<dependency>
<groupId>
com.squareup.retrofit2
</groupId>
<groupId>
jdom
</groupId>
<artifactId>
retrofit
</artifactId>
<artifactId>
jdom
</artifactId>
</dependency>
<version>
1.0
</version>
<dependency>
</dependency>
<groupId>
com.huaweicloud
</groupId>
<!-- Excel导出工具包 -->
<artifactId>
esdk-obs-java
</artifactId>
<dependency>
<version>
3.19.7
</version>
<groupId>
org.apache.poi
</groupId>
</dependency>
<artifactId>
poi
</artifactId>
<version>
3.16
</version>
<!-- Jackson Begin -->
</dependency>
<dependency>
<dependency>
<groupId>
org.codehaus.jackson
</groupId>
<groupId>
org.apache.poi
</groupId>
<artifactId>
jackson-mapper-asl
</artifactId>
<artifactId>
poi-ooxml
</artifactId>
</dependency>
<version>
3.16
</version>
<!-- Jackson End -->
</dependency>
<dependency>
<dependency>
<groupId>
jdom
</groupId>
<groupId>
org.apache.commons
</groupId>
<artifactId>
jdom
</artifactId>
<artifactId>
commons-collections4
</artifactId>
<version>
1.0
</version>
<version>
4.1
</version>
</dependency>
</dependency>
<!-- Excel导出工具包 -->
<!-- end -->
<dependency>
<groupId>
org.apache.poi
</groupId>
<!-- 文件编码 -->
<artifactId>
poi
</artifactId>
<dependency>
<version>
3.16
</version>
<groupId>
antlr
</groupId>
</dependency>
<artifactId>
antlr
</artifactId>
<dependency>
</dependency>
<groupId>
org.apache.poi
</groupId>
<dependency>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
com.chardet
</groupId>
<version>
3.16
</version>
<artifactId>
chardet
</artifactId>
</dependency>
<version>
1.0
</version>
<dependency>
</dependency>
<groupId>
org.apache.commons
</groupId>
<dependency>
<artifactId>
commons-collections4
</artifactId>
<groupId>
com.cpdetector
</groupId>
<version>
4.1
</version>
<artifactId>
cpdetector
</artifactId>
</dependency>
<version>
1.0.10
</version>
<!-- end -->
</dependency>
<!-- END -->
<!-- 文件编码 -->
<dependency>
<!-- 生成PDF -->
<groupId>
antlr
</groupId>
<dependency>
<artifactId>
antlr
</artifactId>
<groupId>
com.itextpdf
</groupId>
</dependency>
<artifactId>
itextpdf
</artifactId>
<dependency>
<version>
5.5.12
</version>
<groupId>
com.chardet
</groupId>
</dependency>
<artifactId>
chardet
</artifactId>
<dependency>
<version>
1.0
</version>
<groupId>
com.itextpdf
</groupId>
</dependency>
<artifactId>
itext-asian
</artifactId>
<dependency>
<version>
5.2.0
</version>
<groupId>
com.cpdetector
</groupId>
</dependency>
<artifactId>
cpdetector
</artifactId>
<version>
1.0.10
</version>
<!-- 生成WORD -->
</dependency>
<dependency>
<!-- END -->
<groupId>
com.lowagie
</groupId>
<artifactId>
itext
</artifactId>
<!-- 生成PDF -->
<version>
2.1.7
</version>
<dependency>
</dependency>
<groupId>
com.itextpdf
</groupId>
<dependency>
<artifactId>
itextpdf
</artifactId>
<groupId>
com.lowagie
</groupId>
<version>
5.5.12
</version>
<artifactId>
itext-rtf
</artifactId>
</dependency>
<version>
2.1.7
</version>
<dependency>
</dependency>
<groupId>
com.itextpdf
</groupId>
<dependency>
<artifactId>
itext-asian
</artifactId>
<groupId>
com.lowagie
</groupId>
<version>
5.2.0
</version>
<artifactId>
itext-asian
</artifactId>
</dependency>
<version>
1.5.2
</version>
</dependency>
<!-- 生成WORD -->
<dependency>
<groupId>
com.lowagie
</groupId>
<artifactId>
itext
</artifactId>
<dependency>
<version>
2.1.7
</version>
<groupId>
com.github.jai-imageio
</groupId>
</dependency>
<artifactId>
jai-imageio-jpeg2000
</artifactId>
<dependency>
<version>
1.3.0
</version>
<groupId>
com.lowagie
</groupId>
</dependency>
<artifactId>
itext-rtf
</artifactId>
<version>
2.1.7
</version>
<dependency>
</dependency>
<groupId>
com.levigo.jbig2
</groupId>
<dependency>
<artifactId>
levigo-jbig2-imageio
</artifactId>
<groupId>
com.lowagie
</groupId>
<version>
2.0
</version>
<artifactId>
itext-asian
</artifactId>
</dependency>
<version>
1.5.2
</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<dependency>
</dependency>
<groupId>
com.github.jai-imageio
</groupId>
<artifactId>
jai-imageio-jpeg2000
</artifactId>
<!-- util sdk -->
<version>
1.3.0
</version>
<dependency>
</dependency>
<groupId>
com.dcg.sdk
</groupId>
<artifactId>
util-sdk
</artifactId>
<dependency>
<version>
1.0.1
</version>
<groupId>
com.levigo.jbig2
</groupId>
</dependency>
<artifactId>
levigo-jbig2-imageio
</artifactId>
<version>
2.0
</version>
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<!-- lombok -->
<artifactId>
hutool-all
</artifactId>
<dependency>
<version>
5.3.2
</version>
<groupId>
org.projectlombok
</groupId>
</dependency>
<artifactId>
lombok
</artifactId>
</dependency>
</dependencies>
<!-- util sdk -->
</project>
<dependency>
<groupId>
com.dcg.sdk
</groupId>
<artifactId>
util-sdk
</artifactId>
<version>
1.0.1
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.3.2
</version>
</dependency>
</dependencies>
</project>
pcloud-common/src/main/java/com/pcloud/common/constant/AliyunConstant.java
View file @
0e78c657
package
com
.
pcloud
.
common
.
constant
;
package
com
.
pcloud
.
common
.
constant
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.utils.FileUtils
;
import
com.pcloud.common.utils.FileUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
/**
/**
*
*
*
*
* @author:songx
* @author:songx
* @date:2018年6月25日,下午7:30:21
* @date:2018年6月25日,下午7:30:21
*/
*/
@Component
(
"aliyunConstant"
)
@Component
(
"aliyunConstant"
)
@PropertySource
(
value
=
{
"classpath:aliyun.properties"
})
@PropertySource
(
value
=
{
"classpath:aliyun.properties"
})
public
class
AliyunConstant
{
public
class
AliyunConstant
{
/**
/**
* 主账号keyId
* 主账号keyId,华为云ak
*/
*/
public
static
String
MAIN_ACCESS_KEY_ID
;
public
static
String
MAIN_ACCESS_KEY_ID
;
@Value
(
"${main.access.key.id}"
)
@Value
(
"${main.access.key.id}"
)
public
void
setMainAccessKeyId
(
String
mainAccessKeyId
)
{
public
void
setMainAccessKeyId
(
String
mainAccessKeyId
)
{
MAIN_ACCESS_KEY_ID
=
mainAccessKeyId
;
MAIN_ACCESS_KEY_ID
=
mainAccessKeyId
;
}
}
/**
/**
* 主账号keySecret
* 主账号keySecret 华为云sk
*/
*/
public
static
String
MAIN_ACCESS_KEY_SECRET
;
public
static
String
MAIN_ACCESS_KEY_SECRET
;
@Value
(
"${main.access.key.secret}"
)
@Value
(
"${main.access.key.secret}"
)
public
void
setMainAccessKeySecret
(
String
mainAccessKeySecret
)
{
public
void
setMainAccessKeySecret
(
String
mainAccessKeySecret
)
{
MAIN_ACCESS_KEY_SECRET
=
mainAccessKeySecret
;
MAIN_ACCESS_KEY_SECRET
=
mainAccessKeySecret
;
}
}
/**
/**
* 媒体转码,华东地区
* 媒体转码,华东地区
*/
*/
public
static
String
MTS_REGION
;
public
static
String
MTS_REGION
;
@Value
(
"${mts.region}"
)
@Value
(
"${mts.region}"
)
public
void
setMtsRegion
(
String
mtsRegion
)
{
public
void
setMtsRegion
(
String
mtsRegion
)
{
MTS_REGION
=
mtsRegion
;
MTS_REGION
=
mtsRegion
;
}
}
/**
/**
* 媒体转码,华北地区
* 媒体转码,华北地区
*/
*/
public
static
String
MTS_REGION_BJ
;
public
static
String
MTS_REGION_BJ
;
@Value
(
"${mts.region.bj}"
)
@Value
(
"cn-north-4"
)
public
void
setMtsRegionBj
(
String
mtsRegionBj
)
{
public
void
setMtsRegionBj
(
String
mtsRegionBj
)
{
MTS_REGION_BJ
=
mtsRegionBj
;
MTS_REGION_BJ
=
mtsRegionBj
;
}
}
/**
/**
* OSS,华东地区
* OSS,华东地区
*/
*/
public
static
String
OSS_REGION
;
public
static
String
OSS_REGION
;
@Value
(
"${oss.region}"
)
@Value
(
"${oss.region}"
)
public
void
setOssRegion
(
String
ossRegion
)
{
public
void
setOssRegion
(
String
ossRegion
)
{
OSS_REGION
=
ossRegion
;
OSS_REGION
=
ossRegion
;
}
}
/**
/**
* OSS,华北地区
* OSS,华北地区
*/
*/
public
static
String
OSS_REGION_BJ
;
public
static
String
OSS_REGION_BJ
;
@Value
(
"${oss.region.bj}"
)
@Value
(
"cn-north-4"
)
public
void
setOssRegionBj
(
String
ossRegionBj
)
{
public
void
setOssRegionBj
(
String
ossRegionBj
)
{
OSS_REGION_BJ
=
ossRegionBj
;
OSS_REGION_BJ
=
ossRegionBj
;
}
}
/**
/**
* OSS endpoind地址(华东地区1)
* OSS endpoind地址(华东地区1)
*/
*/
public
static
String
OSS_ENDPOINT
;
public
static
String
OSS_ENDPOINT
;
@Value
(
"${oss.endpoint}"
)
@Value
(
"${oss.endpoint}"
)
public
void
setOssEndpoint
(
String
ossEndpoint
)
{
public
void
setOssEndpoint
(
String
ossEndpoint
)
{
OSS_ENDPOINT
=
ossEndpoint
;
OSS_ENDPOINT
=
ossEndpoint
;
}
}
/**
/**
* OSS endpoind地址(华北地区1)
* OSS endpoind地址(华北地区1)
*/
*/
public
static
String
OSS_ENDPOINT_BJ
;
public
static
String
OSS_ENDPOINT_BJ
;
@Value
(
"${oss.endpoint.bj}"
)
@Value
(
"${oss.endpoint.bj}"
)
public
void
setOssEndpointBj
(
String
ossEndpointBj
)
{
public
void
setOssEndpointBj
(
String
ossEndpointBj
)
{
OSS_ENDPOINT_BJ
=
ossEndpointBj
;
OSS_ENDPOINT_BJ
=
ossEndpointBj
;
}
}
/**
/**
* 媒体转码endpoind地址,华东地区
* 媒体转码endpoind地址,华东地区
*/
*/
public
static
String
MTS_ENDPOINT
;
public
static
String
MTS_ENDPOINT
;
@Value
(
"${mts.endpoint}"
)
@Value
(
"${mts.endpoint}"
)
public
void
setMtsEndpoint
(
String
mtsEndpoint
)
{
public
void
setMtsEndpoint
(
String
mtsEndpoint
)
{
MTS_ENDPOINT
=
mtsEndpoint
;
MTS_ENDPOINT
=
mtsEndpoint
;
}
}
/**
/**
* 媒体转码endpoind地址,华北地区
* 媒体转码endpoind地址,华北地区
*/
*/
public
static
String
MTS_ENDPOINT_BJ
;
public
static
String
MTS_ENDPOINT_BJ
;
@Value
(
"${mts.endpoint.bj}"
)
@Value
(
"live.cn-north-4.myhuaweicloud.com"
)
public
void
setMtsEndpointBj
(
String
mtsEndpointBj
)
{
public
void
setMtsEndpointBj
(
String
mtsEndpointBj
)
{
MTS_ENDPOINT_BJ
=
mtsEndpointBj
;
MTS_ENDPOINT_BJ
=
mtsEndpointBj
;
}
}
/**
/**
* 管道ID
* 管道ID
*/
*/
public
static
String
PIPELINEID
;
public
static
String
PIPELINEID
;
@Value
(
"${pipelineid}"
)
@Value
(
"${pipelineid}"
)
public
void
setPipelineid
(
String
pipelineid
)
{
public
void
setPipelineid
(
String
pipelineid
)
{
PIPELINEID
=
pipelineid
;
PIPELINEID
=
pipelineid
;
}
}
/**
/**
* 管道ID(华北地区)
* 管道ID(华北地区)
*/
*/
public
static
String
PIPELINEID_BJ
;
public
static
String
PIPELINEID_BJ
;
@Value
(
"${pipelineid.bj}"
)
@Value
(
"${pipelineid.bj}"
)
public
void
setPipelineidBj
(
String
pipelineidBj
)
{
public
void
setPipelineidBj
(
String
pipelineidBj
)
{
PIPELINEID_BJ
=
pipelineidBj
;
PIPELINEID_BJ
=
pipelineidBj
;
}
}
/**
/**
* 转MP3模板ID
* 设置用户项目编号ProjectId
*/
*/
public
static
String
MP3_TEMPLATE_ID
;
public
static
String
PROJECT_ID
;
@Value
(
"${mp3TemplateId}"
)
@Value
(
"${mts.projectId}"
)
public
void
setMp3TemplateId
(
String
mp3TemplateId
)
{
public
void
setProjectId
(
String
projectId
)
{
MP3_TEMPLATE_ID
=
mp3TemplateId
;
PROJECT_ID
=
projectId
;
}
}
/**
/**
* 转MP3模板ID(华北地区)
* 转MP3模板ID
*/
*/
public
static
String
MP3_TEMPLATE_ID_BJ
;
public
static
String
MP3_TEMPLATE_ID
;
@Value
(
"${mp3TemplateId.bj}"
)
@Value
(
"${mp3TemplateId}"
)
public
void
setMp3TemplateIdBj
(
String
mp3TemplateIdBj
)
{
public
void
setMp3TemplateId
(
String
mp3TemplateId
)
{
MP3_TEMPLATE_ID_BJ
=
mp3TemplateIdBj
;
MP3_TEMPLATE_ID
=
mp3TemplateId
;
}
}
/**
/**
* 转M3U8模板ID
* 转MP3模板ID(华北地区)
*/
*/
public
static
String
M3U8_TEMPLATE_ID
;
public
static
String
MP3_TEMPLATE_ID_BJ
;
@Value
(
"${m3u8TemplateId}"
)
@Value
(
"${mp3TemplateId.bj}"
)
public
void
setM3u8TemplateId
(
String
m3u8TemplateId
)
{
public
void
setMp3TemplateIdBj
(
String
mp3TemplateIdBj
)
{
M3U8_TEMPLATE_ID
=
m3u8TemplateId
;
MP3_TEMPLATE_ID_BJ
=
mp3TemplateIdBj
;
}
}
/**
/**
* 转MP4模板ID
* 转M3U8模板ID
*/
*/
public
static
String
MP4_TEMPLATE_ID
;
public
static
String
M3U8_TEMPLATE_ID
;
@Value
(
"${mp4TemplateId}"
)
@Value
(
"${m3u8TemplateId}"
)
public
void
setMp4TemplateId
(
String
mp4TemplateId
)
{
public
void
setM3u8TemplateId
(
String
m3u8TemplateId
)
{
MP4_TEMPLATE_ID
=
mp4TemplateId
;
M3U8_TEMPLATE_ID
=
m3u8TemplateId
;
}
}
/**
/**
* 转MP4模板ID(华北地区)
* 转MP4模板ID
*/
*/
public
static
String
MP4_TEMPLATE_ID_BJ
;
public
static
String
MP4_TEMPLATE_ID
;
@Value
(
"${mp4TemplateId}"
)
@Value
(
"${mp4TemplateId}"
)
public
void
setMp4TemplateIdBj
(
String
mp4TemplateIdBj
)
{
public
void
setMp4TemplateId
(
String
mp4TemplateId
)
{
MP4_TEMPLATE_ID_BJ
=
mp4TemplateIdBj
;
MP4_TEMPLATE_ID
=
mp4TemplateId
;
}
}
/**
/**
* OSS存储输入地址
* 转MP4模板ID(华北地区)
*/
*/
public
static
final
String
INPUT_BUCKET
=
"whlg-oss-001"
;
public
static
String
MP4_TEMPLATE_ID_BJ
;
/**
@Value
(
"125799"
)
* OSS存储输出地址
public
void
setMp4TemplateIdBj
(
String
mp4TemplateIdBj
)
{
*/
MP4_TEMPLATE_ID_BJ
=
mp4TemplateIdBj
;
public
static
String
FILE_BUCKET
;
}
@Value
(
"${file.bucket}"
)
/**
public
void
setFileBucket
(
String
fileBucket
)
{
* OSS存储输入地址
FILE_BUCKET
=
fileBucket
;
*/
}
public
static
String
INPUT_BUCKET
;
/**
@Value
(
"${input.bucket}"
)
* 直播OSS存储输出地址,开发环境
public
void
setInputBucket
(
String
imputBucket
)
{
*/
INPUT_BUCKET
=
imputBucket
;
public
static
String
LIVE_BUCKET
;
}
@Value
(
"${live.bucket}"
)
/**
public
void
setLiveBucket
(
String
liveBucket
)
{
* OSS存储输出地址
LIVE_BUCKET
=
liveBucket
;
*/
}
public
static
String
FILE_BUCKET
;
/**
@Value
(
"${file.bucket}"
)
* IOS直播OSS存储输出地址,开发环境
public
void
setFileBucket
(
String
fileBucket
)
{
*/
FILE_BUCKET
=
fileBucket
;
public
static
final
String
IOS_TEST_BUCKET
=
"whlg-oss-iostest"
;
}
/**
/**
* 版元存储输出地址
* 直播OSS存储输出地址,开发环境
*/
*/
public
static
final
String
BY_BUCKET
=
"byfile-oss-01"
;
public
static
String
LIVE_BUCKET
;
/**
@Value
(
"${live.bucket}"
)
* 开发存储输出地址
public
void
setLiveBucket
(
String
liveBucket
)
{
*/
LIVE_BUCKET
=
liveBucket
;
public
static
final
String
DEV_BUCKET
=
"whlg-oss-dev"
;
}
/**
/**
* 测试存储输出地址
* IOS直播OSS存储输出地址,开发环境
*/
*/
public
static
final
String
TEST_BUCKET
=
"whlg-oss-test"
;
public
static
final
String
IOS_TEST_BUCKET
=
"whlg-oss-iostest"
;
/**
/**
* UAT存储输出地址
* 版元存储输出地址
*/
*/
public
static
final
String
UAT_BUCKET
=
"whlg-oss-uat"
;
public
static
String
BY_BUCKET
;
/**
@Value
(
"${by.bucket}"
)
* OSS 鉴权KEY(仅限下载用)
public
void
setByBucket
(
String
byBucket
){
*/
BY_BUCKET
=
byBucket
;
public
static
final
String
OSS_PRIVATE_KEY
=
"WhlgFileDownload1608"
;
}
/**
/**
* OSS 鉴权默认有效时间
* 开发存储输出地址
*/
*/
public
static
final
int
OSS_DEFAULT_TIME
=
48
*
60
*
60
;
public
static
final
String
DEV_BUCKET
=
"whlg-oss-dev-002"
;
/**
/**
* OSS 鉴权长期有效,50年
* 测试存储输出地址
*/
*/
public
static
final
int
OSS_LONG_TIME
=
50
*
365
*
24
*
60
*
60
;
public
static
final
String
TEST_BUCKET
=
"whlg-oss-test-002"
;
/**
/**
* RAYS OSS的域名
* UAT存储输出地址
*/
*/
public
static
String
[]
RAYS_CDN_URLS
;
public
static
final
String
UAT_BUCKET
=
"whlg-oss-uat-002"
;
@Value
(
"${rays.cdn.urls}"
)
/**
public
void
setRaysCdnUrls
(
String
raysCdnUrls
)
{
* OSS 鉴权KEY(仅限下载用)
RAYS_CDN_URLS
=
raysCdnUrls
.
split
(
","
);
*/
}
public
static
final
String
OSS_PRIVATE_KEY
=
"WhlgFileDownload1608"
;
/**
/**
* oss FILE域名,HTTPS
* OSS 鉴权默认有效时间
*/
*/
public
static
String
[]
OSS_CDN_URLS
;
public
static
final
int
OSS_DEFAULT_TIME
=
48
*
60
*
60
;
@Value
(
"${oss.cdn.urls}"
)
/**
public
void
setOssCdnUrls
(
String
ossCdnUrls
)
{
* OSS 鉴权长期有效,50年
OSS_CDN_URLS
=
ossCdnUrls
.
split
(
","
);
*/
}
public
static
final
int
OSS_LONG_TIME
=
50
*
365
*
24
*
60
*
60
;
/**
/**
* OSS CDN域名,HTTPS
* RAYS OSS的域名
*/
*/
public
static
String
FILE_CDN_URL
;
public
static
String
[]
RAYS_CDN_URLS
;
@Value
(
"${file.cdn.url}"
)
@Value
(
"${rays.cdn.urls}"
)
public
void
setFileCdnUrl
(
String
fileCdnUrl
)
{
public
void
setRaysCdnUrls
(
String
raysCdnUrls
)
{
FILE_CDN_URL
=
fileCdnUrl
;
RAYS_CDN_URLS
=
raysCdnUrls
.
split
(
","
);
}
}
/**
/**
* OSS CDN域名,HTTPS(直播)
* oss FILE域名,HTTPS
*/
*/
public
static
String
FILE_CDN_URL_LIVE
;
public
static
String
[]
OSS_CDN_URLS
;
@Value
(
"${file.cdn.url.live}"
)
@Value
(
"${oss.cdn.urls}"
)
public
void
setFileCdnUrlLive
(
String
fileCdnUrlLive
)
{
public
void
setOssCdnUrls
(
String
ossCdnUrls
)
{
FILE_CDN_URL_LIVE
=
fileCdnUrlLive
;
OSS_CDN_URLS
=
ossCdnUrls
.
split
(
","
);
}
}
/**
/**
* OSS CDN域名,HTTPS(直播)
* OSS CDN域名,HTTPS
*/
*/
public
static
String
FILE_CDN_URL_BY
;
public
static
String
FILE_CDN_URL
;
@Value
(
"${file.cdn.url.by}"
)
@Value
(
"${file.cdn.url}"
)
public
void
setFileCdnUrlBy
(
String
fileCdnUrlBy
)
{
public
void
setFileCdnUrl
(
String
fileCdnUrl
)
{
FILE_CDN_URL_BY
=
fileCdnUrlBy
;
FILE_CDN_URL
=
fileCdnUrl
;
}
}
/**
/**
* OSS CDN域名(下载使用)
* OSS CDN域名,HTTPS(直播)
*/
*/
public
static
String
FILE_CDN_URL_DOWNLOAD
;
public
static
String
FILE_CDN_URL_LIVE
;
@Value
(
"${file.cdn.url.download}"
)
@Value
(
"${file.cdn.url.live}"
)
public
void
setFileCdnUrlDownload
(
String
fileCdnUrlDownload
)
{
public
void
setFileCdnUrlLive
(
String
fileCdnUrlLive
)
{
FILE_CDN_URL_DOWNLOAD
=
fileCdnUrlDownload
;
FILE_CDN_URL_LIVE
=
fileCdnUrlLive
;
}
}
/**
/**
* OSS 原始文件路径
* OSS CDN域名,HTTPS(直播)
*/
*/
public
static
String
FILE_ORIGINAL_URL
;
public
static
String
FILE_CDN_URL_BY
;
@Value
(
"${file.original.url}"
)
@Value
(
"${file.cdn.url.by}"
)
public
void
setFileOriginalUrl
(
String
fileOriginalUrl
)
{
public
void
setFileCdnUrlBy
(
String
fileCdnUrlBy
)
{
FILE_ORIGINAL_URL
=
fileOriginalUrl
;
FILE_CDN_URL_BY
=
fileCdnUrlBy
;
}
}
/**
/**
* OSS 原始文件路径(直播)
* OSS CDN域名(下载使用)
*/
*/
public
static
String
LIVE_ORIGINAL_URL
;
public
static
String
FILE_CDN_URL_DOWNLOAD
;
@Value
(
"${live.original.url}"
)
@Value
(
"${file.cdn.url.download}"
)
public
void
setLiveOriginalUrl
(
String
liveOriginalUrl
)
{
public
void
setFileCdnUrlDownload
(
String
fileCdnUrlDownload
)
{
LIVE_ORIGINAL_URL
=
liveOriginalUrl
;
FILE_CDN_URL_DOWNLOAD
=
fileCdnUrlDownload
;
}
}
/**
/**
* OSS 原始文件路径(版元)
* OSS 原始文件路径
*/
*/
public
static
String
BY_ORIGINAL_URL
;
public
static
String
FILE_ORIGINAL_URL
;
@Value
(
"${by.original.url}"
)
@Value
(
"${file.original.url}"
)
public
void
setByOriginalUrl
(
String
byOriginalUrl
)
{
public
void
setFileOriginalUrl
(
String
fileOriginalUrl
)
{
BY_ORIGINAL_URL
=
byOriginalUrl
;
FILE_ORIGINAL_URL
=
fileOriginalUrl
;
}
}
/**
/**
* 视频水印模板ID-左下角
* OSS 原始文件路径(直播)
*/
*/
public
static
final
String
WATERMARK_BOTTOM_LEFT
=
"cb8fe5517c5a44c19284cdf130dd223d"
;
public
static
String
LIVE_ORIGINAL_URL
;
/**
@Value
(
"${live.original.url}"
)
* 根据域名获取bucket名称
public
void
setLiveOriginalUrl
(
String
liveOriginalUrl
)
{
*
LIVE_ORIGINAL_URL
=
liveOriginalUrl
;
* @param fileUrl
}
* @return
*/
/**
public
static
String
getBucketName
(
String
fileUrl
)
{
* OSS 原始文件路径(版元)
if
(
StringUtil
.
isEmpty
(
fileUrl
))
{
*/
return
null
;
public
static
String
BY_ORIGINAL_URL
;
}
String
domainName
=
FileUtils
.
getDomainName
(
fileUrl
);
@Value
(
"${by.original.url}"
)
if
(
domainName
==
null
)
{
public
void
setByOriginalUrl
(
String
byOriginalUrl
)
{
return
INPUT_BUCKET
;
BY_ORIGINAL_URL
=
byOriginalUrl
;
}
}
switch
(
domainName
)
{
case
"file.chubanyun.me"
:
return
DEV_BUCKET
;
/**
case
"file.techdc.cn"
:
* 华为云转码ak
case
"file.raysgo.com"
:
*/
return
TEST_BUCKET
;
public
static
String
MtsAK
;
case
"file.raysyun.com"
:
return
UAT_BUCKET
;
@Value
(
"${mts.ak}"
)
case
"live.chubanyun.me"
:
public
void
setMtsAK
(
String
mtsAK
)
{
return
LIVE_BUCKET
;
MtsAK
=
mtsAK
;
case
"rays-adviser.chubanyun.me"
:
}
return
IOS_TEST_BUCKET
;
case
"byfile.1wlshu.com"
:
/**
case
"byfile.raysgo.com"
:
* 华为云转码sk
return
BY_BUCKET
;
*/
case
"file.5rs.me"
:
public
static
String
MtsSK
;
case
"oss.5rs.me"
:
case
"download.5rs.me"
:
@Value
(
"${mts.sk}"
)
return
FILE_BUCKET
;
public
void
setMtsSK
(
String
mtsSK
)
{
default
:
MtsSK
=
mtsSK
;
return
INPUT_BUCKET
;
}
}
}
/**
/**
* 视频水印模板ID-左下角
* 获取OSS地域名称
*/
*
public
static
final
String
WATERMARK_BOTTOM_LEFT
=
"cb8fe5517c5a44c19284cdf130dd223d"
;
* @param bucketName
* @return
*/
/**
public
static
String
getOssRegion
(
String
bucketName
)
{
* 华为云Access Key
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
*/
return
null
;
public
static
String
ACCESS_KEY
;
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
@Value
(
"${huawei.access.key}"
)
return
OSS_REGION_BJ
;
public
void
setAccessKey
(
String
accessKey
)
{
else
ACCESS_KEY
=
accessKey
;
return
OSS_REGION
;
}
}
/**
/**
* 华为云 Secret Key
* 获取媒体转码地域名称
*/
*
public
static
String
SECRET_KEY
;
* @param bucketName
* @return
@Value
(
"${huawei.secret.key}"
)
*/
public
static
void
setSecretKey
(
String
secretKey
)
{
public
static
String
getMtsRegion
(
String
bucketName
)
{
SECRET_KEY
=
secretKey
;
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
}
return
null
;
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
/**
return
MTS_REGION_BJ
;
* 根据域名获取bucket名称
else
*
return
MTS_REGION
;
* @param fileUrl
}
* @return
*/
/**
public
static
String
getBucketName
(
String
fileUrl
)
{
* 获取媒体转码EndPoint
if
(
StringUtil
.
isEmpty
(
fileUrl
))
{
*
return
null
;
* @param bucketName
}
* @return
if
(
fileUrl
.
contains
(
"transcode"
)){
*/
return
FILE_BUCKET
;
public
static
String
getMtsEndPoint
(
String
bucketName
)
{
}
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
String
domainName
=
FileUtils
.
getDomainName
(
fileUrl
);
return
null
;
if
(
StringUtil
.
isEmpty
(
domainName
))
{
}
return
INPUT_BUCKET
;
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
}
return
MTS_ENDPOINT_BJ
;
//不根据域名判断
else
switch
(
domainName
)
{
return
MTS_ENDPOINT
;
// case "file.chubanyun.me":
}
// return DEV_BUCKET;
// case "file.techdc.cn":
/**
// case "file.raysgo.com":
* 获取OSS输出bucket
// case "oss.raysgo.com":
*
// return TEST_BUCKET;
* @param bucketName
// case "file.raysyun.com":
* @return
// return UAT_BUCKET;
*/
case
"live.chubanyun.me"
:
public
static
String
getOutBucket
(
String
bucketName
)
{
return
LIVE_BUCKET
;
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
case
"rays-adviser.chubanyun.me"
:
return
null
;
return
IOS_TEST_BUCKET
;
}
case
"byfile.1wlshu.com"
:
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
case
"byfile.raysgo.com"
:
return
LIVE_BUCKET
;
return
BY_BUCKET
;
else
if
(
BY_BUCKET
.
equals
(
bucketName
))
// case "file.5rs.me":
return
BY_BUCKET
;
// case "oss.5rs.me":
else
// case "download.5rs.me":
return
FILE_BUCKET
;
// return FILE_BUCKET;
}
default
:
return
FILE_BUCKET
;
/**
}
* 获取转码管道ID
}
*
* @param bucketName
/**
* @return
* 获取OSS地域名称
*/
*
public
static
String
getPipelineId
(
String
bucketName
)
{
* @param bucketName
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
* @return
return
null
;
*/
}
public
static
String
getOssRegion
(
String
bucketName
)
{
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
return
PIPELINEID_BJ
;
return
null
;
else
}
return
PIPELINEID
;
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
}
return
OSS_REGION_BJ
;
}
else
{
/**
return
OSS_REGION
;
* 获取MP3转码模板ID
}
*
}
* @param bucketName
* @return
/**
*/
* 获取媒体转码地域名称
public
static
String
getMp3TemplateId
(
String
bucketName
)
{
*
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
* @param bucketName
return
null
;
* @return
}
*/
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
public
static
String
getMtsRegion
(
String
bucketName
)
{
return
MP3_TEMPLATE_ID_BJ
;
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
else
return
null
;
return
MP3_TEMPLATE_ID
;
}
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
return
MTS_REGION_BJ
;
/**
}
else
{
* 获取MP4转码模板ID
return
MTS_REGION
;
*
}
* @param bucketName
}
* @return
*/
/**
public
static
String
getMp4TemplateId
(
String
bucketName
)
{
* 获取媒体转码EndPoint
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
*
return
null
;
* @param bucketName
}
* @return
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
*/
return
MP4_TEMPLATE_ID_BJ
;
public
static
String
getMtsEndPoint
(
String
bucketName
)
{
else
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
return
MP4_TEMPLATE_ID
;
return
null
;
}
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
/**
return
MTS_ENDPOINT_BJ
;
* 获取视频转码模板ID
}
else
{
*
return
MTS_ENDPOINT
;
* @param bucketName
}
* @return
}
*/
public
static
String
getVideoTemplateId
(
String
bucketName
,
String
outFileType
)
{
/**
if
(
StringUtil
.
isEmpty
(
outFileType
))
{
* 获取OSS输出bucket
return
null
;
*
}
* @param bucketName
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
* @return
return
MP4_TEMPLATE_ID_BJ
;
*/
else
if
(
"m3u8"
.
equalsIgnoreCase
(
outFileType
))
public
static
String
getOutBucket
(
String
bucketName
)
{
return
M3U8_TEMPLATE_ID
;
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
else
return
null
;
return
MP4_TEMPLATE_ID
;
}
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
return
LIVE_BUCKET
;
/**
}
else
if
(
BY_BUCKET
.
equals
(
bucketName
))
{
* 获取文件CDN地址
return
BY_BUCKET
;
*
}
else
{
* @param bucketName
return
FILE_BUCKET
;
* @return
}
*/
}
public
static
String
getOSSCDNUrl
(
String
bucketName
)
{
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
/**
return
null
;
* 获取转码管道ID
}
*
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
* @param bucketName
return
FILE_CDN_URL_LIVE
;
* @return
else
if
(
BY_BUCKET
.
equals
(
bucketName
))
*/
return
FILE_CDN_URL_BY
;
public
static
String
getPipelineId
(
String
bucketName
)
{
else
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
return
FILE_CDN_URL
;
return
null
;
}
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
/**
return
PIPELINEID_BJ
;
* 获取OSS原始地址
}
else
{
*
return
PIPELINEID
;
* @param bucketName
}
* @return
}
*/
public
static
String
getOSSOriginalUrl
(
String
bucketName
)
{
/**
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
* 获取MP3转码模板ID
return
null
;
*
}
* @param bucketName
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
* @return
return
LIVE_ORIGINAL_URL
;
*/
else
if
(
BY_BUCKET
.
equals
(
bucketName
))
public
static
String
getMp3TemplateId
(
String
bucketName
)
{
return
BY_ORIGINAL_URL
;
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
else
return
null
;
return
FILE_ORIGINAL_URL
;
}
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
return
MP3_TEMPLATE_ID_BJ
;
/**
}
else
{
* 获取OSS EndPoint地址
return
MP3_TEMPLATE_ID
;
*
}
* @param bucketName
}
* @return
*/
/**
public
static
String
getOSSEndPoint
(
String
bucketName
)
{
* 获取MP4转码模板ID
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
*
return
null
;
* @param bucketName
}
* @return
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
*/
return
OSS_ENDPOINT_BJ
;
public
static
String
getMp4TemplateId
(
String
bucketName
)
{
else
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
return
OSS_ENDPOINT
;
return
null
;
}
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
}
return
MP4_TEMPLATE_ID_BJ
;
}
else
{
return
MP4_TEMPLATE_ID
;
}
}
/**
* 获取视频转码模板ID
*
* @param bucketName
* @return
*/
public
static
String
getVideoTemplateId
(
String
bucketName
,
String
outFileType
)
{
if
(
StringUtil
.
isEmpty
(
outFileType
))
{
return
null
;
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
return
MP4_TEMPLATE_ID_BJ
;
}
else
if
(
"m3u8"
.
equalsIgnoreCase
(
outFileType
))
{
return
M3U8_TEMPLATE_ID
;
}
else
{
return
MP4_TEMPLATE_ID
;
}
}
/**
* 获取文件CDN地址
*
* @param bucketName
* @return
*/
public
static
String
getOSSCDNUrl
(
String
bucketName
)
{
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
return
null
;
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
return
FILE_CDN_URL_LIVE
;
}
else
if
(
BY_BUCKET
.
equals
(
bucketName
))
{
return
FILE_CDN_URL_BY
;
}
else
{
return
FILE_CDN_URL
;
}
}
/**
* 获取OSS原始地址
*
* @param bucketName
* @return
*/
public
static
String
getOSSOriginalUrl
(
String
bucketName
)
{
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
return
null
;
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
return
LIVE_ORIGINAL_URL
;
}
else
if
(
BY_BUCKET
.
equals
(
bucketName
))
{
return
BY_ORIGINAL_URL
;
}
else
{
return
FILE_ORIGINAL_URL
;
}
}
/**
* 获取OSS EndPoint地址
*
* @param bucketName
* @return
*/
public
static
String
getOSSEndPoint
(
String
bucketName
)
{
if
(
StringUtil
.
isEmpty
(
bucketName
))
{
return
null
;
}
if
(
LIVE_BUCKET
.
equals
(
bucketName
))
{
return
OSS_ENDPOINT_BJ
;
}
else
{
return
OSS_ENDPOINT
;
}
}
}
pcloud-common/src/main/java/com/pcloud/common/utils/aliyun/OssUtils.java
View file @
0e78c657
This source diff could not be displayed because it is too large. You can
view the blob
instead.
pcloud-common/src/main/java/com/pcloud/common/utils/aliyun/test/MPCTest.java
0 → 100644
View file @
0e78c657
package
com
.
pcloud
.
common
.
utils
.
aliyun
.
test
;
import
static
feign
.
Util
.
toByteArray
;
import
com.google.gson.Gson
;
import
com.huawei.mpc.client.MpcClient
;
import
com.huawei.mpc.client.MpcConfig
;
import
com.huawei.mpc.model.ObsObjInfo
;
import
com.huawei.mpc.model.thumbnail.CreateThumbnailRequest
;
import
com.huawei.mpc.model.thumbnail.CreateThumbnailResponse
;
import
com.huawei.mpc.model.thumbnail.QueryThumbTaskRequest
;
import
com.huawei.mpc.model.thumbnail.QueryThumbTaskResponse
;
import
com.huawei.mpc.model.transcoding.CreateTranscodingRequest
;
import
com.huawei.mpc.model.transcoding.CreateTranscodingResponse
;
import
com.huawei.mpc.model.transcoding.QueryTranscodingRequest
;
import
com.huawei.mpc.model.transcoding.QueryTranscodingResponse
;
import
com.huawei.mpc.model.transcoding.TextWatermark
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.FileException
;
import
com.pcloud.common.utils.aliyun.OssUtils
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @ClassName com.pcloud.auditcenter.utils.test.MPCTest
* @Author zhuyajie
* @Description 转码
* @Date 2020/5/25 17:34
* @Version 1.0
**/
@Slf4j
@RestController
@RequestMapping
(
"mpcTest"
)
public
class
MPCTest
{
public
static
final
String
AK
=
"8J56JHJN5P8OLR5ERKFU"
;
public
static
final
String
SK
=
"xAlBYlowAhwa9c1Wi4JsX7XkZGFlzlWW3CBHdZWJ"
;
public
static
final
String
PROJECT_ID
=
"07455135488025b22fe7c01fdb631c14"
;
private
static
MpcClient
initMpcClient
(){
MpcConfig
mpcConfig
=
new
MpcConfig
();
mpcConfig
.
setEndPoint
(
"mpc.cn-east-2.myhuaweicloud.com"
);
// 设置转码节点地址
mpcConfig
.
setProjectId
(
PROJECT_ID
);
// 设置用户项目编号ProjectId
mpcConfig
.
setSk
(
SK
);
// 设置sk
mpcConfig
.
setAk
(
AK
);
// 设置ak
MpcClient
mpcClient
=
new
MpcClient
(
mpcConfig
);
return
mpcClient
;
}
@RequestMapping
(
value
=
"transcodeJob"
,
method
=
RequestMethod
.
GET
)
public
void
transcodeJob
(
@RequestParam
(
"fileUrl"
)
String
fileUrl
,
@RequestParam
(
"outPutUrl"
)
String
outPutUrl
,
@RequestParam
(
"ext"
)
String
ext
)
throws
FileException
{
// String fileUrl = "oss/transcode/audio/mp3/test_20200529145343507.mp3";
// String outPutUrl = "oss/transcode/audio/mp3/";
// url=oss/transcode/video/mp4/7599ec23e9f8454f8897c4ca64a2df34.mp4
Long
templateId
=
null
;
if
(
"mp3"
.
equals
(
ext
)){
templateId
=
104257L
;
}
else
{
templateId
=
104256L
;
}
transcodeJob
(
"whlg-oss-test-001"
,
fileUrl
,
templateId
,
"cn-east-2"
,
outPutUrl
);
}
// public static void main(String[] args) {
// String fileUrl = "oss/transcode/video/mp4/7599ec23e9f8454f8897c4ca64a2df34.mp4";
// String outPutUrl = "oss/transcode/video/mp4/";
// transcodeJob("whlg-oss-test-002",fileUrl,104256L,"cn-east-2",outPutUrl);
//// getTranscodeJob("460368","test");
// }
private
static
void
transcodeJob
(
String
bucketName
,
String
fileUrl
,
Long
templateId
,
String
location
,
String
outputUrl
){
// 媒体处理服务构造方法
MpcClient
mpcClient
=
initMpcClient
();
//设置媒体处理服务请求参数
CreateTranscodingRequest
createTranscodingRequest
=
new
CreateTranscodingRequest
();
//设置转码的输入文件路径参数,可通过华为云OBS对象存储服务控制台查看。
ObsObjInfo
input
=
new
ObsObjInfo
();
//设置输入桶名
input
.
setBucket
(
bucketName
);
//设置源文件路径
input
.
setObject
(
fileUrl
);
//设置输入桶所在区域
input
.
setLocation
(
location
);
createTranscodingRequest
.
setInput
(
input
);
// 设置转码的输出文件路径参数,可通过华为云OBS对象存储服务控制台查看。
ObsObjInfo
output
=
new
ObsObjInfo
();
//设置输出桶名
output
.
setBucket
(
bucketName
);
//设置输出文件路径
output
.
setObject
(
outputUrl
);
//设置输出桶所在区域
output
.
setLocation
(
location
);
createTranscodingRequest
.
setOutput
(
output
);
//设置转码模板ID
List
<
Long
>
transTempIds
=
new
ArrayList
<
Long
>();
transTempIds
.
add
(
templateId
);
createTranscodingRequest
.
setTransTemplateId
(
transTempIds
);
// 设置水印功能
CreateTranscodingRequest
.
Watermark
watermark
=
new
CreateTranscodingRequest
.
Watermark
();
// watermark.setTemplateId("watermark_template_id");
// 设置水印图片地址
// ObsObjInfo watermarkInput = new ObsObjInfo();
// // 水印图片地址所在桶
// watermarkInput.setBucket(bucketName);
// // 水印图片地址所在路径
// watermarkInput.setObject("objectKey");
// // 水印图片地址所在区域
// watermarkInput.setLocation(location);
// watermark.setInput(watermarkInput);
// 文字水印内容,内容需做Base64编码,
// 示例:若想添加文字水印“测试文字水印”,那么Content的值为:5rWL6K+V5paH5a2X5rC05Y2w
watermark
.
setTextContext
(
"5rWL6K+V5paH5a2X5rC05Y2w"
);
TextWatermark
textWatermark
=
new
TextWatermark
();
// 字体颜色。
// 目前颜色支持black,blue,white,green,red,yellow,brown,gold,pink,orange,purple。
// 默认颜色是white
textWatermark
.
setFontColor
(
"black"
);
// 字体,当前支持fzyouh、msyh
// 默认字体是msyh
textWatermark
.
setFontName
(
"fzyouh"
);
// 字体大小。默认值:16,范围:(4, 120)
textWatermark
.
setFontSize
(
16
);
watermark
.
setTextWatermark
(
textWatermark
);
List
<
CreateTranscodingRequest
.
Watermark
>
watermarks
=
new
ArrayList
<
CreateTranscodingRequest
.
Watermark
>();
watermarks
.
add
(
watermark
);
CreateTranscodingRequest
.
Watermark
[]
watermarkArray
=
new
CreateTranscodingRequest
.
Watermark
[
watermarks
.
size
()];
createTranscodingRequest
.
setWatermarks
(
watermarks
.
toArray
(
watermarkArray
));
//发送媒体处理服务请求
CreateTranscodingResponse
createTranscodingResponse
=
mpcClient
.
createTranscodingTask
(
createTranscodingRequest
);
//返回消息
log
.
info
(
new
Gson
().
toJson
(
createTranscodingResponse
));
}
private
static
QueryTranscodingResponse
getTranscodeJob
(
String
taskId
,
String
bucketName
)
throws
FileException
{
MpcClient
mpcClient
=
initMpcClient
();
//设置查询转码任务ID
QueryTranscodingRequest
queryTranscodingRequest
=
new
QueryTranscodingRequest
();
queryTranscodingRequest
.
setTaskId
(
taskId
);
//发送查询转码任务请求
QueryTranscodingResponse
queryTranscodingResponse
=
mpcClient
.
queryTranscodingTask
(
queryTranscodingRequest
);
System
.
out
.
println
(
new
Gson
().
toJson
(
queryTranscodingResponse
));
return
queryTranscodingResponse
;
}
@GetMapping
(
"getTranscodeJob"
)
public
ResponseDto
<?>
getTranscodeJob
(
@RequestParam
(
"taskId"
)
String
taskId
){
QueryTranscodingResponse
response
=
getTranscodeJob
(
taskId
,
"test"
);
return
new
ResponseDto
<>(
response
);
}
@GetMapping
(
"submitTranscodeJobMp3"
)
public
ResponseDto
<?>
submitTranscodeJobMp3
(){
String
filePath
=
"E:\\KuGou\\Delacey - Dream It Possible.mp3"
;
String
fileName
=
"test"
;
String
str
=
OssUtils
.
submitTranscodeJobMp3
(
fileName
,
filePath
);
return
new
ResponseDto
<>(
str
);
}
@GetMapping
(
"submitTranscodeJobMp302"
)
public
ResponseDto
<?>
submitTranscodeJobMp302
()
throws
IOException
{
String
filePath
=
"E:\\KuGou\\Delacey - Dream It Possible.mp3"
;
InputStream
in
=
new
FileInputStream
(
filePath
);
byte
[]
data
=
toByteArray
(
in
);
return
new
ResponseDto
<>(
OssUtils
.
submitTranscodeJobMp3
(
data
,
"test"
,
"mp3"
));
}
@GetMapping
(
"submitTranscodeJobMp303"
)
public
ResponseDto
<?>
submitTranscodeJobMp303
()
throws
FileNotFoundException
{
String
filePath
=
"E:\\KuGou\\Delacey - Dream It Possible.mp3"
;
InputStream
in
=
new
FileInputStream
(
filePath
);
return
new
ResponseDto
<>(
OssUtils
.
submitTranscodeJobMp3
(
in
,
"test"
,
"mp3"
));
}
@GetMapping
(
"submitTranscodeJobMp4"
)
public
ResponseDto
<?>
submitTranscodeJobMp4
(){
String
filePath
=
"C:\\Users\\HP\\Desktop\\temp\\test.mp4"
;
String
fileName
=
"test"
;
String
str
=
OssUtils
.
submitTranscodeJobMp4
(
fileName
,
filePath
);
return
new
ResponseDto
<>(
str
);
}
@GetMapping
(
"submitTranscodeJobMp402"
)
public
ResponseDto
<?>
submitTranscodeJobMp402
()
throws
IOException
{
String
filePath
=
"C:\\Users\\HP\\Desktop\\temp\\test.mp4"
;
InputStream
in
=
new
FileInputStream
(
filePath
);
byte
[]
data
=
toByteArray
(
in
);
return
new
ResponseDto
<>(
OssUtils
.
submitTranscodeJobMp4
(
data
,
"test"
,
"mp4"
));
}
@GetMapping
(
"getOSSResult"
)
public
ResponseDto
<?>
getOSSResult
(
@RequestParam
(
"transcodeJobId"
)
String
transcodeJobId
){
return
new
ResponseDto
<>(
OssUtils
.
getOSSResult
(
transcodeJobId
));
}
@GetMapping
(
"getOSSResultByRegion"
)
public
ResponseDto
<?>
getOSSResultByRegion
(
@RequestParam
(
"transcodeJobId"
)
String
transcodeJobId
,
@RequestParam
(
"buckectName"
)
String
buckectName
){
return
new
ResponseDto
<>(
OssUtils
.
getOSSResultByRegion
(
transcodeJobId
,
buckectName
));
}
@GetMapping
(
"submitTranscodeJobSync"
)
public
ResponseDto
<?>
submitTranscodeJobSync
(
@RequestParam
(
"fileUrl"
)
String
fileUrl
){
return
new
ResponseDto
(
OssUtils
.
submitTranscodeJobSync
(
fileUrl
));
}
@GetMapping
(
"submitThumbnailRequest"
)
public
ResponseDto
<?>
submitThumbnailRequest
(
@RequestParam
(
"fileUrl"
)
String
fileUrl
){
return
new
ResponseDto
<>(
OssUtils
.
submitSnapshotJob
(
fileUrl
,
10
));
}
private
static
void
createThumbnail
(){
MpcClient
mpcClient
=
initMpcClient
();
// 设置创建截图模板的请求参数
CreateThumbnailRequest
createThumbnailRequest
=
new
CreateThumbnailRequest
();
// 设置截图源文件地址
ObsObjInfo
input
=
new
ObsObjInfo
();
//OBS桶名
input
.
setBucket
(
"whlg-oss-test-002"
);
//OBS下媒资路径
input
.
setObject
(
"oss/transcode/video/mp4/test_20200529160425176.mp4"
);
//OBS桶所在区域
input
.
setLocation
(
"cn-east-2"
);
createThumbnailRequest
.
setInput
(
input
);
// 设置截图后文件存放地址
ObsObjInfo
output
=
new
ObsObjInfo
();
output
.
setBucket
(
"whlg-oss-test-002"
);
output
.
setObject
(
"oss/transcode/video/mp4/"
);
output
.
setLocation
(
"cn-east-2"
);
createThumbnailRequest
.
setOutput
(
output
);
// 设置截图参数
CreateThumbnailRequest
.
ThumbnailPara
thumbnailPara
=
new
CreateThumbnailRequest
.
ThumbnailPara
();
//采样类型。支持三种采样方式PERCENT、TIME和DOTS(根据时间间隔time,根据视频时长百分比percent,根据时间截图时的时间点数组dots,目前只支持TIME和DOTS两种方式)
thumbnailPara
.
setType
(
CreateThumbnailRequest
.
ThumbnailPara
.
TypeEnum
.
TIME
);
thumbnailPara
.
setTime
(
12
);
thumbnailPara
.
setStartTime
(
3
);
thumbnailPara
.
setDuration
(
3
);
//设置最大长度,范围(380,3840)
thumbnailPara
.
setMaxLength
(
480
);
//设置纵横比(min = 0, max = 1)
thumbnailPara
.
setAspectRatio
(
0
);
//设置截图格式,0表示默认,1表示JPG格式
thumbnailPara
.
setFormat
(
1
);
createThumbnailRequest
.
setThumbnailPara
(
thumbnailPara
);
// 发送创建截图任务请求给媒体处理服务
CreateThumbnailResponse
createThumbnailResponse
=
mpcClient
.
createThumbnailsTask
(
createThumbnailRequest
);
// 返回消息
System
.
out
.
println
(
new
Gson
().
toJson
(
createThumbnailResponse
));
}
private
static
void
getThumbnail
(
String
taskId
){
MpcClient
mpcClient
=
initMpcClient
();
// 设置创建水印模板的请求参数
QueryThumbTaskRequest
queryThumbTaskRequest
=
new
QueryThumbTaskRequest
();
//根据任务ID查询,最多支持10个任务ID
queryThumbTaskRequest
.
setTaskId
(
new
String
[]{
taskId
});
// 发送查询截图任务请求给媒体处理服务
QueryThumbTaskResponse
queryThumbTaskResponse
=
mpcClient
.
queryThumbnailsTask
(
queryThumbTaskRequest
);
// 返回消息
System
.
out
.
println
(
new
Gson
().
toJson
(
queryThumbTaskResponse
));
}
}
pcloud-common/src/main/java/com/pcloud/common/utils/aliyun/test/ObsTest.java
0 → 100644
View file @
0e78c657
package
com
.
pcloud
.
common
.
utils
.
aliyun
.
test
;
import
com.obs.services.model.ObjectMetadata
;
import
com.pcloud.common.dto.OssMediaInfoDTO
;
import
com.pcloud.common.entity.UploadResultInfo
;
import
com.pcloud.common.exceptions.FileException
;
import
com.pcloud.common.utils.aliyun.OssUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @ClassName com.pcloud.auditcenter.hw.utils.test.ObsTest
* @Author 吴博
* @Description 华为云测试类
* @Date 2020/5/24 9:27
* @Version 1.0
**/
@RestController
@RequestMapping
(
"obsTest"
)
@Slf4j
public
class
ObsTest
{
private
static
final
String
textFilePath
=
"C:\\Users\\Administrator\\Desktop\\sql.txt"
;
private
static
final
String
audioFilePath
=
"C:\\Users\\Administrator\\Desktop\\123321.mp3"
;
private
static
final
String
imageFilePath
=
"C:\\Users\\Administrator\\Desktop\\girl.jpg"
;
private
static
final
String
imageFileUrl
=
"https://oss.raysgo.com/oss/upload/image/jpg/add52c60c88a4989bdf6bdb554b5f928.jpg"
;
private
static
final
String
videoFilePath
=
"C:\\Users\\Administrator\\Desktop\\e610844f3210d9e249fc8ee0cc6b9a1b_20190815173921219.mp4"
;
private
static
final
String
parentFileUrl
=
"https://oss.raysgo.com/oss/upload/video/mp4/b2f2df50279d43b4af52ebb760924e08"
;
private
static
final
String
videoUrl
=
"https://oss.raysgo.com/oss/upload/video/mp4/e297ea15516146acabbbcb8c31fe0f92.mp4"
;
private
static
final
String
ObjectKey
=
"oss/upload/video/mp4/b2f2df50279d43b4af52ebb760924e08.mp4"
;
private
static
final
String
textUrl
=
"https://oss.raysgo.com/oss/upload/text/txt/4b19722b10604da282497b80c77860fe.txt"
;
private
static
final
String
outFilePath4Mp3
=
"C:\\Users\\Administrator\\Desktop\\localaudio.mp3"
;
private
static
final
String
outFilePath4Mp4
=
"C:\\Users\\Administrator\\Desktop\\localVideo.mp4"
;
private
static
final
String
huaweiImage
=
"C:\\Users\\Administrator\\Desktop\\1588081459(1).png"
;
private
static
final
String
huaweiImageUrl
=
"https://oss.raysgo.com/oss/upload/image/png/7348e76b4a654fdbbccf3a2adbe0d028.png"
;
@RequestMapping
(
value
=
"uploadFileByte"
,
method
=
RequestMethod
.
GET
)
public
UploadResultInfo
uploadFileByte
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
UploadResultInfo
uploadResultInfo
=
OssUtils
.
uploadFileByte
(
buff
,
fileName
,
fileType
);
log
.
info
(
uploadResultInfo
.
toString
());
return
uploadResultInfo
;
}
@RequestMapping
(
value
=
"uploadLocalFile"
,
method
=
RequestMethod
.
GET
)
public
UploadResultInfo
uploadLocalFile
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
UploadResultInfo
uploadResultInfo
=
OssUtils
.
uploadLocalFile
(
videoFilePath
,
null
);
log
.
info
(
uploadResultInfo
.
toString
());
return
uploadResultInfo
;
}
@RequestMapping
(
value
=
"uploadLocalFile4Child"
,
method
=
RequestMethod
.
GET
)
public
UploadResultInfo
uploadLocalFile4Child
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
UploadResultInfo
uploadResultInfo
=
OssUtils
.
uploadLocalFile4Child
(
audioFilePath
,
parentFileUrl
);
log
.
info
(
uploadResultInfo
.
toString
());
return
uploadResultInfo
;
}
@RequestMapping
(
value
=
"getMediaInfo"
,
method
=
RequestMethod
.
GET
)
public
OssMediaInfoDTO
getMediaInfo
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
OssMediaInfoDTO
ossMediaInfoDTO
=
OssUtils
.
getMediaInfo
(
videoUrl
);
log
.
info
(
ossMediaInfoDTO
.
toString
());
return
ossMediaInfoDTO
;
}
@RequestMapping
(
value
=
"getObjectMetadata"
,
method
=
RequestMethod
.
GET
)
public
ObjectMetadata
getObjectMetadata
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
ObjectMetadata
objectMetadata
=
OssUtils
.
getObjectMetadata
(
ObjectKey
,
"whlg-oss-test-002"
);
log
.
info
(
objectMetadata
.
toString
());
return
objectMetadata
;
}
@RequestMapping
(
value
=
"downloadFile2Byte"
,
method
=
RequestMethod
.
GET
)
public
String
downloadFile2Byte
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
byte
[]
bytes
=
OssUtils
.
downloadFile2Byte
(
textUrl
);
log
.
info
(
new
String
(
bytes
));
return
new
String
(
bytes
);
}
@RequestMapping
(
value
=
"downloadFile"
,
method
=
RequestMethod
.
GET
)
public
void
downloadFile
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
OssUtils
.
downloadFile
(
videoUrl
,
outFilePath4Mp4
);
}
@RequestMapping
(
value
=
"imageWidthResize"
,
method
=
RequestMethod
.
GET
)
public
void
imageWidthResize
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
OssUtils
.
imageWidthResize
(
imageFileUrl
,
100
);
}
@RequestMapping
(
value
=
"imageResize"
,
method
=
RequestMethod
.
GET
)
public
void
imageResize
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
OssUtils
.
imageResize
(
imageFileUrl
,
50
);
}
@RequestMapping
(
value
=
"imageAutoOrient"
,
method
=
RequestMethod
.
GET
)
public
void
imageAutoOrient
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
OssUtils
.
imageAutoOrient
(
imageFileUrl
,
50
);
}
@RequestMapping
(
value
=
"imageCrop"
,
method
=
RequestMethod
.
GET
)
public
void
imageCrop
()
throws
FileException
{
String
content
=
"Hello OBS"
;
byte
[]
buff
=
content
.
getBytes
();
String
fileName
=
""
;
String
fileType
=
"txt"
;
OssUtils
.
imageCrop
(
imageFileUrl
,
500
,
500
,
0
,
0
);
}
@RequestMapping
(
value
=
"imageCropSaveas"
,
method
=
RequestMethod
.
GET
)
public
void
imageCropSaveas
()
throws
FileException
{
OssUtils
.
imageCropSaveas
(
imageFileUrl
,
500
,
500
,
0
,
0
);
}
@RequestMapping
(
value
=
"imageWatermark"
,
method
=
RequestMethod
.
GET
)
public
void
imageWatermark
()
throws
FileException
{
String
waterMark
=
OssUtils
.
imageWatermark
(
imageFileUrl
,
"哈哈哈哈,大笨蛋"
);
log
.
info
(
waterMark
);
}
@RequestMapping
(
value
=
"imageWatermark4Image"
,
method
=
RequestMethod
.
GET
)
public
void
imageWatermark4Image
()
throws
FileException
{
String
waterMark
=
OssUtils
.
imageWatermark4Image
(
imageFileUrl
,
huaweiImageUrl
);
log
.
info
(
waterMark
);
}
}
\ No newline at end of file
pom.xml
View file @
0e78c657
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
<!-- frameworks -->
<!-- frameworks -->
<slf4j.version>
1.7.18
</slf4j.version>
<slf4j.version>
1.7.18
</slf4j.version>
<mpc-sdk-version>
2.0.7
</mpc-sdk-version>
</properties>
</properties>
<dependencies>
<dependencies>
...
@@ -306,6 +307,11 @@
...
@@ -306,6 +307,11 @@
<version>
2.7.0
</version>
<version>
2.7.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.huaweicloud
</groupId>
<artifactId>
esdk-obs-java
</artifactId>
<version>
3.19.7
</version>
</dependency>
<dependency>
<groupId>
com.aliyun
</groupId>
<groupId>
com.aliyun
</groupId>
<artifactId>
aliyun-java-sdk-mts
</artifactId>
<artifactId>
aliyun-java-sdk-mts
</artifactId>
<version>
2.1.7
</version>
<version>
2.1.7
</version>
...
@@ -319,6 +325,29 @@
...
@@ -319,6 +325,29 @@
<version>
1.9.13
</version>
<version>
1.9.13
</version>
</dependency>
</dependency>
<!-- Jackson End -->
<!-- Jackson End -->
<dependency>
<groupId>
com.huawei.mpc
</groupId>
<artifactId>
cloud-java-sdk-mpc
</artifactId>
<version>
${mpc-sdk-version}
</version>
<exclusions>
<exclusion>
<groupId>
com.squareup.retrofit2
</groupId>
<artifactId>
retrofit
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.squareup.retrofit2
</groupId>
<artifactId>
retrofit
</artifactId>
<version>
2.5.0
</version>
<!--<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</exclusion>
</exclusions>-->
</dependency>
</dependencies>
</dependencies>
</dependencyManagement>
</dependencyManagement>
...
...
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