package com.neusoft.smart.pos.mq.aliyunRocketMq;

import java.util.ArrayList;
import java.util.List;

import com.neusoft.smart.pos.framework.config.RabbitExchangeConfiguration;

public enum EnumMsgTopicTags {

	LOGIN_QUEUE1(RabbitExchangeConfiguration.FANOUT_EXCHANGE_LOGIN,RabbitExchangeConfiguration.LONGIN_QUEUE1_NAME),
	ORDER_COMPLETE_QUEUE1(RabbitExchangeConfiguration.FANOUT_EXCHANGE_ORDER_COMPLETE,RabbitExchangeConfiguration.ORDER_COMPLETE_QUEUE1_NAME),
	ORDER_COMPLETE_QUEUE2(RabbitExchangeConfiguration.FANOUT_EXCHANGE_ORDER_COMPLETE,RabbitExchangeConfiguration.ORDER_COMPLETE_QUEUE2_NAME),
	FILE_UPLOADED_QUEUE1(RabbitExchangeConfiguration.FANOUT_EXCHANGE_FILE_UPLOADED_NOTIFY,RabbitExchangeConfiguration.FILE_UPLOADED_NOTIFY_QUEUE1_NAME),
	FILE_UPLOADED_QUEUE2(RabbitExchangeConfiguration.FANOUT_EXCHANGE_FILE_UPLOADED_NOTIFY,RabbitExchangeConfiguration.FILE_UPLOADED_NOTIFY_QUEUE2_NAME),;
	
	
	private String topic;
	private String tags;
	
	EnumMsgTopicTags(String topic,String tags) {
		this.topic = topic;
		this.tags = tags;
	}
	public String getTopic() {
		return topic;
	}
	public void setTopic(String topic) {
		this.topic = topic;
	}
	public String getTags() {
		return tags;
	}
	public void setTags(String tags) {
		this.tags = tags;
	}
	
	public static List<EnumMsgTopicTags> getTagsByTopic(String topic) {
		List<EnumMsgTopicTags> list = new ArrayList<EnumMsgTopicTags>();
		for (EnumMsgTopicTags emtt: EnumMsgTopicTags.values()) {
			if (emtt.getTopic().equals(topic)) {
				list.add(emtt);
			}
		}
		if (list.size() <= 0) {
			return null;
		}
		return list;
	}
}
