package com.cool.store.enums;

/**
 * 预炸产品申请类型枚举
 * @Author suzhuhong
 * @Date 2025/6/23 16:01
 * @Version 1.0
 */
public enum PreFryApplyTypeEnum {
    HAS_REFRIGERATED_DISPLAY(1, "有冷藏展示柜"),
    HAS_NORMAL_DISPLAY(2, "有常温展示柜"),
    NO_DISPLAY(3, "无展示柜");

    private final int code;
    private final String description;

    PreFryApplyTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据code获取枚举
     */
    public static PreFryApplyTypeEnum getByCode(int code) {
        for (PreFryApplyTypeEnum type : values()) {
            if (type.code == code) {
                return type;
            }
        }
        return null;
    }

    /**
     * 根据code获取描述
     */
    public static String getDescriptionByCode(int code) {
        PreFryApplyTypeEnum type = getByCode(code);
        return type != null ? type.description : "";
    }
}

