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 ConfirmResultEnum {
    YES(true,"通过"),
    NO(false,"驳回");

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


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