public static ReqMsgBase GetReqMsgEntity(XDocument doc) { ReqMsgBase reqMsg = null; string msgType = doc.Root.Element(CommonEnum.MSG_TYPE).Value; switch (msgType) { case MsgTypeEnum.TEXT: reqMsg = new ReqMsgText(); break; case MsgTypeEnum.EVENT: string eventType = doc.Root.Element(CommonEnum.EVENT_TYPE).Value; switch (eventType) { case "subscribe": reqMsg = new ReqEventSubscribe(); break; case "CLICK": reqMsg = new ReqEventClick(); break; } break; } EntityXmlHelper.FillEntityWithXml(reqMsg, doc); return(reqMsg); }
/// <summary> /// 构造函数 /// </summary> /// <param name="requestXml">请求的xml</param> public TextHandler(ReqMsgText reqMsg) { this.reqMsg = reqMsg; }
public ReponseMsgCustomerService(ReqMsgText req) : this() { this.ToUserName = req.FromUserName; this.FromUserName = req.ToUserName; }