提交 ba182337 authored 作者: yangqi's avatar yangqi

1

上级 90f19761
package cn.lefull.common.sdk.ali.base;
import com.aliyun.com.viapi.FileUtils;
import java.io.IOException;
/**
* @author 杨奇
*/
public class BaseFace {
protected String endpoint = "oss-cn-shanghai.aliyuncs.com";
protected String accessKeyId = "LTAI5t7ip3G6Wr5mMsC9UUfb";
protected String accessKeySecret = "f03aZwjNUQb3rQMZmc4aey3bDWgfLc";
protected String bucketName = "lefull-facebody-sh";
private String privateAccessKeyId = "LTAI5tAFLtDk3SLdGEzpA3TY";
private String privateAccessKeySecret = "1Mfr9POAjZcviHPkdAjhZ47ZYuyIiY";
private String privateEndPoint = "facebody.cn-shanghai.aliyuncs.com";
/**
* 使用AK&SK初始化账号Client
* @return Client
* @throws Exception
*/
public com.aliyun.facebody20191230.Client createClient() {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
// 您的 AccessKey ID
.setAccessKeyId(this.privateAccessKeyId)
// 您的 AccessKey Secret
.setAccessKeySecret(this.privateAccessKeySecret);
// 访问的域名
config.endpoint = this.privateEndPoint;
try {
return new com.aliyun.facebody20191230.Client(config);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public String uploadImageUrl(String file) throws com.aliyuncs.exceptions.ClientException, IOException {
FileUtils fileUtils = FileUtils.getInstance(this.accessKeyId, this.accessKeySecret);
return fileUtils.upload(file);
}
}
......@@ -4,7 +4,6 @@
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>
<groupId>cn.lefull</groupId>
<artifactId>lefull-lot-microservice</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论