com.heanbian.boot.autoconfigure.oss.OssAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of heanbian-spring-boot-autoconfigure Show documentation
Show all versions of heanbian-spring-boot-autoconfigure Show documentation
Heanbian spring boot autoconfigure component.
package com.heanbian.boot.autoconfigure.oss;
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;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
@Configuration
@EnableConfigurationProperties(OssProperties.class)
public class OssAutoConfiguration {
@Bean
@ConditionalOnProperty(prefix = "heanbian.oss", name = "enabled", havingValue = "true")
public OSS oss(OssProperties op) {
return new OSSClientBuilder().build(op.getEndpoint(), op.getAccessKeyId(), op.getAccessKeySecret());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy