package com.iformall.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 客户分类：0-潜在客户;1-意向客户;2-合作客户;3-谈判失败
 */
public enum EnumCustomerType {
    POTENTIAL(0, "潜在客户"),
    INTENTIONAL(1, "意向客户"),
    COOPERATIVE(2, "合作客户"),
    FAILURE(3, "谈判失败"),
	;

	public static EnumCustomerType getEnum(Integer code) {
		for (EnumCustomerType value : values()) {
			if (value.getCode().equals(code)) {
				return value;
			}
		}
		return null;
	}

	@EnumValue
	private final Integer code;
	private final String info;

    EnumCustomerType(Integer code, String info) {
		this.code = code;
		this.info = info;
	}

    @JsonValue
	public Integer getCode() {
		return code;
	}

	public String getInfo() {
		return info;
	}
}
