package com.fdkankan.filestorage.properties;


import com.aliyun.oss.ClientBuilderConfiguration;
import com.fdkankan.filestorage.InnerUtils;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Map;

/**
 * 阿里云OSS配置属性
 */
@Data
@ConfigurationProperties(prefix = "filestorage")
public class FileStroageProperties implements Serializable, InitializingBean {
    private final Logger log = LoggerFactory.getLogger(getClass());

    public static final String PREFIX = "filestorage.oss";

    private String active;

    @Override
    public void afterPropertiesSet() throws Exception {
        InnerUtils.checkArgument(!StringUtils.isEmpty(active), " filestorage 'active' can't be empty");
        log.info("--------------filestorage 'active' is : {}",active);
    }
}
