QiFeng.ZWY.Bll/WxInterfaceFunc/MsgRobotProccess.cs

(开头部分) 7KB

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

using System;
using System.Collections.Generic;
using log4net;
using QiFeng.LMSD.Model;

namespace QiFeng.LMSD.Bll.WxInterfaceFunc
{
    public class MsgRobotProccess
    {
        private readonly ILog _fileLog = LogManager.GetLogger(typeof(MsgRobotProccess));
        private readonly WxInterMsgFunc _wxInterMsgFunc = new WxInterMsgFunc();


        #region 响应用户上行信息
        /// <summary>
        /// 消息机器人入口
        /// </summary>
        /// <returns></returns>
        public string MsgRobotWork(WechatInfo wechatInfo, WechatMsgRev wechatMsgRev)
        {

#if DEBUG
            _fileLog.Info("MsgRobotProccess | MsgRobotWork | received message content - " + wechatMsgRev.MsgId);
#endif

            if (wechatInfo == null || wechatInfo.Id == 0 || string.IsNullOrWhiteSpace(wechatInfo.AppId) ||
                string.IsNullOrWhiteSpace(wechatMsgRev.FromUserName) || string.IsNullOrWhiteSpace(wechatMsgRev.MsgType))
            {
                _fileLog.Error("MsgRobotProccess | MsgRobotWork | Invalid wechatInfo data or invalid weChatMsgRev data");
                return null;
            }
            string strReplyMsg;

            var strMsgType = wechatMsgRev.MsgType;

            switch (strMsgType.ToLower())
            {
                case "text":
                case "image":
                case "voice":
                case "video":
                case "shortvideo":
                    strReplyMsg = ResponseToTextMsg(wechatInfo, wechatMsgRev);
                    break;
                case "event_subscribe":
                case "event_scan":
                case "event_subscribevoucher":
                    strReplyMsg = ResponseToSubcribeEvent(wechatInfo, wechatMsgRev);
                    break;
                default:
                    strReplyMsg = RobotMsg(wechatInfo, wechatMsgRev.FromUserName);
                    break;
            }

            return strReplyMsg;
        }

        /// <summary>
        /// 响应用户的文本信息
        /// </summary>
后面还有 161 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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