package com.tzy.common.enums;


import org.apache.commons.lang3.StringUtils;

/**
 * app通知名称
 */
public enum NotifyNameEnum {

	CHAT("chat", "聊天通知"),
	PAY("pay", "交易通知"),
	ORDER("order", "订单通知"),
	SYSTEM("system", "系统通知"),
	ACT("act", "活动通知"),

	SALE("sale", "开售通知"),
	LIVE("live", "直播通知"),

	CHAT_LIKE("chat_like", "点赞"),
	COMMENT("comment", "评论"),
	MENTION("mention", "@提及"),
	NEW_FOLLOW("new_follow", "新增关注"),
	COLLECT("collect", "收藏"),

	MERCHANT_STORE("merchant_store", "店铺通知"),
	FORUM("forum", "社区通知");

	private String type;
	private String name;

	private NotifyNameEnum(String type, String name) {
		this.type = type;
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public String getName() {
		return name;
	}

	public static String getNameByType(String type) {
		if(StringUtils.isEmpty(type)){
			return "其他";
		}
		for (NotifyNameEnum n : NotifyNameEnum.values()) {
			if (n.getType().equalsIgnoreCase(type)) {
				return n.name;
			}
		}
		return "其他";
	}
}
