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 OtherOrderTypeEnum {
    RETURN("RETURN","退货"),
    GENERAL("GENERAL","普通");

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


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

}
