sunpengfei
2025-10-09 a559dd711a731316a944334b598ed7a075e76e0d
ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs
@@ -1,10 +1,12 @@
using 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;
@@ -38,18 +40,14 @@
        /// <returns></returns>
        public async Task<SmsAliyunNotifyCommandResult> Handle(SmsAliyunNotifyCommand request, CancellationToken cancellationToken)
        {
            if (App.GetConfig<string>("Environment") == "Product")
            var env = App.GetConfig<string>("Environment");
            if (env == "Product")
            {
                try
                {
                    await httpRemoteService.PostAsStringAsync("http://118.178.252.28:8780/api/common/sms/smsAliyunNotify",
                        builder => builder.SetJsonContent(request));
                }
                catch
                {
                }
                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()