package com.philisense.www.config;

import com.philisense.www.enums.OssTypeEnum;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @description: Oss配置
 **/
@Component
@ConfigurationProperties(prefix = "platform.oss")
public class OssStorageProperties {

    /**
     * oss 类型
     * 参考 OssTypeEnum.java
     */
    private OssTypeEnum ossType;

    private String diskName;

    private LocalConfig local;

    private AliyunConfig aliyun;

    private QiniuConfig qiniu;

    private UpyunConfig upyun;

    private MinioConfig minio;

    private GoFastDFSConfig goFastDFS;

    public OssTypeEnum getOssType() {
        return ossType;
    }

    public String getDiskName() {
        return diskName;
    }

    public void setDiskName(String diskName) {
        this.diskName = diskName;
    }

    public void setOssType(OssTypeEnum ossType) {
        this.ossType = ossType;
    }

    public LocalConfig getLocal() {
        return local;
    }

    public void setLocal(LocalConfig local) {
        this.local = local;
    }

    public AliyunConfig getAliyun() {
        return aliyun;
    }

    public void setAliyun(AliyunConfig aliyun) {
        this.aliyun = aliyun;
    }

    public QiniuConfig getQiniu() {
        return qiniu;
    }

    public void setQiniu(QiniuConfig qiniu) {
        this.qiniu = qiniu;
    }

    public UpyunConfig getUpyun() {
        return upyun;
    }

    public void setUpyun(UpyunConfig upyun) {
        this.upyun = upyun;
    }

    public MinioConfig getMinio() {
        return minio;
    }

    public void setMinio(MinioConfig minio) {
        this.minio = minio;
    }

    public GoFastDFSConfig getGoFastDFS() {
        return goFastDFS;
    }

    public void setGoFastDFS(GoFastDFSConfig goFastDFS) {
        this.goFastDFS = goFastDFS;
    }

    /**
     * Local 配置信息
     */
    public static class LocalConfig {
        private String endpoint;
        private String path;
        private String bucketName;

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public String getBucketName() {
            return bucketName;
        }

        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
    }

    /**
     * Aliyun 配置信息
     */
    public static class AliyunConfig {
        private String endpoint;
        private String accessKey;
        private String accessSecret;
        private String regionId;
        private String bucketName;

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getAccessKey() {
            return accessKey;
        }

        public void setAccessKey(String accessKey) {
            this.accessKey = accessKey;
        }

        public String getAccessSecret() {
            return accessSecret;
        }

        public void setAccessSecret(String accessSecret) {
            this.accessSecret = accessSecret;
        }

        public String getRegionId() {
            return regionId;
        }

        public void setRegionId(String regionId) {
            this.regionId = regionId;
        }

        public String getBucketName() {
            return bucketName;
        }

        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
    }

    /**
     * Qiniu 配置信息
     */
    public static class QiniuConfig {
        private String endpoint;
        private String accessKey;
        private String accessSecret;
        private String regionId;
        private String bucketName;

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getAccessKey() {
            return accessKey;
        }

        public void setAccessKey(String accessKey) {
            this.accessKey = accessKey;
        }

        public String getAccessSecret() {
            return accessSecret;
        }

        public void setAccessSecret(String accessSecret) {
            this.accessSecret = accessSecret;
        }

        public String getRegionId() {
            return regionId;
        }

        public void setRegionId(String regionId) {
            this.regionId = regionId;
        }

        public String getBucketName() {
            return bucketName;
        }

        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
    }

    /**
     * Upyun 配置信息
     */
    public static class UpyunConfig {
        private String endpoint;
        private String userName;
        private String password;
        private String bucketName;

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getBucketName() {
            return bucketName;
        }

        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
    }

    /**
     * Minio 配置信息
     */
    public static class MinioConfig {
        private String endpoint;
        private String accessKey;
        private String secretKey;
        private String bucketName;

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getAccessKey() {
            return accessKey;
        }

        public void setAccessKey(String accessKey) {
            this.accessKey = accessKey;
        }

        public String getSecretKey() {
            return secretKey;
        }

        public void setSecretKey(String secretKey) {
            this.secretKey = secretKey;
        }

        public String getBucketName() {
            return bucketName;
        }

        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
    }

    /**
     * GoFastDFS 配置信息
     */
    public static class GoFastDFSConfig {
        private String endpoint;
        private String connectTimeout;
        private String socketTimeout;
        private String bucketName;

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getConnectTimeout() {
            return connectTimeout;
        }

        public void setConnectTimeout(String connectTimeout) {
            this.connectTimeout = connectTimeout;
        }

        public String getSocketTimeout() {
            return socketTimeout;
        }

        public void setSocketTimeout(String socketTimeout) {
            this.socketTimeout = socketTimeout;
        }

        public String getBucketName() {
            return bucketName;
        }

        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
    }

}
