package com.muyu.common.core.enums;

import lombok.Getter;

/**
 * @author dongzeliang
 * @version 1.0
 * @description: 系统开关
 * @date 2025/1/16 18:44
 */
@Getter
public enum SysNormalDisable {
    ENABLE("0", "正常"),
    DISABLE("1", "停用");
    private final String code;
    private final String info;

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

    /**
     * 是否启用
     * @param code 编码
     * @return 启用：true 禁用：false
     */
    public static boolean isEnable(String code) {
        return ENABLE.getCode().equals(code);
    }

    /**
     * 是否禁用
     * @param code 编码
     * @return 启用：false 禁用：true
     */
    public static boolean isDisable(String code) {
        return !isEnable(code);
    }

}
