package com.ruoyi.common.enums;

import lombok.Data;
import lombok.Getter;

/**
 * @Author Tang, Shuai(shuatang @ deloitte.com.cn)
 * @Date 2024/12/28 19:48
 */
@Getter
public enum StockTypeEnum {
    PNORMAL("PNORMAL", "平台满减券"),
    PDISCOUNT("PDISCOUNT", "平台折扣券"),
    NORMAL("NORMAL", "微信满减券"),
    DISCOUNT("DISCOUNT", "微信折扣券"),
    EXCHANGE("EXCHANGE", "微信换购券"),
    PTRAIL("PTRAIL", "平台体验券");

    private final String label;
    private final String desc;

    private StockTypeEnum(String label, String desc) {
        this.label = label;
        this.desc = desc;
    }
    public static String getEnumLabel(String desc) {
        for (StockTypeEnum stockTypeEnum : values()) {
            if (stockTypeEnum.getDesc().equals(desc)) {
                return stockTypeEnum.getLabel();
            }
        }
        return "";
    }

    public static String getEnumDesc(String label) {
        for (StockTypeEnum stockTypeEnum : values()) {
            if (stockTypeEnum.getLabel().equals(label)){
                return stockTypeEnum.getDesc();
            }
        }
        return "";
    }
}
