cn.crazywalker.fsf.oss.configuration.AliyunConfiguration Maven / Gradle / Ivy
The newest version!
package cn.crazywalker.fsf.oss.configuration;
import cn.crazywalker.fsf.oss.aliyun.AliyunOSSClient;
import cn.crazywalker.fsf.oss.aliyun.AliyunOSSProperties;
import com.aliyun.oss.OSSClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author CrazyWalker
* @since 周六, 04/22 2023 17:55 GMT+8
*/
@Configuration
@ConditionalOnClass(OSSClient.class)
@EnableConfigurationProperties(AliyunOSSProperties.class)
public class AliyunConfiguration {
@ConditionalOnProperty(prefix = "fsf.oss.aliyun", value = "endpoint")
@Bean
public cn.crazywalker.fsf.oss.OSSClient ossClient(AliyunOSSProperties aliyunOSSProperties) {
return new AliyunOSSClient(aliyunOSSProperties);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy