package com.iformall.enums;

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

/**
 * 拜访方式：0-拜访;1-来访;2-电话;3-短信、微信或其它
 */
public enum EnumNegotiationType {
	TO_VISIT(0, "拜访"),
	COME_VISIT(1, "来访"),
	TELEPHONE(2, "电话"),
	MESSAGE(3, "短信、微信或其它"),
	;

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

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

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

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

	public String getInfo() {
		return info;
	}
}
