package com.iformall.enums;

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

/**
 * 操作类型：0-添加;1-更新;2-删除
 */
public enum EnumTableOperateType {
	ADD(0, "添加"),
	UPDATE(1, "更新"),
	DELETE(2, "删除"),
	;

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

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

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

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

	public String getInfo() {
		return info;
	}
}
