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 CorrespondTypeEnum {
    YES(1,"实物仓"),
    NO(2,"虚拟仓");

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


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

}
