package com.ruoyi.framework.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 部门数据隔离配置
 * 
 * 提供部门数据隔离功能的配置选项，包括功能开关、目标表配置等。
 * 
 * @author ruoyi
 */
@Configuration
@ConfigurationProperties(prefix = "department.isolation")
public class DepartmentDataConfig
{
    private static final Logger log = LoggerFactory.getLogger(DepartmentDataConfig.class);

    /**
     * 是否启用部门数据隔离功能
     */
    private boolean enabled = true;

    /**
     * 是否启用SQL日志记录
     */
    private boolean sqlLogging = false;

    /**
     * 超级管理员角色标识
     */
    private String superAdminRole = "admin";

    public boolean isEnabled()
    {
        return enabled;
    }

    public void setEnabled(boolean enabled)
    {
        this.enabled = enabled;
        log.info("部门数据隔离功能状态: {}", enabled ? "启用" : "禁用");
    }

    public boolean isSqlLogging()
    {
        return sqlLogging;
    }

    public void setSqlLogging(boolean sqlLogging)
    {
        this.sqlLogging = sqlLogging;
        log.info("部门数据隔离SQL日志记录: {}", sqlLogging ? "启用" : "禁用");
    }

    public String getSuperAdminRole()
    {
        return superAdminRole;
    }

    public void setSuperAdminRole(String superAdminRole)
    {
        this.superAdminRole = superAdminRole;
    }
}