package com.cool.store.enums;


/**
 * 发货状态枚举
 */
public enum DeliveryStatusEnum  {

    NOT_DELIVERED(0, "未发货"),
    DELIVERED(1, "已发货");

    private final Integer code;
    private final String desc;

    DeliveryStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static DeliveryStatusEnum getByCode(Integer code) {
        for (DeliveryStatusEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}