PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Controllers/API/WeixinServiceController.cs

https://github.com/mjhuangzk/WeiXinMPSDK
C# | 42 lines | 12 code | 4 blank | 26 comment | 0 complexity | 6d4047870b440ed2adea2d8efc7682a2 MD5 | raw file
Possible License(s): BSD-2-Clause, BSD-3-Clause
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Net.Http;
  6. using System.Web.Http;
  7. namespace Senparc.Weixin.MP.Sample.Controllers
  8. {
  9. using System.Web.Routing;
  10. using Senparc.Weixin.MP;
  11. using Senparc.Weixin.MP.Entities;
  12. //TODO:由于微信对接受数据格式要求很严格,这里暂时放弃ApiController,使用普通Controller,见WeixinController.cs
  13. //public class WeixinServiceController : ApiController
  14. //{
  15. // // GET api/weixinservice
  16. // public object Get(/*string signature, string timestamp, string nonce, string echostr*/)
  17. // {
  18. // var routeDataTokens = base.ControllerContext.RouteData.Values;
  19. // var signature = routeDataTokens["signature"];
  20. // //string timestamp, string nonce, string echostr
  21. // return signature;
  22. // //if (CheckSignature.Check(signature, timestamp, nonce))
  23. // //{
  24. // // return new StringContent(echostr);
  25. // // return echostr;
  26. // //}
  27. // //else
  28. // //{
  29. // // return new StringContent(echostr);
  30. // //}
  31. // }
  32. // // POST api/weixinservice
  33. // public string Post([FromBody]string value, string signature, string timestamp, string nonce, string echostr)
  34. // {
  35. // return "OK";//XML
  36. // }
  37. //}
  38. }