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

import java.util.Objects;

public enum ShareCustomerSourceType {

    OTHER(-1, "其他"),
    INTENT_CUSTOMER(1, "意向客户"),
    SMART_SELECTION(2, "智能选款"),
    LINKED_ORDER_RECOMMENDATION(3, "连单推荐");


    public static ShareCustomerSourceType getInstance(Integer code) {
        for (ShareCustomerSourceType shareCustomerSourceType : values()) {
            if (shareCustomerSourceType.code.equals(code)) {
                return shareCustomerSourceType;
            }
        }
        return null;
    }

    public static String getDesc(Integer code) {
        for (ShareCustomerSourceType shareCustomerSourceType : values()) {
            if (Objects.equals(code, ShareCustomerSourceType.OTHER.code)) {
                return "";
            }
            if (shareCustomerSourceType.code.equals(code)) {
                return shareCustomerSourceType.getDesc();
            }
        }
        return "";
    }

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

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
