package com.qiaoba.api.tenant.enums;

import lombok.Getter;

/**
 * 租户类型
 *
 * @author ailanyin
 * @version 1.0
 * @since 2023/6/5 16:33
 */
@Getter
public enum TenantModeEnum {

    /**
     * 字段模式-隔离级别最小
     */
    COLUMN("1", "字段模式"),

    /**
     * SCHEMA模式-隔离级别中等
     */
    SCHEMA("2", "SCHEMA模式"),

    /**
     * 数据源模式-隔离级别最大
     */
    DATASOURCE("3", "数据源模式");

    private final String mode;
    private final String info;

    TenantModeEnum(String code, String info) {
        this.mode = code;
        this.info = info;
    }

    public static Boolean isColumn(String mode) {
        return COLUMN.mode.equals(mode);
    }

    public static Boolean isSchema(String mode) {
        return SCHEMA.mode.equals(mode);
    }

    public static Boolean isDatasource(String mode) {
        return DATASOURCE.mode.equals(mode);
    }
}
