package com.blueland.mybatisplus;

import lombok.Data;

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


@Data
public class TenantProperties {

    private static TenantProperties instance;

    private Boolean enable = true;

    private String defaultTenantId = "";

    /**
     * 多租户字段名称
     */
    private String column = "app_id";

    /**
     * 多租户系统数据表
     */
    private List<String> ignoreTables = new ArrayList<>();


    private TenantProperties() {
    }

    public static TenantProperties getInstance() {
        if (instance == null) {
            instance = new TenantProperties();
            instance.getIgnoreTables().addAll(Arrays.asList("t_area","t_pf_application","t_pf_application_db",
                    "t_pf_attachment","t_pf_data_model_field","t_pf_group","t_pf_group2user","t_pf_operat","t_pf_portal_area"));
        }
        return instance;
    }
}
