| | |
| | | using ApiTools.Core; |
| | | using Baidu.Aip; |
| | | using MediatR; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | |
| | | namespace ApiTools.CommonServer.Application |
| | | { |
| | | public class SaveWxCommandHandler(WxmpUtils utils) :IRequestHandler<WxmpUtils, Guid>,IRequestHandler<WxmpUtilsCommand, bool> |
| | | public class SaveWxCommandHandler(WxmpUtils utils) : IRequestHandler<SaveWxSendCommand, string> |
| | | { |
| | | |
| | | private readonly WxmpUtils utils = utils; |
| | | /// <summary> |
| | | /// 该接口用于发送订阅消息 |
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<string> Handle(SaveWxSendCommand request, CancellationToken cancellationToken) |
| | | { |
| | | return await utils.WxSend(new SendRequest |
| | | { |
| | | WxmpCode = request.WxmpCode, |
| | | //EnvVersion = request.EnvVersion, |
| | | Template_id = request.Template_id.ToString(), |
| | | Page = request.Page, |
| | | Touser = request.Touser, |
| | | Data = request.Data, |
| | | //miniprogram_state = request.miniprogram_state, |
| | | Lang = request.Lang |
| | | }); |
| | | } |
| | | } |
| | | } |