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 PickTypeEnum {
    YES(1,"自提"),
    NO(2,"物流快递");

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


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

}
