package org.springblade.file.config;

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

import java.io.File;
import java.time.Duration;

/**
 *  obs 配置
 * @author bfhuange
 * @date 2024/10/21
 */
@Data
@ConfigurationProperties(prefix = "obs")
public class ObsProperties {
    /**
     *  OBS endpoint
     */
    public String endpoint;
    /**
     *  AK in the access key
     */
    public String accessKeyId;
    /**
     *  SK in the access key
     */
    public String accessKeySecret;
    /**
     *  桶名
     */
    public String bucketName;
    /**
     *  根目录
     */
    public String rootDirectory;
    /**
     *  过期时间，默认1小时
     */
    public Long expires = Duration.ofHours(1).toSeconds();
    /**
     *  本地临时下载文件目录
     */
    public String tmpDownloadDir = "tmp" + File.separator + "download";
    /**
     *  本地临时解压文件目录
     */
    public String tmpUnzipDir = "tmp" + File.separator + "unzip";
    /**
     *  obs上压缩文件上传目录
     */
    public String zipUploadDir = "part";
    /**
     *  obs上解压后的文件上传目录
     */
    public String unzipUploadDir = "unzip";
    /**
     *  obs上设置了过期时间自动删除的上传目录
     */
    public String tmpUploadDir = "tmp";
    /**
     *  下载进度间隔，默认 10m
     */
    public Long downloadProgressInterval = 10 * 1024 * 1024L;
    /**
     *  上传进度间隔，默认 10m
     */
    public Long uploadProgressInterval = 10 * 1024 * 1024L;
}
