package org.king.config.oss;

import org.king.common.util.oss.OssBootUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssBootConfiguration {

    @Value("${king.oss.endpoint}")
    private String endpoint;
    @Value("${king.oss.accessKey}")
    private String accessKeyId;
    @Value("${king.oss.secretKey}")
    private String accessKeySecret;
    @Value("${king.oss.bucketName}")
    private String bucketName;
    @Value("${king.oss.staticDomain}")
    private String staticDomain;


    @Bean
    public void initOssBootConfiguration() {
        OssBootUtil.setEndPoint(endpoint);
        OssBootUtil.setAccessKeyId(accessKeyId);
        OssBootUtil.setAccessKeySecret(accessKeySecret);
        OssBootUtil.setBucketName(bucketName);
        OssBootUtil.setStaticDomain(staticDomain);
    }
}