From 1deb3d68f4caf2f54107e67c991ec9e50b360fa0 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 20 十一月 2025 09:26:19 +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/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs b/ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs
index ab7383e..49e85f3 100644
--- a/ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs
+++ b/ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs
@@ -1,8 +1,12 @@
 锘縰sing ApiTools.Core;
+using Baidu.Aip.BodyAnalysis;
+using Furion;
 using Furion.DatabaseAccessor;
+using Furion.HttpRemote;
 using MediatR;
 using Microsoft.AspNetCore.Http;
 using Microsoft.EntityFrameworkCore;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -18,13 +22,15 @@
     public class SmsAliyunNotifyCommandHandler(
             IRepository<SmsSetting> repSmsSetting,
             IRepository<SmsLog> repSmsLog,
-            ApiTools.Core.SmsUtils smsUtils
+            ApiTools.Core.SmsUtils smsUtils,
+            IHttpRemoteService httpRemoteService
         )
         : IRequestHandler<SmsAliyunNotifyCommand, SmsAliyunNotifyCommandResult>
     {
         private readonly IRepository<SmsSetting> repSmsSetting = repSmsSetting;
         private readonly IRepository<SmsLog> repSmsLog = repSmsLog;
         private readonly Core.SmsUtils smsUtils = smsUtils;
+        private readonly IHttpRemoteService httpRemoteService = httpRemoteService;
 
         /// <summary>
         /// 闃块噷浜戠煭淇″钩鍙板洖浼犻�氱煡
@@ -34,6 +40,21 @@
         /// <returns></returns>
         public async Task<SmsAliyunNotifyCommandResult> Handle(SmsAliyunNotifyCommand request, CancellationToken cancellationToken)
         {
+            var env = App.GetConfig<string>("Environment");
+            if (env == "Product")
+            {
+                try
+                {
+                    var json = request.ToJson();
+                    await httpRemoteService.PostAsStringAsync("http://118.178.252.28:8780/api/common/sms/smsAliyunNotify",
+                        builder => builder.SetJsonContent(json));
+                }
+                catch
+                {
+
+                }
+            }
+
             var templateCodes = await EnumUtils.GetModel<EnumSmsTemplateCode>();
             var msgIds = request.DistinctSelect(it => it.BizId.ToString());
             var entities = await repSmsLog.AsQueryable()

--
Gitblit v1.9.1