From a559dd711a731316a944334b598ed7a075e76e0d Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 09 十月 2025 16:39:24 +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..a023765 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://localhost:5010/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