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 ReservedOrderTypeEnum {
    YES(1,"开启"),
    NO(0,"关闭");

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


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

}
