package com.iformall.enums;

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

/**
 * 招商渠道：0-无;1-电视;2-广播;3-报纸;4-刊物;5-物联网;6-招商活动;7-中介机构;8-自定义渠道
 */
public enum EnumInvestChannel {
	NONE(0, ""),
	TV(1, "电视"),
	BROADCAST(2, "广播"),
	NEWSPAPER(3, "报纸"),
	PUBLICATION(4, "刊物"),
	INTERNET(5, "物联网"),
	ACTIVITIES(6, "招商活动"),
	AGENCY(7, "中介机构"),
	CUSTOMIZE(8, "自定义渠道"),
	;

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

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

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

	public Integer getCode() {
		return code;
	}

    @JsonValue
	public String getInfo() {
		return info;
	}
}
