package com.lingyue.parse.config;

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

import java.util.Arrays;
import java.util.List;

/**
 * 文件存储配置属性
 * 
 * @author lingyue
 * @since 2026-01-14
 */
@Data
@Component
@ConfigurationProperties(prefix = "file.storage")
public class FileStorageProperties {
    
    /**
     * 文件存储基础路径
     */
    private String basePath = "/data/lingyue/files";
    
    /**
     * 文本文件存储路径
     */
    private String textPath = "/data/lingyue/texts";
    
    /**
     * 允许的文件扩展名
     */
    private String allowedExtensions = "pdf,doc,docx,xls,xlsx,jpg,jpeg,png,gif";
    
    /**
     * 获取允许的扩展名列表
     */
    public List<String> getAllowedExtensionList() {
        return Arrays.asList(allowedExtensions.split(","));
    }
}
