package org.springblade.modules.app.common.enums;

public enum StateEnum {
    /**
     * 状态枚举
     */
    INIT(0, "初始"),
    EFFECT(1, "生效"),
    INVALID(2, "作废"),;

    private Integer code;
    private String remark;

    StateEnum(Integer code, String remark) {
        this.code = code;
        this.remark = remark;
    }

    public static StateEnum getEnum(Integer code) {
        for (StateEnum positionEnum : StateEnum.values()) {
            if (positionEnum.getCode().equals(code)) {
                return positionEnum;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getRemark() {
        return remark;
    }
}

