Hishop.Weixin.MP/Util/RequestMessageFactory.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Hishop.Weixin.MP.Util
{
    using Hishop.Weixin.MP;
    using Hishop.Weixin.MP.Request;
    using Hishop.Weixin.MP.Request.Event;
    using System;
    using System.Text.RegularExpressions;
    using System.Xml.Linq;

    public static class RequestMessageFactory
    {
        public static AbstractRequest GetRequestEntity(XDocument doc)
        {
            RequestMsgType msgType = MsgTypeHelper.GetMsgType(doc);
            AbstractRequest entity = null;
            switch (msgType)
            {
                case RequestMsgType.Text:
                    entity = new TextRequest();
                    break;

                case RequestMsgType.Image:
                    entity = new ImageRequest();
                    break;

                case RequestMsgType.Voice:
                    entity = new VoiceRequest();
                    break;

                case RequestMsgType.Video:
                    entity = new VideoRequest();
                    break;

                case RequestMsgType.Location:
                    entity = new LocationRequest();
                    break;

                case RequestMsgType.Link:
                    entity = new LinkRequest();
                    break;

                case RequestMsgType.Event:
                    switch (EventTypeHelper.GetEventType(doc))
                    {
                        case RequestEventType.Subscribe:
                            entity = new SubscribeEventRequest();
                            goto Label_00D1;

                        case RequestEventType.UnSubscribe:
                            entity = new UnSubscribeEventRequest();
                            goto Label_00D1;

                        case RequestEventType.Scan:
                            entity = new ScanEventRequest();
                            goto Label_00D1;

                        case RequestEventType.Location:
                            entity = new LocationEventRequest();
                            goto Label_00D1;

后面还有 30 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。