package com.xingxi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: xingxi
 * @description: 是否标志
 * @author: bao
 * @create: 2022-02-14
 */
@AllArgsConstructor
@Getter
public enum EYesNo {
    YES("1", "是"),
    NO("0", "否");

    private String val;
    private String desc;

    /** 解析 */
    public static EYesNo parseByVal(String val) {
        for(EYesNo type : EYesNo.values()) {
            if(type.getVal().equalsIgnoreCase(val)) {
                return type;
            }
        }
        return EYesNo.NO;
    }
}
