【8.0.4】【file】初始化青云的oss配置

pull/60/head
fengshuonan 2023-11-26 22:02:25 +08:00
parent 8780aa8904
commit 67af7d400c
6 changed files with 219 additions and 0 deletions

View File

@ -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.
*
* GunsAPACHE 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;
}

View File

@ -0,0 +1 @@
青云OSS适配

View File

@ -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>

View File

@ -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.
*
* GunsAPACHE 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;
}
}

View File

@ -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>

View File

@ -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>