XmlDocument requestDocXml = new XmlDocument();
requestDocXml.LoadXml(sEchoStr);
XmlElement rootElement = requestDocXml.DocumentElement;
WxXmlModel WxXmlModel = new WxXmlModel();
WxXmlModel.ToUserName = rootElement.SelectSingleNode(“ToUserName”).InnerText;
WxXmlModel.FromUserName = rootElement.SelectSingleNode(“FromUserName”).InnerText;
WxXmlModel.CreateTime = rootElement.SelectSingleNode(“CreateTime”).InnerText;
WxXmlModel.MsgType = rootElement.SelectSingleNode(“MsgType”).InnerText;
WxXmlModel.AgentID = rootElement.SelectSingleNode(“AgentID”).InnerText;
WxXmlModel.CompanyId = companyid;
switch (WxXmlModel.MsgType)
{
case “text”😕/文本
WxXmlModel.Content = rootElement.SelectSingleNode(“Content”).InnerText;
break;
case “image”😕/图片
WxXmlModel.PicUrl = rootElement.SelectSingleNode(“PicUrl”).InnerText;
break;
case “event”😕/事件
WxXmlModel.Event = rootElement.SelectSingleNode(“Event”).InnerText;
if (WxXmlModel.Event == “click”)//菜单点击
{
WxXmlModel.EventKey = rootElement.SelectSingleNode(“EventKey”).InnerText;
SH.WebApp.WeChatHelper.Report.sendMsg(WxXmlModel);
}
break;
default:
break;
}
string sReplyMsg = ResponseXML(WxXmlModel);//回复消息
ret = wxcpt.EncryptMsg(sReplyMsg, sVerifyTimeStamp, sVerifyNonce, ref sEchoStr);
if (ret != 0)
{
return;
}
Response.Write(sEchoStr);
Response.End();
return;
}
else
{
string sEncryptMsg = “”;
ret = wxcpt.VerifyURL(sVerifyMsgSig, sVerifyTimeStamp, sVerifyNonce, sVerifyEchoStr, ref sEncryptMsg);
if (ret != 0)
{
SH.Utilities.Base.Log.LogHelper.Info(“”, "ERR: VerifyURL fail, ret: " + ret);
Response.Write(“”);
Response.End();
return;
}
Response.Write(sEncryptMsg);
Response.End();
return;
}
}
2、根据不同用户行为操作做不同的消息类型回复
private string ResponseXML(WxXmlModel WxXmlModel)
{
string XML = “”;
switch (WxXmlModel.MsgType)
{
case “text”😕/文本回复
//批号查询
if (SH.WebApp.Extension.Utilities.IsBatchNumber(WxXmlModel))
{
WxXmlModel.EventKey = “BatchNumber_Search”;
XML = SH.WebApp.WeChatHelper.Report.sendMsg(WxXmlModel);
}
//流转卡查询
else if (SH.WebApp.Extension.Utilities.IsTransferCard(WxXmlModel))
{
WxXmlModel.EventKey = “TransferCard_Search”;
XML = SH.WebApp.WeChatHelper.Report.sendMsg(WxXmlModel);
}
//默认自动回复
else
{
XML = ResponseMessage.GetText(WxXmlModel.FromUserName, WxXmlModel.ToUserName, WxXmlModel.Content);
}
break;
case “event”:
switch (WxXmlModel.Event)
{
//点击菜单
case “click”:
if (string.IsNullOrEmpty(WxXmlModel.EventKey))
{
XML = SH.WebApp.WeChatHelper.Report.sendMsg(WxXmlModel);
}
break;
case “SCAN”:
XML = ResponseMessage.ScanQrcode(WxXmlModel.FromUserName, WxXmlModel.ToUserName, WxXmlModel.EventKey);//扫描带参数二维码已关注 直接推送事件
break;
}
break;
default://默认回复
break;
}
return XML;
}
3、图文消息发送,更多格式请查阅企业微信开发API:https://work.weixin.qq.com/api/doc#90000/90135/90236
SH.Business.ReportModule.Financial FinancialBLL = new Business.ReportModule.Financial();
var url = string.Format(“https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={0}”, Access_Token.GetAccessToken(WxXmlModel.AgentID));
Hashtable ht = new Hashtable();
ht[“touser”] = WxXmlModel.FromUserName;
ht[“toparty”] = “”;
ht[“totag”] = “”;
ht[“msgtype”] = “news”;
ht[“agentid”] = WxXmlModel.AgentID;
Hashtable news = new Hashtable();
List articles = new List();
Hashtable mianArticle = new Hashtable();
mianArticle[“title”] = “财务对账”;
mianArticle[“url”] = “”;
mianArticle[“picurl”] = WebURL + “/Content/image/Financial_Reconciliation.jpg”;
articles.Add(mianArticle);
string sSalesNo = SH.Business.Utilities.GetSalespower(WxXmlModel.FromUserName);
var list = FinancialBLL.Financial_Reconciliation(WxXmlModel.CompanyId, sSalesNo);
foreach (var items in list)
{
Hashtable article = new Hashtable();
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:前端)
最后
文章到这里就结束了,如果觉得对你有帮助可以点个赞哦,如果有需要前端校招面试题PDF完整版的朋友可以点击这里即可获取,包括答案解析。
讲解视频,并且会持续更新!**
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:前端)
最后
文章到这里就结束了,如果觉得对你有帮助可以点个赞哦,如果有需要前端校招面试题PDF完整版的朋友可以点击这里即可获取,包括答案解析。
[外链图片转存中…(img-mA4oRJyV-1712592926646)]