package com.iformall.enums;

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

/**
 * 客户预评级：0-无;1-主力店;2-次主力店;3-甲;4-乙;5-丙
 */
public enum EnumCustomerRatingType {
	NONE(0, ""),
	MAIN(1, "主力店"),
    SECONDARY(2, "次主力店"),
    THIRD(3, "甲"),
    FOUR(4, "乙"),
    FIVE(5, "丙"),
	;

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

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

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

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

	public String getInfo() {
		return info;
	}
}
