All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.banner.lib.oss.config.OssConfiguration Maven / Gradle / Ivy

There is a newer version: 0.0.2
Show newest version
package top.banner.lib.oss.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.banner.lib.oss.ali.AliOssClient;
import top.banner.lib.oss.ali.AliProperties;
import top.banner.lib.oss.core.OssClient;
import top.banner.lib.oss.qcloud.QCloudCosClient;
import top.banner.lib.oss.qcloud.QCloudProperties;
import top.banner.lib.oss.qiniu.QiniuOssClient;
import top.banner.lib.oss.qiniu.QiniuProperties;

import javax.annotation.Resource;

@Configuration
@ConditionalOnClass(OssClient.class)
@EnableConfigurationProperties({AliProperties.class, QiniuProperties.class, QCloudProperties.class})
public class OssConfiguration {

    @Resource
    private AliProperties aliProperties;
    @Resource
    private QiniuProperties qiniuProperties;
    @Resource
    private QCloudProperties qCloudProperties;

    @Bean
    public AliOssClient aliOssClient() {
        return new AliOssClient(aliProperties);
    }

    @Bean
    public QiniuOssClient qiniuOssClient() {
        return new QiniuOssClient(qiniuProperties);
    }

    @Bean
    public QCloudCosClient qCloudCosClient() {
        return new QCloudCosClient(qCloudProperties);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy