package com.gic.haoban.manage.api.enums.content;

/**
 * @Author MUSI
 * @Date 2023/3/18 8:26 PM
 * @Description
 * @Version
 * 导购分享素材类型枚举
 **/
public enum ShareBizType {

    MATERIAL(1, "素材","关联"),
    GOODS(2, "商品",""),
    MULTIPLE_GOODS(3, "多商品页面","页面中的");

    ShareBizType(Integer code, String desc,String goodsText) {
        this.code = code;
        this.desc = desc;
        this.goodsText = goodsText;
    }
    private Integer code;
    private String desc;
    /**
     * @see MaterialInteractRecordEventType VISIT_PRODUCT 第三个变量
     */
    private String goodsText;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getGoodsText() {
        return goodsText;
    }

    public static String getDescWithCode(Integer code) {
        for (ShareBizType value : values()) {
            if (value.code.equals(code)) {
                return value.desc;
            }
        }
        return "";
    }

    public static String getGoodsTextWithCode(Integer code) {
        for (ShareBizType value : values()) {
            if (value.code.equals(code)) {
                return value.goodsText;
            }
        }
        return "";
    }
}
