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 SalesOrderSyncStatusEnum {
    Yes(1,"推送成功"),
    NO(-1,"失败推送"),
    WAIT(0,"未推送");

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


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

}
