From fb245f04af0c848128da7d14c61694736b4afde7 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 20 十一月 2025 14:50:46 +0800
Subject: [PATCH] Merge branch 'dev-818-3.4.2.12' of http://120.26.58.240:8888/r/ApiTools into dev-818-3.4.2.12

---
 ApiTools.Application/WxUtils/Commands/SaveWxCommandHandler.cs |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/ApiTools.Application/WxUtils/Commands/SaveWxCommandHandler.cs b/ApiTools.Application/WxUtils/Commands/SaveWxCommandHandler.cs
new file mode 100644
index 0000000..6aa1365
--- /dev/null
+++ b/ApiTools.Application/WxUtils/Commands/SaveWxCommandHandler.cs
@@ -0,0 +1,36 @@
+锘縰sing ApiTools.Core;
+using Baidu.Aip;
+using MediatR;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ApiTools.CommonServer.Application
+{
+    public class SaveWxCommandHandler(WxmpUtils utils) : IRequestHandler<SaveWxSendCommand, string>
+    {
+        private readonly WxmpUtils utils = utils;
+        /// <summary>
+        /// 璇ユ帴鍙g敤浜庡彂閫佽闃呮秷鎭�
+        /// </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
+            });
+        }
+    }
+}

--
Gitblit v1.9.1