public virtual ResponseMessage ProcessRequest(RequestMessage request) { switch (request.MsgType) { case MessageType.Text: return TextRequest(request as TextRequest); case MessageType.Image: return ImageRequest(request as ImageRequest); case MessageType.Voice: return VoiceRequest(request as VoiceRequest); case MessageType.Video: return VideoRequest(request as VideoRequest); case MessageType.Link: return LinkRequest(request as LinkRequest); case MessageType.Location: return LocationRequest(request as LocationRequest); case MessageType.Event: { EventRequest er = request as EventRequest; switch (er.Event.ToLower()) { case EventType.Subscribe: return SubscribeEventRequest(er as SubscribeEvent); case EventType.Unsubscribe: return this.UnsubscribeEventRequest(er); case EventType.Enter: return EnterEventRequest(er); case EventType.MASSSENDJOBFINISH: return MassSendFinishEventRequest(er as MassSendFinishEvent); case EventType.click: return ClickEventReqeust(er); case EventType.View: return ViewEventRequest(er); case EventType.Scan: return ScanEventRequest(er as SubscribeEvent); case EventType.Location: return LocationEventRequest(er as LocationEvent); default: throw new WxException("Not Support EventKey"); } } default: throw new WxException("NotSupport MessageType"); } }
public MusicResponse(RequestMessage message) : base("music", message) { }
public TextResponse(RequestMessage message) : base("text", message) { }
public NewsResponse(RequestMessage message) : base("news", message) { this.Articles = new List<Article>(); }
protected ResponseMessage(string messageType, RequestMessage rm) : this(messageType) { this.ToUserName = rm.FromUserName; this.FromUserName = rm.ToUserName; }
ResponseMessage DefaultText(RequestMessage request) { TextResponse tr = new TextResponse(request); tr.Content = XmlService.ToXml(request); return tr; }
public VoiceResponse(RequestMessage message) : base("voice", message) { }
public ImageResponse(RequestMessage message) : base("image", message) { }
public VideoResponse(RequestMessage message) : base("video", message) { }
public McsResponse(RequestMessage message) : base("transfer_customer_service", message) { }