From 80f6077d513ecb6888eac4b16ca5a7154929595d Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 09 十月 2025 16:40:03 +0800
Subject: [PATCH] feat:开发

---
 ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs b/ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs
index ab7383e..ffa3af0 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,14 @@
         /// <returns></returns>
         public async Task<SmsAliyunNotifyCommandResult> Handle(SmsAliyunNotifyCommand request, CancellationToken cancellationToken)
         {
+            var env = App.GetConfig<string>("Environment");
+            if (env == "Product")
+            {
+                var json = request.ToJson();
+                await httpRemoteService.PostAsStringAsync("http://118.178.252.28:8780/api/common/sms/smsAliyunNotify",
+                    builder => builder.SetJsonContent(json));
+            }
+
             var templateCodes = await EnumUtils.GetModel<EnumSmsTemplateCode>();
             var msgIds = request.DistinctSelect(it => it.BizId.ToString());
             var entities = await repSmsLog.AsQueryable()

--
Gitblit v1.9.1