package cn.hmsoft.weixin.processor.event;

import cn.hmsoft.helper.StringHelper;
import cn.hmsoft.log.LogHelper;
import cn.hmsoft.weixin.data.model.WxMsgProcessor;
import cn.hmsoft.weixin.entity.reply.WeiXinReply;
import cn.hmsoft.weixin.util.WeiXinUtil;

public class EventClickProcessor extends EvenBasicProcessor {

	@Override
	public WeiXinReply handleEvent() throws Exception {
		EventClickProcessor processor = null;
		WxMsgProcessor mPro = null;
		try {
			mPro = WeiXinUtil.getProcessorClass(this.wxDefine,
					"EventKey" + StringHelper.upperFirstChar(this.jsonEntity.getEventKey().toLowerCase()));
			if (mPro == null)
				return null;
			processor = (EventClickProcessor) Class.forName(mPro.getProcess_class()).newInstance();
		} catch (Exception e) {
			LogHelper.error(e);
		}
		if (processor == null)
			return null;

		return processor.handleEventClick();

	}

	protected WeiXinReply handleEventClick() throws Exception {
		return null;
	}

}
