MessageHandlerAsync.Event.cs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. #region Apache License Version 2.0
  2. /*----------------------------------------------------------------
  3. Copyright 2019 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  5. except in compliance with the License. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software distributed under the
  8. License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  9. either express or implied. See the License for the specific language governing permissions
  10. and limitations under the License.
  11. Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
  12. ----------------------------------------------------------------*/
  13. #endregion Apache License Version 2.0
  14. /*----------------------------------------------------------------
  15. Copyright (C) 2019 Senparc
  16. 文件名:MessageHandlerAsync.Event.cs
  17. 文件功能描述:微信请求【异步方法】的集中处理方法:Event相关
  18. 创建标识:Senparc - 20180122
  19. ----------------------------------------------------------------*/
  20. #if !NET35 && !NET40
  21. using Senparc.Weixin.Exceptions;
  22. using Senparc.Weixin.MP.Entities;
  23. using Senparc.Weixin.MP.Helpers;
  24. using Senparc.NeuChar.MessageHandlers;
  25. using System.Threading.Tasks;
  26. using System;
  27. using Senparc.NeuChar.Entities;
  28. namespace Senparc.Weixin.MP.MessageHandlers
  29. {
  30. public abstract partial class MessageHandler<TC>
  31. {
  32. /// <summary>
  33. /// 【异步方法】Event事件类型请求
  34. /// </summary>
  35. public virtual async Task<IResponseMessageBase> OnEventRequestAsync(IRequestMessageEventBase requestMessage)
  36. {
  37. var strongRequestMessage = RequestMessage as IRequestMessageEventBase;
  38. IResponseMessageBase responseMessage = null;
  39. var weixinAppId = this._postModel == null ? "" : this._postModel.AppId;
  40. switch (strongRequestMessage.Event)
  41. {
  42. case Event.ENTER:
  43. responseMessage = await OnEvent_EnterRequestAsync(RequestMessage as RequestMessageEvent_Enter);
  44. break;
  45. case Event.LOCATION://自动发送的用户当前位置
  46. responseMessage = await OnEvent_LocationRequestAsync(RequestMessage as RequestMessageEvent_Location);
  47. break;
  48. case Event.subscribe://订阅
  49. responseMessage = await OnEvent_SubscribeRequestAsync(RequestMessage as RequestMessageEvent_Subscribe);
  50. break;
  51. case Event.unsubscribe://退订
  52. responseMessage = await OnEvent_UnsubscribeRequestAsync(RequestMessage as RequestMessageEvent_Unsubscribe);
  53. break;
  54. case Event.CLICK://菜单点击
  55. responseMessage = await CurrentMessageHandlerNode.ExecuteAsync(RequestMessage, this, weixinAppId) ??
  56. await OnEvent_ClickRequestAsync(RequestMessage as RequestMessageEvent_Click);
  57. break;
  58. case Event.scan://二维码
  59. responseMessage = await OnEvent_ScanRequestAsync(RequestMessage as RequestMessageEvent_Scan);
  60. break;
  61. case Event.VIEW://URL跳转(view视图)
  62. responseMessage = await OnEvent_ViewRequestAsync(RequestMessage as RequestMessageEvent_View);
  63. break;
  64. case Event.MASSSENDJOBFINISH://群发消息成功
  65. responseMessage = await OnEvent_MassSendJobFinishRequestAsync(RequestMessage as RequestMessageEvent_MassSendJobFinish);
  66. break;
  67. case Event.TEMPLATESENDJOBFINISH://推送模板消息成功
  68. responseMessage = await OnEvent_TemplateSendJobFinishRequestAsync(RequestMessage as RequestMessageEvent_TemplateSendJobFinish);
  69. break;
  70. case Event.pic_photo_or_album://弹出拍照或者相册发图
  71. responseMessage = await OnEvent_PicPhotoOrAlbumRequestAsync(RequestMessage as RequestMessageEvent_Pic_Photo_Or_Album);
  72. break;
  73. case Event.scancode_push://扫码推事件
  74. responseMessage = await OnEvent_ScancodePushRequestAsync(RequestMessage as RequestMessageEvent_Scancode_Push);
  75. break;
  76. case Event.scancode_waitmsg://扫码推事件且弹出“消息接收中”提示框
  77. responseMessage = await OnEvent_ScancodeWaitmsgRequestAsync(RequestMessage as RequestMessageEvent_Scancode_Waitmsg);
  78. break;
  79. case Event.location_select://弹出地理位置选择器
  80. responseMessage = await OnEvent_LocationSelectRequestAsync(RequestMessage as RequestMessageEvent_Location_Select);
  81. break;
  82. case Event.pic_weixin://弹出微信相册发图器
  83. responseMessage = await OnEvent_PicWeixinRequestAsync(RequestMessage as RequestMessageEvent_Pic_Weixin);
  84. break;
  85. case Event.pic_sysphoto://弹出系统拍照发图
  86. responseMessage = await OnEvent_PicSysphotoRequestAsync(RequestMessage as RequestMessageEvent_Pic_Sysphoto);
  87. break;
  88. case Event.card_pass_check://卡券通过审核
  89. responseMessage = await OnEvent_Card_Pass_CheckRequestAsync(RequestMessage as RequestMessageEvent_Card_Pass_Check);
  90. break;
  91. case Event.card_not_pass_check://卡券未通过审核
  92. responseMessage = await OnEvent_Card_Not_Pass_CheckRequestAsync(RequestMessage as RequestMessageEvent_Card_Not_Pass_Check);
  93. break;
  94. case Event.user_get_card://领取卡券
  95. responseMessage = await OnEvent_User_Get_CardRequestAsync(RequestMessage as RequestMessageEvent_User_Get_Card);
  96. break;
  97. case Event.user_del_card://删除卡券
  98. responseMessage = await OnEvent_User_Del_CardRequestAsync(RequestMessage as RequestMessageEvent_User_Del_Card);
  99. break;
  100. case Event.kf_create_session://多客服接入会话
  101. responseMessage = await OnEvent_Kf_Create_SessionRequestAsync(RequestMessage as RequestMessageEvent_Kf_Create_Session);
  102. break;
  103. case Event.kf_close_session://多客服关闭会话
  104. responseMessage = await OnEvent_Kf_Close_SessionRequestAsync(RequestMessage as RequestMessageEvent_Kf_Close_Session);
  105. break;
  106. case Event.kf_switch_session://多客服转接会话
  107. responseMessage = await OnEvent_Kf_Switch_SessionRequestAsync(RequestMessage as RequestMessageEvent_Kf_Switch_Session);
  108. break;
  109. case Event.poi_check_notify://审核结果事件推送
  110. responseMessage = await OnEvent_Poi_Check_NotifyRequestAsync(RequestMessage as RequestMessageEvent_Poi_Check_Notify);
  111. break;
  112. case Event.WifiConnected://Wi-Fi连网成功
  113. responseMessage = await OnEvent_WifiConnectedRequestAsync(RequestMessage as RequestMessageEvent_WifiConnected);
  114. break;
  115. case Event.user_consume_card://卡券核销
  116. responseMessage = await OnEvent_User_Consume_CardRequestAsync(RequestMessage as RequestMessageEvent_User_Consume_Card);
  117. break;
  118. case Event.user_enter_session_from_card://从卡券进入公众号会话
  119. responseMessage = await OnEvent_User_Enter_Session_From_CardRequestAsync(RequestMessage as RequestMessageEvent_User_Enter_Session_From_Card);
  120. break;
  121. case Event.user_view_card://进入会员卡
  122. responseMessage = await OnEvent_User_View_CardRequestAsync(RequestMessage as RequestMessageEvent_User_View_Card);
  123. break;
  124. case Event.merchant_order://微小店订单付款通知
  125. responseMessage = await OnEvent_Merchant_OrderRequestAsync(RequestMessage as RequestMessageEvent_Merchant_Order);
  126. break;
  127. case Event.submit_membercard_user_info://接收会员信息事件通知
  128. responseMessage = await OnEvent_Submit_Membercard_User_InfoRequestAsync(RequestMessage as RequestMessageEvent_Submit_Membercard_User_Info);
  129. break;
  130. case Event.ShakearoundUserShake://摇一摇事件通知
  131. responseMessage = await OnEvent_ShakearoundUserShakeRequestAsync(RequestMessage as RequestMessageEvent_ShakearoundUserShake);
  132. break;
  133. case Event.user_gifting_card://卡券转赠事件推送
  134. responseMessage = await OnEvent_User_Gifting_CardRequestAsync(RequestMessage as RequestMessageEvent_User_Gifting_Card);
  135. break;
  136. case Event.user_pay_from_pay_cell://微信买单完成
  137. responseMessage = await OnEvent_User_Pay_From_Pay_CellRequestAsync(RequestMessage as RequestMessageEvent_User_Pay_From_Pay_Cell);
  138. break;
  139. case Event.update_member_card://会员卡内容更新事件:会员卡积分余额发生变动时
  140. responseMessage = await OnEvent_Update_Member_CardRequestAsync(RequestMessage as RequestMessageEvent_Update_Member_Card);
  141. break;
  142. case Event.card_sku_remind://卡券库存报警事件:当某个card_id的初始库存数大于200且当前库存小于等于100时
  143. responseMessage = await OnEvent_Card_Sku_RemindRequestAsync(RequestMessage as RequestMessageEvent_Card_Sku_Remind);
  144. break;
  145. case Event.card_pay_order://券点流水详情事件:当商户朋友的券券点发生变动时
  146. responseMessage = await OnEvent_Card_Pay_OrderRequestAsync(RequestMessage as RequestMessageEvent_Card_Pay_Order);
  147. break;
  148. case Event.apply_merchant_audit_info://创建门店小程序审核事件
  149. responseMessage = await OnEvent_Apply_Merchant_Audit_InfoRequestAsync(RequestMessage as RequestMessageEvent_ApplyMerchantAuditInfo);
  150. break;
  151. case Event.add_store_audit_info://门店小程序中创建门店审核事件
  152. responseMessage = await OnEvent_Add_Store_Audit_InfoAsync(RequestMessage as RequestMessageEvent_AddStoreAuditInfo);
  153. break;
  154. case Event.create_map_poi_audit_info://从腾讯地图中创建门店审核事件
  155. responseMessage = await OnEvent_Create_Map_Poi_Audit_InfoAsync(RequestMessage as RequestMessageEvent_CreateMapPoiAuditInfo);
  156. break;
  157. case Event.modify_store_audit_info://修改门店图片审核事件
  158. responseMessage = await OnEvent_Modify_Store_Audit_InfoAsync(RequestMessage as RequestMessageEvent_ModifyStoreAuditInfo);
  159. break;
  160. #region 微信认证事件推送
  161. case Event.qualification_verify_success://资质认证成功(此时立即获得接口权限)
  162. responseMessage = await OnEvent_QualificationVerifySuccessRequestAsync(RequestMessage as RequestMessageEvent_QualificationVerifySuccess);
  163. break;
  164. case Event.qualification_verify_fail://资质认证失败
  165. responseMessage = await OnEvent_QualificationVerifyFailRequestAsync(RequestMessage as RequestMessageEvent_QualificationVerifyFail);
  166. break;
  167. case Event.naming_verify_success://名称认证成功(即命名成功)
  168. responseMessage = await OnEvent_NamingVerifySuccessRequestAsync(RequestMessage as RequestMessageEvent_NamingVerifySuccess);
  169. break;
  170. case Event.naming_verify_fail://名称认证失败(这时虽然客户端不打勾,但仍有接口权限)
  171. responseMessage = await OnEvent_NamingVerifyFailRequestAsync(RequestMessage as RequestMessageEvent_NamingVerifyFail);
  172. break;
  173. case Event.annual_renew://年审通知
  174. responseMessage = await OnEvent_AnnualRenewRequestAsync(RequestMessage as RequestMessageEvent_AnnualRenew);
  175. break;
  176. case Event.verify_expired://认证过期失效通知
  177. responseMessage = await OnEvent_VerifyExpiredRequestAsync(RequestMessage as RequestMessageEvent_VerifyExpired);
  178. break;
  179. #endregion
  180. #region 小程序审核事件推送
  181. case Event.weapp_audit_success://
  182. responseMessage = await OnEvent_WeAppAuditSuccessRequestAsync(RequestMessage as RequestMessageEvent_WeAppAuditSuccess);
  183. break;
  184. case Event.weapp_audit_fail://
  185. responseMessage = await OnEvent_WeAppAuditFailRequestAsync(RequestMessage as RequestMessageEvent_WeAppAuditFail);
  186. break;
  187. #endregion
  188. #region 卡券回调
  189. case Event.giftcard_pay_done:
  190. responseMessage = await OnEvent_GiftCard_Pay_DoneRequestAsync(RequestMessage as RequestMessageEvent_GiftCard_Pay_Done);
  191. break;
  192. case Event.giftcard_send_to_friend:
  193. responseMessage = await OnEvent_GiftCard_Send_To_FriendRequestAsync(RequestMessage as RequestMessageEvent_GiftCard_Send_To_Friend);
  194. break;
  195. case Event.giftcard_user_accept:
  196. responseMessage = await OnEvent_GiftCard_User_AcceptRequestAsync(RequestMessage as RequestMessageEvent_GiftCard_User_Accept);
  197. break;
  198. #endregion
  199. default:
  200. throw new UnknownRequestMsgTypeException("未知的Event下属请求信息", null);
  201. }
  202. return responseMessage;
  203. }
  204. #region Event下属分类,接收事件方法
  205. /// <summary>
  206. /// 【异步方法】Event事件类型请求之ENTER
  207. /// </summary>
  208. public virtual async Task<IResponseMessageBase> OnEvent_EnterRequestAsync(RequestMessageEvent_Enter requestMessage)
  209. {
  210. return await DefaultAsyncMethod(requestMessage, () => OnEvent_EnterRequest(requestMessage));
  211. }
  212. /// <summary>
  213. /// 【异步方法】Event事件类型请求之LOCATION
  214. /// </summary>
  215. public virtual async Task<IResponseMessageBase> OnEvent_LocationRequestAsync(RequestMessageEvent_Location requestMessage)
  216. {
  217. return await DefaultAsyncMethod(requestMessage, () => OnEvent_LocationRequest(requestMessage));
  218. }
  219. /// <summary>
  220. /// 【异步方法】Event事件类型请求之subscribe
  221. /// </summary>
  222. public virtual async Task<IResponseMessageBase> OnEvent_SubscribeRequestAsync(RequestMessageEvent_Subscribe requestMessage)
  223. {
  224. return await DefaultAsyncMethod(requestMessage, () => OnEvent_SubscribeRequest(requestMessage));
  225. }
  226. /// <summary>
  227. /// 【异步方法】Event事件类型请求之unsubscribe
  228. /// </summary>
  229. public virtual async Task<IResponseMessageBase> OnEvent_UnsubscribeRequestAsync(RequestMessageEvent_Unsubscribe requestMessage)
  230. {
  231. return await DefaultAsyncMethod(requestMessage, () => OnEvent_UnsubscribeRequest(requestMessage));
  232. }
  233. /// <summary>
  234. /// 【异步方法】Event事件类型请求之CLICK
  235. /// </summary>
  236. public virtual async Task<IResponseMessageBase> OnEvent_ClickRequestAsync(RequestMessageEvent_Click requestMessage)
  237. {
  238. return await DefaultAsyncMethod(requestMessage, () => OnEvent_ClickRequest(requestMessage));
  239. }
  240. /// <summary>
  241. /// 【异步方法】Event事件类型请求之scan
  242. /// </summary>
  243. public virtual async Task<IResponseMessageBase> OnEvent_ScanRequestAsync(RequestMessageEvent_Scan requestMessage)
  244. {
  245. return await DefaultAsyncMethod(requestMessage, () => OnEvent_ScanRequest(requestMessage));
  246. }
  247. /// <summary>
  248. /// 【异步方法】事件之URL跳转视图(View)
  249. /// </summary>
  250. /// <returns></returns>
  251. public virtual async Task<IResponseMessageBase> OnEvent_ViewRequestAsync(RequestMessageEvent_View requestMessage)
  252. {
  253. return await DefaultAsyncMethod(requestMessage, () => OnEvent_ViewRequest(requestMessage));
  254. }
  255. /// <summary>
  256. /// 【异步方法】事件推送群发结果
  257. /// </summary>
  258. /// <returns></returns>
  259. public virtual async Task<IResponseMessageBase> OnEvent_MassSendJobFinishRequestAsync(RequestMessageEvent_MassSendJobFinish requestMessage)
  260. {
  261. return await DefaultAsyncMethod(requestMessage, () => OnEvent_MassSendJobFinishRequest(requestMessage));
  262. }
  263. /// <summary>
  264. /// 【异步方法】发送模板消息返回结果
  265. /// </summary>
  266. /// <returns></returns>
  267. public virtual async Task<IResponseMessageBase> OnEvent_TemplateSendJobFinishRequestAsync(RequestMessageEvent_TemplateSendJobFinish requestMessage)
  268. {
  269. return await DefaultAsyncMethod(requestMessage, () => OnEvent_TemplateSendJobFinishRequest(requestMessage));
  270. }
  271. /// <summary>
  272. /// 【异步方法】弹出拍照或者相册发图
  273. /// </summary>
  274. /// <returns></returns>
  275. public virtual async Task<IResponseMessageBase> OnEvent_PicPhotoOrAlbumRequestAsync(RequestMessageEvent_Pic_Photo_Or_Album requestMessage)
  276. {
  277. return await DefaultAsyncMethod(requestMessage, () => OnEvent_PicPhotoOrAlbumRequest(requestMessage));
  278. }
  279. /// <summary>
  280. /// 【异步方法】扫码推事件
  281. /// </summary>
  282. /// <returns></returns>
  283. public virtual async Task<IResponseMessageBase> OnEvent_ScancodePushRequestAsync(RequestMessageEvent_Scancode_Push requestMessage)
  284. {
  285. return await DefaultAsyncMethod(requestMessage, () => OnEvent_ScancodePushRequest(requestMessage));
  286. }
  287. /// <summary>
  288. /// 【异步方法】扫码推事件且弹出“消息接收中”提示框
  289. /// </summary>
  290. /// <returns></returns>
  291. public virtual async Task<IResponseMessageBase> OnEvent_ScancodeWaitmsgRequestAsync(RequestMessageEvent_Scancode_Waitmsg requestMessage)
  292. {
  293. return await DefaultAsyncMethod(requestMessage, () => OnEvent_ScancodeWaitmsgRequest(requestMessage));
  294. }
  295. /// <summary>
  296. /// 【异步方法】弹出地理位置选择器
  297. /// </summary>
  298. /// <returns></returns>
  299. public virtual async Task<IResponseMessageBase> OnEvent_LocationSelectRequestAsync(RequestMessageEvent_Location_Select requestMessage)
  300. {
  301. return await DefaultAsyncMethod(requestMessage, () => OnEvent_LocationSelectRequest(requestMessage));
  302. }
  303. /// <summary>
  304. /// 【异步方法】弹出微信相册发图器
  305. /// </summary>
  306. /// <returns></returns>
  307. public virtual async Task<IResponseMessageBase> OnEvent_PicWeixinRequestAsync(RequestMessageEvent_Pic_Weixin requestMessage)
  308. {
  309. return await DefaultAsyncMethod(requestMessage, () => OnEvent_PicWeixinRequest(requestMessage));
  310. }
  311. /// <summary>
  312. /// 【异步方法】弹出系统拍照发图
  313. /// </summary>
  314. /// <returns></returns>
  315. public virtual async Task<IResponseMessageBase> OnEvent_PicSysphotoRequestAsync(RequestMessageEvent_Pic_Sysphoto requestMessage)
  316. {
  317. return await DefaultAsyncMethod(requestMessage, () => OnEvent_PicSysphotoRequest(requestMessage));
  318. }
  319. /// <summary>
  320. /// 【异步方法】卡券通过审核
  321. /// </summary>
  322. /// <returns></returns>
  323. public virtual async Task<IResponseMessageBase> OnEvent_Card_Pass_CheckRequestAsync(RequestMessageEvent_Card_Pass_Check requestMessage)
  324. {
  325. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Card_Pass_CheckRequest(requestMessage));
  326. }
  327. /// <summary>
  328. /// 【异步方法】券未通过审核
  329. /// </summary>
  330. /// <returns></returns>
  331. public virtual async Task<IResponseMessageBase> OnEvent_Card_Not_Pass_CheckRequestAsync(RequestMessageEvent_Card_Not_Pass_Check requestMessage)
  332. {
  333. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Card_Not_Pass_CheckRequest(requestMessage));
  334. }
  335. /// <summary>
  336. /// 【异步方法】领取卡券
  337. /// </summary>
  338. /// <returns></returns>
  339. public virtual async Task<IResponseMessageBase> OnEvent_User_Get_CardRequestAsync(RequestMessageEvent_User_Get_Card requestMessage)
  340. {
  341. return await DefaultAsyncMethod(requestMessage, () => OnEvent_User_Get_CardRequest(requestMessage));
  342. }
  343. /// <summary>
  344. /// 【异步方法】删除卡券
  345. /// </summary>
  346. /// <returns></returns>
  347. public virtual async Task<IResponseMessageBase> OnEvent_User_Del_CardRequestAsync(RequestMessageEvent_User_Del_Card requestMessage)
  348. {
  349. return await DefaultAsyncMethod(requestMessage, () => OnEvent_User_Del_CardRequest(requestMessage));
  350. }
  351. /// <summary>
  352. /// 【异步方法】多客服接入会话
  353. /// </summary>
  354. /// <returns></returns>
  355. public virtual async Task<IResponseMessageBase> OnEvent_Kf_Create_SessionRequestAsync(RequestMessageEvent_Kf_Create_Session requestMessage)
  356. {
  357. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Kf_Create_SessionRequest(requestMessage));
  358. }
  359. /// <summary>
  360. /// 【异步方法】多客服关闭会话
  361. /// </summary>
  362. /// <returns></returns>
  363. public virtual async Task<IResponseMessageBase> OnEvent_Kf_Close_SessionRequestAsync(RequestMessageEvent_Kf_Close_Session requestMessage)
  364. {
  365. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Kf_Close_SessionRequest(requestMessage));
  366. }
  367. /// <summary>
  368. /// 【异步方法】多客服转接会话
  369. /// </summary>
  370. /// <returns></returns>
  371. public virtual async Task<IResponseMessageBase> OnEvent_Kf_Switch_SessionRequestAsync(RequestMessageEvent_Kf_Switch_Session requestMessage)
  372. {
  373. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Kf_Switch_SessionRequest(requestMessage));
  374. }
  375. /// <summary>
  376. /// 【异步方法】Event事件类型请求之审核结果事件推送
  377. /// </summary>
  378. public virtual async Task<IResponseMessageBase> OnEvent_Poi_Check_NotifyRequestAsync(RequestMessageEvent_Poi_Check_Notify requestMessage)
  379. {
  380. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Poi_Check_NotifyRequest(requestMessage));
  381. }
  382. /// <summary>
  383. /// 【异步方法】Event事件类型请求之Wi-Fi连网成功
  384. /// </summary>
  385. public virtual async Task<IResponseMessageBase> OnEvent_WifiConnectedRequestAsync(RequestMessageEvent_WifiConnected requestMessage)
  386. {
  387. return await DefaultAsyncMethod(requestMessage, () => OnEvent_WifiConnectedRequest(requestMessage));
  388. }
  389. /// <summary>
  390. /// 【异步方法】Event事件类型请求之卡券核销
  391. /// </summary>
  392. public virtual async Task<IResponseMessageBase> OnEvent_User_Consume_CardRequestAsync(RequestMessageEvent_User_Consume_Card requestMessage)
  393. {
  394. return await DefaultAsyncMethod(requestMessage, () => OnEvent_User_Consume_CardRequest(requestMessage));
  395. }
  396. /// <summary>
  397. /// 【异步方法】Event事件类型请求之从卡券进入公众号会话
  398. /// </summary>
  399. public virtual async Task<IResponseMessageBase> OnEvent_User_Enter_Session_From_CardRequestAsync(RequestMessageEvent_User_Enter_Session_From_Card requestMessage)
  400. {
  401. return await DefaultAsyncMethod(requestMessage, () => OnEvent_User_Enter_Session_From_CardRequest(requestMessage));
  402. }
  403. /// <summary>
  404. /// 【异步方法】Event事件类型请求之进入会员卡
  405. /// </summary>
  406. public virtual async Task<IResponseMessageBase> OnEvent_User_View_CardRequestAsync(RequestMessageEvent_User_View_Card requestMessage)
  407. {
  408. return await DefaultAsyncMethod(requestMessage, () => OnEvent_User_View_CardRequest(requestMessage));
  409. }
  410. /// <summary>
  411. /// 【异步方法】Event事件类型请求之微小店订单付款通知
  412. /// </summary>
  413. public virtual async Task<IResponseMessageBase> OnEvent_Merchant_OrderRequestAsync(RequestMessageEvent_Merchant_Order requestMessage)
  414. {
  415. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Merchant_OrderRequest(requestMessage));
  416. }
  417. /// <summary>
  418. /// 【异步方法】Event事件类型请求之接收会员信息事件通知
  419. /// </summary>
  420. public virtual async Task<IResponseMessageBase> OnEvent_Submit_Membercard_User_InfoRequestAsync(RequestMessageEvent_Submit_Membercard_User_Info requestMessage)
  421. {
  422. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Submit_Membercard_User_InfoRequest(requestMessage));
  423. }
  424. /// <summary>
  425. /// 【异步方法】Event事件类型请求之摇一摇事件通知
  426. /// </summary>
  427. public virtual async Task<IResponseMessageBase> OnEvent_ShakearoundUserShakeRequestAsync(RequestMessageEvent_ShakearoundUserShake requestMessage)
  428. {
  429. return OnEvent_ShakearoundUserShakeRequest(requestMessage);
  430. //return requestMessage.CreateResponseMessage<ResponseMessageNoResponse>();
  431. //return await DefaultAsyncMethod(requestMessage, () => OnEvent_XX(requestMessage));
  432. }
  433. /// <summary>
  434. /// 【异步方法】卡券转赠事件推送
  435. /// </summary>
  436. /// <param name="requestMessage"></param>
  437. /// <returns></returns>
  438. public virtual async Task<IResponseMessageBase> OnEvent_User_Gifting_CardRequestAsync(RequestMessageEvent_User_Gifting_Card requestMessage)
  439. {
  440. return await DefaultAsyncMethod(requestMessage, () => OnEvent_User_Gifting_CardRequest(requestMessage));
  441. }
  442. /// <summary>
  443. /// 【异步方法】微信买单完成
  444. /// </summary>
  445. /// <param name="requestMessage"></param>
  446. /// <returns></returns>
  447. public virtual async Task<IResponseMessageBase> OnEvent_User_Pay_From_Pay_CellRequestAsync(RequestMessageEvent_User_Pay_From_Pay_Cell requestMessage)
  448. {
  449. return await DefaultAsyncMethod(requestMessage, () => OnEvent_User_Pay_From_Pay_CellRequest(requestMessage));
  450. }
  451. /// <summary>
  452. /// 【异步方法】会员卡内容更新事件:会员卡积分余额发生变动时
  453. /// </summary>
  454. /// <param name="requestMessage"></param>
  455. /// <returns></returns>
  456. public virtual async Task<IResponseMessageBase> OnEvent_Update_Member_CardRequestAsync(RequestMessageEvent_Update_Member_Card requestMessage)
  457. {
  458. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Update_Member_CardRequest(requestMessage));
  459. }
  460. /// <summary>
  461. /// 【异步方法】卡券库存报警事件:当某个card_id的初始库存数大于200且当前库存小于等于100时
  462. /// </summary>
  463. /// <param name="requestMessage"></param>
  464. /// <returns></returns>
  465. public virtual async Task<IResponseMessageBase> OnEvent_Card_Sku_RemindRequestAsync(RequestMessageEvent_Card_Sku_Remind requestMessage)
  466. {
  467. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Card_Sku_RemindRequest(requestMessage));
  468. }
  469. /// <summary>
  470. /// 【异步方法】券点流水详情事件:当商户朋友的券券点发生变动时
  471. /// </summary>
  472. /// <param name="requestMessage"></param>
  473. /// <returns></returns>
  474. public virtual async Task<IResponseMessageBase> OnEvent_Card_Pay_OrderRequestAsync(RequestMessageEvent_Card_Pay_Order requestMessage)
  475. {
  476. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Card_Pay_OrderRequest(requestMessage));
  477. }
  478. /// <summary>
  479. /// 【异步方法】创建门店小程序审核事件
  480. /// </summary>
  481. /// <param name="requestMessage"></param>
  482. /// <returns></returns>
  483. public virtual async Task<IResponseMessageBase> OnEvent_Apply_Merchant_Audit_InfoRequestAsync(RequestMessageEvent_ApplyMerchantAuditInfo requestMessage)
  484. {
  485. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Apply_Merchant_Audit_InfoRequest(requestMessage));
  486. }
  487. /// <summary>
  488. /// 【异步方法】从腾讯地图中创建门店审核事件
  489. /// </summary>
  490. /// <param name="requestMessage"></param>
  491. /// <returns></returns>
  492. public virtual async Task<IResponseMessageBase> OnEvent_Create_Map_Poi_Audit_InfoAsync(RequestMessageEvent_CreateMapPoiAuditInfo requestMessage)
  493. {
  494. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Create_Map_Poi_Audit_Info(requestMessage));
  495. }
  496. /// <summary>
  497. /// 【异步方法】门店小程序中创建门店审核事件
  498. /// </summary>
  499. /// <param name="requestMessage"></param>
  500. /// <returns></returns>
  501. public virtual async Task<IResponseMessageBase> OnEvent_Add_Store_Audit_InfoAsync(RequestMessageEvent_AddStoreAuditInfo requestMessage)
  502. {
  503. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Add_Store_Audit_Info(requestMessage));
  504. }
  505. /// <summary>
  506. /// 【异步方法】修改门店图片审核事件
  507. /// </summary>
  508. /// <param name="requestMessage"></param>
  509. /// <returns></returns>
  510. public virtual async Task<IResponseMessageBase> OnEvent_Modify_Store_Audit_InfoAsync(RequestMessageEvent_ModifyStoreAuditInfo requestMessage)
  511. {
  512. return await DefaultAsyncMethod(requestMessage, () => OnEvent_Modify_Store_Audit_Info(requestMessage));
  513. }
  514. #region 微信认证事件推送
  515. /// <summary>
  516. /// 【异步方法】资质认证成功(此时立即获得接口权限)
  517. /// </summary>
  518. /// <param name="requestMessage"></param>
  519. /// <returns></returns>
  520. public virtual async Task<IResponseMessageBase> OnEvent_QualificationVerifySuccessRequestAsync(RequestMessageEvent_QualificationVerifySuccess requestMessage)
  521. {
  522. return await DefaultAsyncMethod(requestMessage, () => OnEvent_QualificationVerifySuccessRequest(requestMessage));
  523. }
  524. /// <summary>
  525. /// 【异步方法】资质认证失败
  526. /// </summary>
  527. /// <param name="requestMessage"></param>
  528. /// <returns></returns>
  529. public virtual async Task<IResponseMessageBase> OnEvent_QualificationVerifyFailRequestAsync(RequestMessageEvent_QualificationVerifyFail requestMessage)
  530. {
  531. return await DefaultAsyncMethod(requestMessage, () => OnEvent_QualificationVerifyFailRequest(requestMessage));
  532. }
  533. /// <summary>
  534. /// 【异步方法】名称认证成功(即命名成功)
  535. /// </summary>
  536. /// <param name="requestMessage"></param>
  537. /// <returns></returns>
  538. public virtual async Task<IResponseMessageBase> OnEvent_NamingVerifySuccessRequestAsync(RequestMessageEvent_NamingVerifySuccess requestMessage)
  539. {
  540. return await DefaultAsyncMethod(requestMessage, () => OnEvent_NamingVerifySuccessRequest(requestMessage));
  541. }
  542. /// <summary>
  543. /// 【异步方法】名称认证失败(这时虽然客户端不打勾,但仍有接口权限)
  544. /// </summary>
  545. /// <param name="requestMessage"></param>
  546. /// <returns></returns>
  547. public virtual async Task<IResponseMessageBase> OnEvent_NamingVerifyFailRequestAsync(RequestMessageEvent_NamingVerifyFail requestMessage)
  548. {
  549. return await DefaultAsyncMethod(requestMessage, () => OnEvent_NamingVerifyFailRequest(requestMessage));
  550. }
  551. /// <summary>
  552. /// 【异步方法】年审通知
  553. /// </summary>
  554. /// <param name="requestMessage"></param>
  555. /// <returns></returns>
  556. public virtual async Task<IResponseMessageBase> OnEvent_AnnualRenewRequestAsync(RequestMessageEvent_AnnualRenew requestMessage)
  557. {
  558. return await DefaultAsyncMethod(requestMessage, () => OnEvent_AnnualRenewRequest(requestMessage));
  559. }
  560. /// <summary>
  561. /// 【异步方法】认证过期失效通知
  562. /// </summary>
  563. /// <param name="requestMessage"></param>
  564. /// <returns></returns>
  565. public virtual async Task<IResponseMessageBase> OnEvent_VerifyExpiredRequestAsync(RequestMessageEvent_VerifyExpired requestMessage)
  566. {
  567. return await DefaultAsyncMethod(requestMessage, () => OnEvent_VerifyExpiredRequest(requestMessage));
  568. }
  569. #endregion
  570. #region 小程序审核事件推送
  571. /// <summary>
  572. /// 【异步方法】小程序审核失败通知
  573. /// </summary>
  574. /// <param name="requestMessage"></param>
  575. /// <returns></returns>
  576. public virtual async Task<IResponseMessageBase> OnEvent_WeAppAuditFailRequestAsync(RequestMessageEvent_WeAppAuditFail requestMessage)
  577. {
  578. return await DefaultAsyncMethod(requestMessage, () => OnEvent_WeAppAuditFailRequest(requestMessage));
  579. }
  580. /// <summary>
  581. /// 【异步方法】小程序审核成功通知
  582. /// </summary>
  583. /// <param name="requestMessage"></param>
  584. /// <returns></returns>
  585. public virtual async Task<IResponseMessageBase> OnEvent_WeAppAuditSuccessRequestAsync(RequestMessageEvent_WeAppAuditSuccess requestMessage)
  586. {
  587. return await DefaultAsyncMethod(requestMessage, () => OnEvent_WeAppAuditSuccessRequest(requestMessage));
  588. }
  589. #endregion
  590. #region 卡券回调
  591. /// <summary>
  592. /// 用户购买礼品卡付款成功
  593. /// </summary>
  594. public virtual async Task<IResponseMessageBase> OnEvent_GiftCard_Pay_DoneRequestAsync(RequestMessageEvent_GiftCard_Pay_Done requestMessage)
  595. {
  596. return await DefaultAsyncMethod(requestMessage, () => OnEvent_GiftCard_Pay_DoneRequest(requestMessage));
  597. }
  598. /// <summary>
  599. /// 用户购买后赠送
  600. /// </summary>
  601. public virtual async Task<IResponseMessageBase> OnEvent_GiftCard_Send_To_FriendRequestAsync(RequestMessageEvent_GiftCard_Send_To_Friend requestMessage)
  602. {
  603. return await DefaultAsyncMethod(requestMessage, () => OnEvent_GiftCard_Send_To_FriendRequest(requestMessage));
  604. }
  605. /// <summary>
  606. /// 用户领取礼品卡成功
  607. /// </summary>
  608. public virtual async Task<IResponseMessageBase> OnEvent_GiftCard_User_AcceptRequestAsync(RequestMessageEvent_GiftCard_User_Accept requestMessage)
  609. {
  610. return await DefaultAsyncMethod(requestMessage, () => OnEvent_GiftCard_User_AcceptRequest(requestMessage));
  611. }
  612. #endregion
  613. #endregion
  614. }
  615. }
  616. #endif