/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Controllers/API/WeixinServiceController.cs
C# | 42 lines | 12 code | 4 blank | 26 comment | 0 complexity | 6d4047870b440ed2adea2d8efc7682a2 MD5 | raw file
Possible License(s): BSD-2-Clause, BSD-3-Clause
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Web.Http;
- namespace Senparc.Weixin.MP.Sample.Controllers
- {
- using System.Web.Routing;
- using Senparc.Weixin.MP;
- using Senparc.Weixin.MP.Entities;
- //TODO:由于微信对接受数据格式要求很严格,这里暂时放弃ApiController,使用普通Controller,见WeixinController.cs
- //public class WeixinServiceController : ApiController
- //{
- // // GET api/weixinservice
- // public object Get(/*string signature, string timestamp, string nonce, string echostr*/)
- // {
- // var routeDataTokens = base.ControllerContext.RouteData.Values;
- // var signature = routeDataTokens["signature"];
- // //string timestamp, string nonce, string echostr
- // return signature;
- // //if (CheckSignature.Check(signature, timestamp, nonce))
- // //{
- // // return new StringContent(echostr);
- // // return echostr;
- // //}
- // //else
- // //{
- // // return new StringContent(echostr);
- // //}
- // }
- // // POST api/weixinservice
- // public string Post([FromBody]string value, string signature, string timestamp, string nonce, string echostr)
- // {
- // return "OK";//XML
- // }
- //}
- }