MassMessageController.cs 922 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using JCSoft.WX.Framework.Api;
  6. using Microsoft.AspNetCore.Mvc;
  7. using JCSoft.WX.Framework.Models.ApiRequests;
  8. using JCSoft.WX.Framework.Models.ApiResponses;
  9. using ZcPeng.weixin.PublicAccount;
  10. using Microsoft.Extensions.Caching.Memory;
  11. namespace SupplierWeb.Controllers
  12. {
  13. [Route("api/SendmassMessage")]
  14. public class MassMessageController : BaseController
  15. {
  16. public MassMessageController(IMemoryCache cache, IApiClient client) : base(cache, client)
  17. {
  18. }
  19. public async Task<JsonResult> Get()
  20. {
  21. ErrorMessage errorMessage = null;
  22. long message = -1;
  23. message = await MassMessage.Send("gh_ab8f63a476a7", true, "group", MassMessageTypeEnum.text, "今晚打老虎", errorMessage);
  24. return Json(message);
  25. }
  26. }
  27. }