package com.ywt.mg.domain.models.enums;

/**
 * nutrimeal 项目的 meal_order 表里面type字段
 */
public enum MealOrderTypeEnum {
    /**
     * 订单类型:1-外卖配送；2-到店自取；
     */
    Delivery("外卖配送", 1),
    SelfPickUp("到店自取", 2);

    private final String displayName;

    private final int value;

    MealOrderTypeEnum(String displayName, int value){
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }


    public static String getDisplayName (int value){
        for (MealOrderTypeEnum typeEnum: MealOrderTypeEnum.values()) {
            if (typeEnum.value == value){
                return typeEnum.displayName;
            }
        }
        return "";
    }
}
