package com.ruoyi.kkfileview.config;

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

/**
 * kkFileView 配置类
 * 
 * @author jackeyhuang
 * @version 1.0.0
 * @date 2026-01-11
 */
@Component
@ConfigurationProperties(prefix = "kkfileview")
public class KkFileViewConfig
{
    /** 是否启用 */
    private boolean enabled = true;
    
    /** 文件存储路径 */
    private String fileSaveDir;
    
    /** 缓存清理时间（分钟） */
    private int cacheCleanTime = 60;
    
    /** OpenOffice/LibreOffice 安装路径 */
    private String officeHome;
    
    /** 支持的预览文件类型 */
    private String previewTypes = "doc,docx,xls,xlsx,ppt,pptx,pdf,txt,csv,md,html,htm,xml,json";

    public boolean isEnabled()
    {
        return enabled;
    }

    public void setEnabled(boolean enabled)
    {
        this.enabled = enabled;
    }

    public String getFileSaveDir()
    {
        return fileSaveDir;
    }

    public void setFileSaveDir(String fileSaveDir)
    {
        this.fileSaveDir = fileSaveDir;
    }

    public int getCacheCleanTime()
    {
        return cacheCleanTime;
    }

    public void setCacheCleanTime(int cacheCleanTime)
    {
        this.cacheCleanTime = cacheCleanTime;
    }

    public String getOfficeHome()
    {
        return officeHome;
    }

    public void setOfficeHome(String officeHome)
    {
        this.officeHome = officeHome;
    }

    public String getPreviewTypes()
    {
        return previewTypes;
    }

    public void setPreviewTypes(String previewTypes)
    {
        this.previewTypes = previewTypes;
    }
}
