mirror of https://gitee.com/stylefeng/roses
【8.0.4】【file】初始化青云的oss配置
parent
8780aa8904
commit
67af7d400c
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||||
|
*
|
||||||
|
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||||
|
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||||
|
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||||
|
*/
|
||||||
|
package cn.stylefeng.roses.kernel.file.api.pojo.props;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 青云OSS的配置
|
||||||
|
* <p>
|
||||||
|
* https://github.com/qingstor/qingstor-sdk-java/blob/master/README_zh-CN.md
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/11/26 21:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QingYunOssProperties {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 秘钥id
|
||||||
|
*/
|
||||||
|
private String qyAccessKeyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 秘钥secret
|
||||||
|
*/
|
||||||
|
private String qySecretAccessKey;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
青云OSS适配
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
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>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.stylefeng.roses</groupId>
|
||||||
|
<artifactId>kernel-d-file</artifactId>
|
||||||
|
<version>8.0.4</version>
|
||||||
|
<relativePath>../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>file-sdk-qingyun</artifactId>
|
||||||
|
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!--file模块的api-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.stylefeng.roses</groupId>
|
||||||
|
<artifactId>file-api</artifactId>
|
||||||
|
<version>${roses.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--青云的OSS-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yunify</groupId>
|
||||||
|
<artifactId>qingstor.sdk.java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,123 @@
|
||||||
|
/*
|
||||||
|
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||||
|
*
|
||||||
|
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||||
|
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||||
|
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||||
|
*/
|
||||||
|
package cn.stylefeng.roses.kernel.file.qingyun;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.file.api.FileOperatorApi;
|
||||||
|
import cn.stylefeng.roses.kernel.file.api.enums.BucketAuthEnum;
|
||||||
|
import cn.stylefeng.roses.kernel.file.api.enums.FileLocationEnum;
|
||||||
|
import cn.stylefeng.roses.kernel.file.api.pojo.props.QingYunOssProperties;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 青云的OSS操作
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/11/26 22:01
|
||||||
|
*/
|
||||||
|
public class QingYunFileOperator implements FileOperatorApi {
|
||||||
|
|
||||||
|
private final QingYunOssProperties qingYunOssProperties;
|
||||||
|
|
||||||
|
public QingYunFileOperator(QingYunOssProperties qingYunOssProperties) {
|
||||||
|
this.qingYunOssProperties = qingYunOssProperties;
|
||||||
|
this.initClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initClient() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroyClient() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getClient() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doesBucketExist(String bucketName) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBucketAcl(String bucketName, BucketAuthEnum bucketAuthEnum) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isExistingFile(String bucketName, String key) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void storageFile(String bucketName, String key, byte[] bytes) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void storageFile(String bucketName, String key, InputStream inputStream) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public byte[] getFileBytes(String bucketName, String key) {
|
||||||
|
return new byte[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setFileAcl(String bucketName, String key, BucketAuthEnum bucketAuthEnum) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copyFile(String originBucketName, String originFileKey, String newBucketName, String newFileKey) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFileAuthUrl(String bucketName, String key, Long timeoutMillis) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFileUnAuthUrl(String bucketName, String key) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteFile(String bucketName, String key) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileLocationEnum getFileLocationEnum() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -22,6 +22,7 @@
|
||||||
<module>file-sdk-tencent</module>
|
<module>file-sdk-tencent</module>
|
||||||
<module>file-sdk-local</module>
|
<module>file-sdk-local</module>
|
||||||
<module>file-sdk-minio</module>
|
<module>file-sdk-minio</module>
|
||||||
|
<module>file-sdk-qingyun</module>
|
||||||
<module>file-spring-boot-starter</module>
|
<module>file-spring-boot-starter</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
8
pom.xml
8
pom.xml
|
@ -132,6 +132,7 @@
|
||||||
<qcloud.commons.logging.version>1.1.3</qcloud.commons.logging.version>
|
<qcloud.commons.logging.version>1.1.3</qcloud.commons.logging.version>
|
||||||
<aliyun.sms.sdk.core>4.4.6</aliyun.sms.sdk.core>
|
<aliyun.sms.sdk.core>4.4.6</aliyun.sms.sdk.core>
|
||||||
<aliyun.sms.sdk.ecs>4.17.6</aliyun.sms.sdk.ecs>
|
<aliyun.sms.sdk.ecs>4.17.6</aliyun.sms.sdk.ecs>
|
||||||
|
<qingyun.oss.version>2.5.1</qingyun.oss.version>
|
||||||
<qcloud.sms>3.1.57</qcloud.sms>
|
<qcloud.sms>3.1.57</qcloud.sms>
|
||||||
<elasticsearch.version>7.9.2</elasticsearch.version>
|
<elasticsearch.version>7.9.2</elasticsearch.version>
|
||||||
<aws.sdk.version>1.11.106</aws.sdk.version>
|
<aws.sdk.version>1.11.106</aws.sdk.version>
|
||||||
|
@ -219,6 +220,13 @@
|
||||||
<version>${aliyun.oss.version}</version>
|
<version>${aliyun.oss.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--青云的OSS-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yunify</groupId>
|
||||||
|
<artifactId>qingstor.sdk.java</artifactId>
|
||||||
|
<version>${qingyun.oss.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--腾讯云上传文件客户端,用的时候手动引入-->
|
<!--腾讯云上传文件客户端,用的时候手动引入-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.qcloud</groupId>
|
<groupId>com.qcloud</groupId>
|
||||||
|
|
Loading…
Reference in New Issue