| | |
| | | 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, |
| | | page = request.page, |
| | | touser = request.touser, |
| | | data = request.data, |
| | | miniprogram_state = request.miniprogram_state, |
| | | lang = request.lang |
| | | }); |
| | | } |
| | | } |
| | | } |