package com.haha.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 阿里云 OSS 配置
 */
@Data
@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "aliyun.oss")
public class OssConfig {

    private String endpoint;
    private String accessKeyId;
    private String accessKeySecret;
    private String bucketName;
    private String domainPrefix;
    private StsConfig sts = new StsConfig();

    /**
     * STS 临时凭证配置
     */
    @Data
    public static class StsConfig {
        private String roleArn;
        private String roleSessionName;
        private int durationSeconds = 900;
    }
}
