package com.zfire.jiasm.syncdata.api;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum IsEnum implements BaseEnum {
    YES("YES","是"),
    NO("NO","否");

    @EnumValue
    @JsonValue
    private final String key;
    private final String value;

    public static IsEnum findEnumByKey(String key) {
        IsEnum[] values = IsEnum.values();
        for (IsEnum isEnum : values) {
            if (isEnum.getKey().equals(key)) {
                return isEnum;
            }
        }
        return null;
    }

}
