예제 #1
0
        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");
            }
        }
예제 #2
0
 public MusicResponse(RequestMessage message)
     : base("music", message)
 {
 }
예제 #3
0
 public TextResponse(RequestMessage message)
     : base("text", message)
 {
 }
예제 #4
0
 public NewsResponse(RequestMessage message)
     : base("news", message)
 {
     this.Articles = new List<Article>();
 }
예제 #5
0
 protected ResponseMessage(string messageType, RequestMessage rm)
     : this(messageType)
 {
     this.ToUserName = rm.FromUserName;
     this.FromUserName = rm.ToUserName;
 }
예제 #6
0
        ResponseMessage DefaultText(RequestMessage request)
        {
            TextResponse tr = new TextResponse(request);

            tr.Content = XmlService.ToXml(request);

            return tr;
        }
예제 #7
0
 public VoiceResponse(RequestMessage message)
     : base("voice", message)
 {
 }
예제 #8
0
 public ImageResponse(RequestMessage message)
     : base("image", message)
 {
 }
예제 #9
0
 public VideoResponse(RequestMessage message)
     : base("video", message)
 {
 }
예제 #10
0
 public McsResponse(RequestMessage message)
     : base("transfer_customer_service", message)
 {
 }