package com.iformall.enums;

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

/**
 * 任务状态：-1-关闭;0-待分配;1-洽谈中;2-意向签约;3-已完成
 */
public enum EnumTaskStatus {
	CLOSE(-1, "关闭"),
	CREATED(0, "待分配"),
	NEGOTIATING(1, "洽谈中"),
	INTENTION(2, "意向签约"),
	FINISH(3, "完成"),
	;

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

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

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

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

	public String getInfo() {
		return info;
	}
}
