package com.platform.modules.live.utils;

/**
 * Created by TROY on 2019/2/16.
 */
public enum CommentSourceEnum {
	/**
	 * 用户
	 */
	USER("用户", 1),
	/**
	 * 后台
	 */
	BACKGROUD("后台", 2),
	/**
	 * 第三方平台
	 */
	THIRDPLATFORM("第三方平台", 3);

	private String type;
	private Integer key;

	CommentSourceEnum(String type, Integer key) {
		this.type = type;
		this.key = key;
	}

	public static String getName(Integer key) {
		for (CommentSourceEnum type : CommentSourceEnum.values()) {
			if(type.getKey().equals(key)) {
				return type.getType();
			}
		}
		return  null;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getKey() {
		return key;
	}

	public void setKey(Integer key) {
		this.key = key;
	}
}
