Commit 0e78c657 by 朱亚洁

'feat:[1003010]华为云迁移OBS/MPC'

parent c9b7cb66
## main
main.access.key.id = LTAIx8FODeVLN3bD
main.access.key.secret = eJbZwTzatZq4SMyDiQeh7NzIHkdAaO
## main Ϊak sk
main.access.key.id = CROQ0IJRW2FW5NSERZBR
main.access.key.secret = rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## OSS
oss.region = oss-cn-hangzhou
oss.endpoint = http://oss-cn-hangzhou.aliyuncs.com
file.bucket = whlg-oss-002
file.original.url = http://whlg-oss-002.oss-cn-hangzhou.aliyuncs.com/
oss.region = cn-east-2
oss.endpoint = obs.cn-east-2.myhuaweicloud.com
file.bucket = whlg-oss-prod-002
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.endpoint.bj = http://oss-cn-beijing-internal.aliyuncs.com
live.bucket = whlg-oss-livedev
oss.endpoint.bj = http://oss-cn-beijing.aliyuncs.com
live.bucket = whlg-oss-live
live.original.url = http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
by.bucket = byfile-oss-01
by.original.url = http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
## mts
mts.region = cn-hangzhou
mts.endpoint = mts.cn-hangzhou.aliyuncs.com
mts.region = cn-east-2
mts.endpoint = mpc.cn-east-2.myhuaweicloud.com
pipelineid = a63c988125054b07b1d3bd6e10c327de
mp3TemplateId = d60210d2fd5bfcacce66238142437965
mp4TemplateId = 67745f7eb8b7ca9bcf74d96c2364e6c1
mts.projectId = 07455135488025b22fe7c01fdb631c14
mts.ak = 8J56JHJN5P8OLR5ERKFU
mts.sk = xAlBYlowAhwa9c1Wi4JsX7XkZGFlzlWW3CBHdZWJ
mp3TemplateId = 104257
mp4TemplateId = 104256
m3u8TemplateId = 283cd916aa504502b3704f3f5a45addc
mts.region.bj = cn-beijing
......@@ -33,9 +37,13 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
## cdn
file.domain.name = 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/,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/
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/
file.cdn.url.download = https://download.5rs.me/
file.cdn.url.live = http://live.chubanyun.me/
file.cdn.url.by = https://byfile.1wlshu.com/
\ No newline at end of file
file.cdn.url.by = https://byfile.raysgo.com/
huawei.access.key = CROQ0IJRW2FW5NSERZBR
huawei.secret.key = rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## main
main.access.key.id = LTAIx8FODeVLN3bD
main.access.key.secret = eJbZwTzatZq4SMyDiQeh7NzIHkdAaO
## main Ϊak sk
main.access.key.id = CROQ0IJRW2FW5NSERZBR
main.access.key.secret = rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## OSS
oss.region = oss-cn-hangzhou
oss.endpoint = http://oss-cn-hangzhou.aliyuncs.com
file.bucket = whlg-oss-002
file.original.url = http://whlg-oss-002.oss-cn-hangzhou.aliyuncs.com/
oss.region = cn-east-2
oss.endpoint = obs.cn-east-2.myhuaweicloud.com
file.bucket = whlg-oss-test-002
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.endpoint.bj = http://oss-cn-beijing.aliyuncs.com
live.bucket = whlg-oss-livedev
live.bucket = whlg-oss-live
live.original.url = http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
by.bucket = byfile-oss-01
by.original.url = http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
## mts
mts.region = cn-hangzhou
mts.endpoint = mts.cn-hangzhou.aliyuncs.com
mts.region = cn-east-2
mts.endpoint = mpc.cn-east-2.myhuaweicloud.com
pipelineid = a63c988125054b07b1d3bd6e10c327de
mp3TemplateId = d60210d2fd5bfcacce66238142437965
mp4TemplateId = 67745f7eb8b7ca9bcf74d96c2364e6c1
mts.projectId = 07455135488025b22fe7c01fdb631c14
mts.ak = 8J56JHJN5P8OLR5ERKFU
mts.sk = xAlBYlowAhwa9c1Wi4JsX7XkZGFlzlWW3CBHdZWJ
mp3TemplateId = 104257
mp4TemplateId = 104256
m3u8TemplateId = 283cd916aa504502b3704f3f5a45addc
mts.region.bj = cn-beijing
......@@ -32,10 +36,14 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
## cdn
file.domain.name = 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://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/
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/,https://oss.raysyun.com/
rays.cdn.urls = https://file.5rs.me/,https://oss.5rs.me/
file.cdn.url.download = https://download.5rs.me/
file.cdn.url.live = http://live.chubanyun.me/
file.cdn.url.by = https://byfile.raysgo.com/
huawei.access.key = CROQ0IJRW2FW5NSERZBR
huawei.secret.key = rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## main
main.access.key.id = LTAIx8FODeVLN3bD
main.access.key.secret = eJbZwTzatZq4SMyDiQeh7NzIHkdAaO
## main Ϊak sk
main.access.key.id = CROQ0IJRW2FW5NSERZBR
main.access.key.secret = rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
## OSS
oss.region = oss-cn-hangzhou
oss.endpoint = http://oss-cn-hangzhou.aliyuncs.com
file.bucket = whlg-oss-002
file.original.url = http://whlg-oss-002.oss-cn-hangzhou.aliyuncs.com/
oss.region = cn-east-2
oss.endpoint = obs.cn-east-2.myhuaweicloud.com
file.bucket = whlg-oss-uat-002
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.endpoint.bj = http://oss-cn-beijing.aliyuncs.com
live.bucket = whlg-oss-livedev
live.bucket = whlg-oss-live
live.original.url = http://whlg-oss-livedev.oss-cn-beijing.aliyuncs.com/
by.bucket = byfile-oss-01
by.original.url = http://byfile-oss-01.oss-cn-hangzhou.aliyuncs.com/
## mts
mts.region = cn-hangzhou
mts.endpoint = mts.cn-hangzhou.aliyuncs.com
mts.region = cn-east-2
mts.endpoint = mpc.cn-east-2.myhuaweicloud.com
pipelineid = a63c988125054b07b1d3bd6e10c327de
mp3TemplateId = d60210d2fd5bfcacce66238142437965
mp4TemplateId = 67745f7eb8b7ca9bcf74d96c2364e6c1
mts.projectId = 07455135488025b22fe7c01fdb631c14
mts.ak = 8J56JHJN5P8OLR5ERKFU
mts.sk = xAlBYlowAhwa9c1Wi4JsX7XkZGFlzlWW3CBHdZWJ
mp3TemplateId = 104257
mp4TemplateId = 104256
m3u8TemplateId = 283cd916aa504502b3704f3f5a45addc
mts.region.bj = cn-beijing
......@@ -32,10 +36,14 @@ mp4TemplateId.bj = f4165d42e5eb680c8f919f960f35059c
## cdn
file.domain.name = 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/,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
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://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/
file.cdn.url.download = https://download.5rs.me/
file.cdn.url.live = http://live.chubanyun.me/
file.cdn.url.by = https://byfile.1wlshu.com
\ No newline at end of file
file.cdn.url.by = https://byfile.raysgo.com/
huawei.access.key = CROQ0IJRW2FW5NSERZBR
huawei.secret.key = rAbki4thgWx9iKXendlIH3gvKi8JFHUcVOWwObyS
This source diff could not be displayed because it is too large. You can view the blob instead.
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
......@@ -106,6 +106,7 @@
<!-- frameworks -->
<slf4j.version>1.7.18</slf4j.version>
<mpc-sdk-version>2.0.7</mpc-sdk-version>
</properties>
<dependencies>
......@@ -306,6 +307,11 @@
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>com.huaweicloud</groupId>
<artifactId>esdk-obs-java</artifactId>
<version>3.19.7</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-mts</artifactId>
<version>2.1.7</version>
......@@ -319,6 +325,29 @@
<version>1.9.13</version>
</dependency>
<!-- 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>
</dependencyManagement>
......
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