package ink.wgink.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @ClassName: FileConfig
 * @Description: 文件配置
 * @Author: wenc
 * @Date: 2019/1/3 3:12 PM
 * @Version: 1.0
 **/
@Component
@ConfigurationProperties(prefix = "file")
public class FileProperties {

    private String uploadPath;
    private Boolean unique;
    private String imageTypes;
    private String videoTypes;
    private String audioTypes;
    private String fileTypes;
    private Integer maxFileCount;
    private Double imageOutputQuality;
    private Boolean useMinIo;
    private FileMinIoProperties minIo;
    private FileCenterProperties center;

    public String getUploadPath() {
        return uploadPath;
    }

    public void setUploadPath(String uploadPath) {
        this.uploadPath = uploadPath;
    }

    public Boolean getUnique() {
        return unique == null ? false : unique;
    }

    public void setUnique(Boolean unique) {
        this.unique = unique;
    }

    public String getImageTypes() {
        return imageTypes == null ? null : imageTypes.trim();
    }

    public void setImageTypes(String imageTypes) {
        this.imageTypes = imageTypes;
    }

    public String getVideoTypes() {
        return videoTypes == null ? null : videoTypes.replaceAll("\\s", "");
    }

    public void setVideoTypes(String videoTypes) {
        this.videoTypes = videoTypes;
    }

    public String getAudioTypes() {
        return audioTypes == null ? null : audioTypes.replaceAll("\\s", "");
    }

    public void setAudioTypes(String audioTypes) {
        this.audioTypes = audioTypes;
    }

    public String getFileTypes() {
        return fileTypes == null ? null : fileTypes.replaceAll("\\s", "");
    }

    public void setFileTypes(String fileTypes) {
        this.fileTypes = fileTypes;
    }

    public Integer getMaxFileCount() {
        return maxFileCount == null ? 1 : maxFileCount;
    }

    public void setMaxFileCount(Integer maxFileCount) {
        this.maxFileCount = maxFileCount;
    }

    public Double getImageOutputQuality() {
        return imageOutputQuality == null ? 0.4 : imageOutputQuality;
    }

    public void setImageOutputQuality(Double imageOutputQuality) {
        this.imageOutputQuality = imageOutputQuality;
    }

    public Boolean getUseMinIo() {
        return useMinIo == null ? false : useMinIo;
    }

    public void setUseMinIo(Boolean useMinIo) {
        this.useMinIo = useMinIo;
    }

    public FileMinIoProperties getMinIo() {
        return minIo;
    }

    public void setMinIo(FileMinIoProperties minIo) {
        this.minIo = minIo;
    }

    public FileCenterProperties getCenter() {
        return center;
    }

    public void setCenter(FileCenterProperties center) {
        this.center = center;
    }
}
