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 GeJiangIsEnum {
    YES(1,"成功"),
    FAIL(-1,"失败"),
    NO(0,"未同步");

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


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

}
