package com.cyksj.service.gzh.factory;

import com.cyksj.model.dto.MsgEvent;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/*
 *项目名: netflix
 *文件名: GzhMsgServiceFactory
 *创建者: JavaZou
 *创建时间:2023/1/13 18:16
 */
@Component
public class GzhMsgServiceFactory {

	@Resource
	Map<String, GzhMsgService> ghzMsgServiceMap = new ConcurrentHashMap<>();


	public String handleMsg(MsgEvent msgEvent) {
		GzhMsgService gzhMsgService = ghzMsgServiceMap.get(msgEvent.getMsgType().name());
		if (gzhMsgService == null) {
			return "";
		}
		return gzhMsgService.handleNotify(msgEvent);
	}
}
