package com.yonge.cooleshow.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.yonge.toolset.base.enums.BaseEnum;

public enum YesOrNoEnum implements BaseEnum<Integer, YesOrNoEnum> {
    NO(0,"否"),
    YES(1,"是");
    @EnumValue
    private Integer code;
    private String msg;

    YesOrNoEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    public static YesOrNoEnum valueOf(Integer code) {
        YesOrNoEnum[] values = YesOrNoEnum.values();
        for (YesOrNoEnum value : values) {
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
