WeChatController.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.Extensions.Logging;
  7. using Microsoft.Extensions.Options;
  8. using Microsoft.AspNetCore.Authorization;
  9. using System.Web;
  10. using MySystem.Areas.Admin.Controllers;
  11. using LitJson;
  12. using Library;
  13. using System.IO;
  14. namespace MySystem.Areas.Api.Controllers.v1
  15. {
  16. [Area("Api")]
  17. [Route("Api/[controller]/[action]")]
  18. public class WeChatController : BaseController
  19. {
  20. public WeChatController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
  21. {
  22. }
  23. #region 微信服务平台支付回调
  24. public Dictionary<string, string> Notice()
  25. {
  26. StreamReader sr = new StreamReader(Request.Body);
  27. string requestMes = sr.ReadToEnd();
  28. RedisDbconn.Instance.AddList("WeChatPayBack", requestMes);
  29. function.WriteLog(DateTime.Now.ToString() + "\r\n" + requestMes + "\r\n\r\n", "微信服务平台支付回调");
  30. Dictionary<string, string> dic = new Dictionary<string, string>();
  31. dic.Add("code", "SUCCESS");
  32. dic.Add("message", "成功");
  33. return dic;
  34. }
  35. #endregion
  36. }
  37. }