package com.zfire.mall.manager.enums;


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

@Getter
@AllArgsConstructor
public enum PickIsEnum {
    YES("YES","是"),
    NO("NO","否");

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


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

}
