ApiTools.Application/ApiTools.Application.xml
@@ -136,6 +136,19 @@ 查询渠道用户分页列表数据 </summary> </member> <member name="T:ApiTools.UserServer.Application.CheckHealthQueryHandler"> <summary> 健康校验 </summary> </member> <member name="M:ApiTools.UserServer.Application.CheckHealthQueryHandler.Handle(ApiTools.Core.CheckHealthQuery,System.Threading.CancellationToken)"> <summary> 健康校验 </summary> <param name="request"></param> <param name="cancellationToken"></param> <returns></returns> </member> <member name="T:ApiTools.CommonServer.Application.SaveSmsSettingCommandHandler"> <summary> 保存短信配置 @@ -159,7 +172,7 @@ 阿里云短信平台回传通知 </summary> </member> <member name="M:ApiTools.CommonServer.Application.SmsAliyunNotifyCommandHandler.#ctor(Furion.DatabaseAccessor.IRepository{ApiTools.Core.SmsSetting},Furion.DatabaseAccessor.IRepository{ApiTools.Core.SmsLog},ApiTools.Core.SmsUtils)"> <member name="M:ApiTools.CommonServer.Application.SmsAliyunNotifyCommandHandler.#ctor(Furion.DatabaseAccessor.IRepository{ApiTools.Core.SmsSetting},Furion.DatabaseAccessor.IRepository{ApiTools.Core.SmsLog},ApiTools.Core.SmsUtils,Furion.HttpRemote.IHttpRemoteService)"> <summary> 阿里云短信平台回传通知 </summary> ApiTools.Application/Resources/Queries/CheckHealthQueryHandler.cs
New file @@ -0,0 +1,27 @@ using ApiTools.Core; using MediatR; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ApiTools.UserServer.Application { /// <summary> /// 健康校验 /// </summary> public class CheckHealthQueryHandler : IRequestHandler<CheckHealthQuery, bool> { /// <summary> /// 健康校验 /// </summary> /// <param name="request"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public Task<bool> Handle(CheckHealthQuery request, CancellationToken cancellationToken) { return Task.FromResult(true); } } } ApiTools.Application/SmsUtils/Commands/SmsAliyunNotifyCommandHandler.cs
@@ -1,5 +1,7 @@ using ApiTools.Core; using Furion; using Furion.DatabaseAccessor; using Furion.HttpRemote; using MediatR; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; @@ -18,13 +20,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 +38,18 @@ /// <returns></returns> public async Task<SmsAliyunNotifyCommandResult> Handle(SmsAliyunNotifyCommand request, CancellationToken cancellationToken) { if (App.GetConfig<string>("Environment") == "Product") { try { await httpRemoteService.PostAsStringAsync("http://118.178.252.28:8780/api/common/sms/smsAliyunNotify", builder => builder.SetJsonContent(request)); } catch { } } var templateCodes = await EnumUtils.GetModel<EnumSmsTemplateCode>(); var msgIds = request.DistinctSelect(it => it.BizId.ToString()); var entities = await repSmsLog.AsQueryable() ApiTools.Application/SmsUtils/Commands/SmsChengLiYeNotifyCommandHandler.cs
@@ -1,5 +1,6 @@ using Baidu.Aip.BodyAnalysis; using ApiTools.Core; using ApiTools.Core; using Baidu.Aip.BodyAnalysis; using Furion; using Furion.DatabaseAccessor; using Furion.HttpRemote; using MediatR; @@ -22,7 +23,8 @@ IHttpContextAccessor httpContextAccessor, IRepository<SmsSetting> repSmsSetting, IRepository<SmsLog> repSmsLog, ApiTools.Core.SmsUtils smsUtils ApiTools.Core.SmsUtils smsUtils, IHttpRemoteService httpRemoteService ) : IRequestHandler<SmsChengLiYeNotifyCommand, bool> { @@ -30,6 +32,7 @@ private readonly IRepository<SmsSetting> repSmsSetting = repSmsSetting; private readonly IRepository<SmsLog> repSmsLog = repSmsLog; private readonly ApiTools.Core.SmsUtils smsUtils = smsUtils; private readonly IHttpRemoteService httpRemoteService = httpRemoteService; /// <summary> /// 诚立业短信平台回传通知 @@ -39,6 +42,18 @@ /// <returns></returns> public async Task<bool> Handle(SmsChengLiYeNotifyCommand request, CancellationToken cancellationToken) { if (App.GetConfig<string>("Environment") == "Product") { try { await httpRemoteService.PostAsStringAsync("http://118.178.252.28:8780/api/common/sms/smsChengLiYeNotify", builder => builder.SetJsonContent(request)); } catch { } } if (request.MsgReports.IsNotNull()) { var templateCodes = await EnumUtils.GetModel<EnumSmsTemplateCode>(); ApiTools.Core/ApiTools.Core.xml
@@ -764,16 +764,6 @@ 短信通道配置 </summary> </member> <member name="P:ApiTools.Core.SmsSettingAccess.ChannelId"> <summary> 渠道Id </summary> </member> <member name="P:ApiTools.Core.SmsSettingAccess.Channel"> <summary> 渠道 </summary> </member> <member name="P:ApiTools.Core.SmsSettingAccess.SettingId"> <summary> 配置Id @@ -792,6 +782,11 @@ <member name="P:ApiTools.Core.SmsSettingAccess.IsDisabled"> <summary> 是否禁用 </summary> </member> <member name="P:ApiTools.Core.SmsSettingAccess.SignName"> <summary> 签名名称 </summary> </member> <member name="T:ApiTools.Core.Channel"> @@ -1651,6 +1646,11 @@ 状态 </summary> </member> <member name="T:ApiTools.Core.CheckHealthQuery"> <summary> 健康校验 </summary> </member> <member name="T:ApiTools.Core.CheckVerifyCodeSmsCommand"> <summary> 校验验证码 @@ -1724,6 +1724,11 @@ <member name="P:ApiTools.Core.SaveSmsSettingCommandAccess.Sort"> <summary> 排序 </summary> </member> <member name="P:ApiTools.Core.SaveSmsSettingCommandAccess.SignName"> <summary> 签名名称 </summary> </member> <member name="T:ApiTools.Core.SendSmsCommand"> @@ -2076,6 +2081,11 @@ 排序 </summary> </member> <member name="P:ApiTools.Core.GetSmsSettingQueryResultAccess.SignName"> <summary> 签名名称 </summary> </member> <member name="T:ApiTools.Core.AlipayUtils"> <summary> 阿里支付工具 @@ -2198,11 +2208,6 @@ <member name="P:ApiTools.Core.AliyunSMSOptions.Version"> <summary> 版本 </summary> </member> <member name="P:ApiTools.Core.AliyunSMSOptions.SignName"> <summary> 签名名称 </summary> </member> <member name="P:ApiTools.Core.AliyunSMSOptions.RegionId"> @@ -5699,11 +5704,6 @@ 诚立业配置 </summary> </member> <member name="P:ApiTools.Core.ChengLiYeSmsOptions.SignName"> <summary> 签名名称 </summary> </member> <member name="P:ApiTools.Core.ChengLiYeSmsOptions.UserName"> <summary> 用户名 @@ -5878,10 +5878,11 @@ 回传消息 </summary> </member> <member name="M:ApiTools.Core.AliyunSmsService.SendAsync(System.String,ApiTools.Core.EnumSmsTemplateCode,System.Object,System.Threading.CancellationToken)"> <member name="M:ApiTools.Core.AliyunSmsService.SendAsync(System.String,System.String,ApiTools.Core.EnumSmsTemplateCode,System.Object,System.Threading.CancellationToken)"> <summary> 发送短信 </summary> <param name="signName"></param> <param name="phoneNumber">手机号码</param> <param name="templateCode">模板代码</param> <param name="templateParam">模板参数</param> @@ -5904,10 +5905,11 @@ <param name="key"></param> <returns></returns> </member> <member name="M:ApiTools.Core.ISmsService.SendAsync(System.String,ApiTools.Core.EnumSmsTemplateCode,System.Object,System.Threading.CancellationToken)"> <member name="M:ApiTools.Core.ISmsService.SendAsync(System.String,System.String,ApiTools.Core.EnumSmsTemplateCode,System.Object,System.Threading.CancellationToken)"> <summary> 发送短信 </summary> <param name="signName"></param> <param name="phoneNumber">手机号码</param> <param name="templateCode">模板代码</param> <param name="templateParam">模板参数</param> ApiTools.Core/Entities/SmsUtils/SmsSettingAccess.cs
@@ -13,16 +13,6 @@ public class SmsSettingAccess : CommonEntity<MasterDbContextLocator> { /// <summary> /// 渠道Id /// </summary> public Guid? ChannelId { get; set; } /// <summary> /// 渠道 /// </summary> public Channel Channel { get; set; } /// <summary> /// 配置Id /// </summary> public Guid SettingId { get; set; } @@ -42,5 +32,9 @@ /// </summary> public bool IsDisabled { get; set; } /// <summary> /// 签名名称 /// </summary> public string SignName { get; set; } } } ApiTools.Core/Models/Resources/Queries/CheckHealthQuery.cs
New file @@ -0,0 +1,17 @@ using MediatR; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ApiTools.Core { /// <summary> /// 健康校验 /// </summary> [Resource([EnumResourceController.UserServerResource], Method = EnumResourceMethod.Get, AllowAnonymous = true)] public class CheckHealthQuery : IRequest<bool> { } } ApiTools.Core/Models/SmsUtils/Commands/SaveSmsSettingCommand.cs
@@ -68,5 +68,10 @@ /// 排序 /// </summary> public int Sort { get; set; } /// <summary> /// 签名名称 /// </summary> public string SignName { get; set; } } } ApiTools.Core/Models/SmsUtils/Queries/GetSmsSettingQuery.cs
@@ -76,5 +76,10 @@ /// 排序 /// </summary> public int Sort { get; set; } /// <summary> /// 签名名称 /// </summary> public string SignName { get; set; } } } ApiTools.Core/Utils/AliyunUtils/AliyunOptions.cs
@@ -48,11 +48,6 @@ public string Version { get; set; } /// <summary> /// 签名名称 /// </summary> public string SignName { get; set; } /// <summary> /// 区域Id /// </summary> public string RegionId { get; set; } ApiTools.Core/Utils/SmsUtils/ChengLiYe/ChengLiYeSmsOptions.cs
@@ -18,10 +18,6 @@ } /// <summary> /// 签名名称 /// </summary> public string SignName { get; set; } /// <summary> /// 用户名 /// </summary> public string UserName { get; set; } ApiTools.Core/Utils/SmsUtils/Services/AliyunSmsService.cs
@@ -38,13 +38,14 @@ /// <summary> /// 发送短信 /// </summary> /// <param name="signName"></param> /// <param name="phoneNumber">手机号码</param> /// <param name="templateCode">模板代码</param> /// <param name="templateParam">模板参数</param> /// <param name="cancellationToken">取消令牌</param> /// <returns></returns> /// <exception cref="Oops"></exception> public async Task<SmsResponse> SendAsync(string phoneNumber, EnumSmsTemplateCode templateCode, object templateParam, CancellationToken cancellationToken) public async Task<SmsResponse> SendAsync(string signName, string phoneNumber, EnumSmsTemplateCode templateCode, object templateParam, CancellationToken cancellationToken) { AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config { @@ -56,7 +57,7 @@ AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest sendSmsRequest = new AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest { PhoneNumbers = phoneNumber, SignName = options.Value.SMS.SignName, SignName = signName, TemplateCode = options.Value.SMS.TemplateCodes[templateCode.ToString()], TemplateParam = templateParam.ToJson() }; ApiTools.Core/Utils/SmsUtils/Services/ChengLiYeSmsService.cs
@@ -24,7 +24,7 @@ private readonly IOptions<ChengLiYeSmsOptions> options = options; private readonly IHttpRemoteService httpRemoteService = httpRemoteService; public async Task<SmsResponse> SendAsync(string phoneNumber, EnumSmsTemplateCode templateCode, object templateParam, CancellationToken cancellationToken) public async Task<SmsResponse> SendAsync(string signName, string phoneNumber, EnumSmsTemplateCode templateCode, object templateParam, CancellationToken cancellationToken) { var content = options.Value.TemplateCodes[templateCode.ToString()]; if (templateParam != null) @@ -40,9 +40,9 @@ var body = new ChengLiYeSmsSubmitRequest { UserName = options.Value.UserName, Sign = MD5Encryption.Encrypt($"{options.Value.UserName}{options.Value.Password}{phoneNumber}【{options.Value.SignName}】{content}"), Sign = MD5Encryption.Encrypt($"{options.Value.UserName}{options.Value.Password}{phoneNumber}【{signName}】{content}"), Mobile = phoneNumber, Content = $"【{options.Value.SignName}】{content}", Content = $"【{signName}】{content}", }; var log = new ThreeResourceLog { ApiTools.Core/Utils/SmsUtils/Services/ISmsService.cs
@@ -13,12 +13,13 @@ /// <summary> /// 发送短信 /// </summary> /// <param name="signName"></param> /// <param name="phoneNumber">手机号码</param> /// <param name="templateCode">模板代码</param> /// <param name="templateParam">模板参数</param> /// <param name="cancellationToken">取消令牌</param> /// <returns></returns> /// <exception cref="Oops"></exception> Task<SmsResponse> SendAsync(string phoneNumber, EnumSmsTemplateCode templateCode, object templateParam, CancellationToken cancellationToken); Task<SmsResponse> SendAsync(string signName, string phoneNumber, EnumSmsTemplateCode templateCode, object templateParam, CancellationToken cancellationToken); } } ApiTools.Core/Utils/SmsUtils/SmsUtils.cs
@@ -165,18 +165,17 @@ /// <param name="setting"></param> /// <param name="fromEntity"></param> /// <returns></returns> private EnumSmsAccess? GetSmsAccess(SmsSetting setting, SmsLog fromEntity) private SmsSettingAccess GetSmsAccess(SmsSetting setting, SmsLog fromEntity) { var accesses = setting.Accesses .OrderBy(it => it.Sort) .Where(it => !it.IsDisabled) .ToList(); EnumSmsAccess? access = null; SmsSettingAccess? access = null; if (fromEntity == null) { access = accesses .FirstOrDefault() ?.Access; .FirstOrDefault(); } else { @@ -187,8 +186,7 @@ { access = accesses .Where(it => it.Sort > sort) .FirstOrDefault() ?.Access; .FirstOrDefault(); } } return access; @@ -256,14 +254,14 @@ else { var access = GetSmsAccess(setting, fromEntity); if (access.HasValue) if (access != null) { var smsService = GetSmsService(access.Value); var smsService = GetSmsService(access.Access); var entity = new SmsLog { ChannelId = setting.ChannelId, ChannelCreatedUserId = model.ChannelCreatedUserId, Access = access.Value, Access = access.Access, PhoneNumber = model.PhoneNumber, TemplateCode = model.TemplateCode.ToString(), TemplateParam = templateParam.ToJson(), @@ -271,7 +269,7 @@ Status = EnumSmsStatus.Wait }; await rep.InsertNowAsync(entity); var response = await smsService.SendAsync(model.PhoneNumber, model.TemplateCode, templateParam, cancellationToken); var response = await smsService.SendAsync(access.SignName, model.PhoneNumber, model.TemplateCode, templateParam, cancellationToken); if (response != null) { entity.Status = response.Status; ApiTools.Database.Migrations/Migrations/20251009023927_UpdateSmsSetting1009.Designer.cs
New file @@ -0,0 +1,651 @@ // <auto-generated /> using System; using ApiTools.EntityFramework.Core; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace ApiTools.Database.Migrations.Migrations { [DbContext(typeof(DefaultDbContext))] [Migration("20251009023927_UpdateSmsSetting1009")] partial class UpdateSmsSetting1009 { /// <inheritdoc /> protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "9.0.2") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); modelBuilder.Entity("ApiTools.Core.Channel", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Code") .HasColumnType("nvarchar(max)"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsDisabled") .HasColumnType("bit"); b.Property<string>("Name") .HasColumnType("nvarchar(max)"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.ToTable("Channel"); }); modelBuilder.Entity("ApiTools.Core.Resource", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("ActionName") .HasColumnType("nvarchar(max)"); b.Property<string>("ActionSummary") .HasColumnType("nvarchar(max)"); b.Property<bool>("AllowAnonymous") .HasColumnType("bit"); b.Property<string>("ApplicationName") .HasColumnType("nvarchar(max)"); b.Property<string>("Code") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("ControllerName") .HasColumnType("nvarchar(max)"); b.Property<string>("ControllerSummary") .HasColumnType("nvarchar(max)"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<bool>("CustomResponse") .HasColumnType("bit"); b.Property<string>("DynamicAssemblyName") .HasColumnType("nvarchar(max)"); b.Property<bool>("FileUpload") .HasColumnType("bit"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsExpired") .HasColumnType("bit"); b.Property<bool>("IsFromForm") .HasColumnType("bit"); b.Property<int>("Method") .HasColumnType("int"); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("RequestTypeFullName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("RequestTypeName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("ResponseTypeFullName") .HasColumnType("nvarchar(max)"); b.Property<string>("ResponseTypeName") .HasColumnType("nvarchar(max)"); b.Property<string>("Route") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("RouteArea") .HasColumnType("nvarchar(max)"); b.Property<string>("ServiceName") .HasColumnType("nvarchar(max)"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.ToTable("Resource"); }); modelBuilder.Entity("ApiTools.Core.ScheduleJobDetail", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("AssemblyName") .HasColumnType("nvarchar(max)"); b.Property<bool>("Concurrent") .HasColumnType("bit"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<string>("Description") .HasColumnType("nvarchar(max)"); b.Property<string>("GroupName") .HasColumnType("nvarchar(max)"); b.Property<bool>("IncludeAnnotations") .HasColumnType("bit"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<string>("JobId") .HasColumnType("nvarchar(max)"); b.Property<string>("JobType") .HasColumnType("nvarchar(max)"); b.Property<string>("Properties") .HasColumnType("nvarchar(max)"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.ToTable("ScheduleJobDetail"); }); modelBuilder.Entity("ApiTools.Core.ScheduleJobTrigger", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Args") .HasColumnType("nvarchar(max)"); b.Property<string>("AssemblyName") .HasColumnType("nvarchar(max)"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<string>("Description") .HasColumnType("nvarchar(max)"); b.Property<long>("ElapsedTime") .HasColumnType("bigint"); b.Property<DateTime?>("EndTime") .HasColumnType("datetime2"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<string>("JobId") .HasColumnType("nvarchar(max)"); b.Property<DateTime?>("LastRunTime") .HasColumnType("datetime2"); b.Property<long>("MaxNumberOfErrors") .HasColumnType("bigint"); b.Property<long>("MaxNumberOfRuns") .HasColumnType("bigint"); b.Property<DateTime?>("NextRunTime") .HasColumnType("datetime2"); b.Property<long>("NumRetries") .HasColumnType("bigint"); b.Property<long>("NumberOfErrors") .HasColumnType("bigint"); b.Property<long>("NumberOfRuns") .HasColumnType("bigint"); b.Property<bool>("ResetOnlyOnce") .HasColumnType("bit"); b.Property<string>("Result") .HasColumnType("nvarchar(max)"); b.Property<int>("RetryTimeout") .HasColumnType("int"); b.Property<bool>("RunOnStart") .HasColumnType("bit"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<bool>("StartNow") .HasColumnType("bit"); b.Property<DateTime?>("StartTime") .HasColumnType("datetime2"); b.Property<long>("Status") .HasColumnType("bigint"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<string>("TriggerId") .HasColumnType("nvarchar(max)"); b.Property<string>("TriggerType") .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.ToTable("ScheduleJobTrigger"); }); modelBuilder.Entity("ApiTools.Core.SmsLog", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<int>("Access") .HasColumnType("int"); b.Property<Guid?>("ChannelCreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("ChannelId") .HasColumnType("uniqueidentifier"); b.Property<string>("Code") .HasColumnType("nvarchar(max)"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<DateTime?>("Expiry") .HasColumnType("datetime2"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsUsed") .HasColumnType("bit"); b.Property<string>("Message") .HasColumnType("nvarchar(max)"); b.Property<string>("PhoneNumber") .IsRequired() .HasMaxLength(11) .HasColumnType("nvarchar(11)"); b.Property<string>("RequestId") .HasColumnType("nvarchar(max)"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<int>("Status") .HasColumnType("int"); b.Property<string>("TemplateCode") .IsRequired() .HasMaxLength(128) .HasColumnType("nvarchar(128)"); b.Property<string>("TemplateParam") .HasColumnType("nvarchar(max)"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("ChannelId"); b.ToTable("SmsLog"); }); modelBuilder.Entity("ApiTools.Core.SmsSetting", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<Guid?>("ChannelId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<int>("DailyMaxCount") .HasColumnType("int"); b.Property<int>("HourlyMaxCount") .HasColumnType("int"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsDisabled") .HasColumnType("bit"); b.Property<int>("MinutelyMaxCount") .HasColumnType("int"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.Property<bool>("WithoutParams") .HasColumnType("bit"); b.HasKey("Id"); b.HasIndex("ChannelId"); b.ToTable("SmsSetting"); }); modelBuilder.Entity("ApiTools.Core.SmsSettingAccess", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<int>("Access") .HasColumnType("int"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<bool>("IsDisabled") .HasColumnType("bit"); b.Property<Guid>("SettingId") .HasColumnType("uniqueidentifier"); b.Property<string>("SignName") .HasColumnType("nvarchar(max)"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("SettingId"); b.ToTable("SmsSettingAccess"); }); modelBuilder.Entity("ApiTools.Core.User", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property<string>("Avatar") .HasColumnType("nvarchar(max)"); b.Property<Guid?>("ChannelId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("CreatedUserId") .HasColumnType("uniqueidentifier"); b.Property<bool>("IsCheckPhoneNumber") .HasColumnType("bit"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<int>("Level") .HasColumnType("int"); b.Property<string>("Name") .HasMaxLength(32) .HasColumnType("nvarchar(32)"); b.Property<string>("Password") .HasColumnType("nvarchar(max)"); b.Property<string>("PhoneNumber") .HasMaxLength(11) .HasColumnType("nvarchar(11)"); b.Property<string>("Remark") .HasColumnType("nvarchar(max)"); b.Property<int>("Sort") .HasColumnType("int"); b.Property<int>("Status") .HasColumnType("int"); b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); b.Property<int>("Type") .HasColumnType("int"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); b.Property<Guid?>("UpdatedUserId") .HasColumnType("uniqueidentifier"); b.Property<string>("UserName") .IsRequired() .HasMaxLength(32) .HasColumnType("nvarchar(32)"); b.HasKey("Id"); b.HasIndex("ChannelId"); b.ToTable("User"); b.HasData( new { Id = new Guid("11111111-1111-1111-1111-111111111111"), CreatedTime = new DateTimeOffset(new DateTime(2000, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), IsCheckPhoneNumber = false, IsDeleted = false, Level = 999, Name = "管理员", Password = "iEYggKrMhQ3ASUGLobra1w==:fn/DsMJUbD9FGpvBvR3moMpMPptdxzZlourPVhU479I=", Sort = 0, Status = 10, Type = 100, UserName = "system" }); }); modelBuilder.Entity("ApiTools.Core.SmsLog", b => { b.HasOne("ApiTools.Core.Channel", "Channel") .WithMany() .HasForeignKey("ChannelId"); b.Navigation("Channel"); }); modelBuilder.Entity("ApiTools.Core.SmsSetting", b => { b.HasOne("ApiTools.Core.Channel", "Channel") .WithMany() .HasForeignKey("ChannelId"); b.Navigation("Channel"); }); modelBuilder.Entity("ApiTools.Core.SmsSettingAccess", b => { b.HasOne("ApiTools.Core.SmsSetting", "Setting") .WithMany("Accesses") .HasForeignKey("SettingId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Setting"); }); modelBuilder.Entity("ApiTools.Core.User", b => { b.HasOne("ApiTools.Core.Channel", "Channel") .WithMany() .HasForeignKey("ChannelId"); b.Navigation("Channel"); }); modelBuilder.Entity("ApiTools.Core.SmsSetting", b => { b.Navigation("Accesses"); }); #pragma warning restore 612, 618 } } } ApiTools.Database.Migrations/Migrations/20251009023927_UpdateSmsSetting1009.cs
New file @@ -0,0 +1,59 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ApiTools.Database.Migrations.Migrations { /// <inheritdoc /> public partial class UpdateSmsSetting1009 : Migration { /// <inheritdoc /> protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_SmsSettingAccess_Channel_ChannelId", table: "SmsSettingAccess"); migrationBuilder.DropIndex( name: "IX_SmsSettingAccess_ChannelId", table: "SmsSettingAccess"); migrationBuilder.DropColumn( name: "ChannelId", table: "SmsSettingAccess"); migrationBuilder.AddColumn<string>( name: "SignName", table: "SmsSettingAccess", type: "nvarchar(max)", nullable: true); } /// <inheritdoc /> protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "SignName", table: "SmsSettingAccess"); migrationBuilder.AddColumn<Guid>( name: "ChannelId", table: "SmsSettingAccess", type: "uniqueidentifier", nullable: true); migrationBuilder.CreateIndex( name: "IX_SmsSettingAccess_ChannelId", table: "SmsSettingAccess", column: "ChannelId"); migrationBuilder.AddForeignKey( name: "FK_SmsSettingAccess_Channel_ChannelId", table: "SmsSettingAccess", column: "ChannelId", principalTable: "Channel", principalColumn: "Id"); } } } ApiTools.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs
@@ -470,9 +470,6 @@ b.Property<int>("Access") .HasColumnType("int"); b.Property<Guid?>("ChannelId") .HasColumnType("uniqueidentifier"); b.Property<Guid?>("CreatedChannelId") .HasColumnType("uniqueidentifier"); @@ -491,6 +488,9 @@ b.Property<Guid>("SettingId") .HasColumnType("uniqueidentifier"); b.Property<string>("SignName") .HasColumnType("nvarchar(max)"); b.Property<int>("Sort") .HasColumnType("int"); @@ -504,8 +504,6 @@ .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("ChannelId"); b.HasIndex("SettingId"); @@ -622,17 +620,11 @@ modelBuilder.Entity("ApiTools.Core.SmsSettingAccess", b => { b.HasOne("ApiTools.Core.Channel", "Channel") .WithMany() .HasForeignKey("ChannelId"); b.HasOne("ApiTools.Core.SmsSetting", "Setting") .WithMany("Accesses") .HasForeignKey("SettingId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Channel"); b.Navigation("Setting"); }); ApiTools.Database.Migrations/REDEME.MD
@@ -1,7 +1,7 @@ -------------------------------主数据库--------------------------------------- 新增迁移文件 dotnet ef migrations add UpdateSmsLog -s "../ApiTools.Web.Entry" -c DefaultDbContext dotnet ef migrations add UpdateSmsSetting1009 -s "../ApiTools.Web.Entry" -c DefaultDbContext 删除迁移文件 dotnet ef migrations remove -s "../ApiTools.Web.Entry" -c DefaultDbContext ApiTools.Web.Entry/appsettings.json
@@ -6,8 +6,8 @@ "ApiTools": "Server=120.26.58.240; Database=Dev_ApiTools; User=bole;Password=Bole1472589;Encrypt=false;", "ApiToolsLog": "Server=120.26.58.240; Database=Dev_ApiToolsLog; User=bole;Password=Bole1472589;Encrypt=false;" //"FlexJobApi": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333; Database=Pro_FlexJobApi; User=bole;Password=Blcs20@%27;Encrypt=false;", //"FlexJobApiLog": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333; Database=Pro_FlexJobApiLog; User=bole;Password=Blcs20@%27;Encrypt=false;", //"ApiTools": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333; Database=Pro_ApiTools; User=bole;Password=Blcs20@%27;Encrypt=false;", //"ApiToolsLog": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333; Database=Pro_ApiToolsLog; User=bole;Password=Blcs20@%27;Encrypt=false;", }, "Consul": { @@ -81,7 +81,6 @@ "MrChCode": "0040107980000NBCS000" }, "ChengLiYeSms": { "SignName": "818人力无忧1", "UserName": "nbcsxx", "Password": "8af9s7", "TemplateCodes": { @@ -94,7 +93,31 @@ //电子签邀约 "InviteElectronSign": "${name}请您点击签约http://testwww.81812333.com/sg/${code}", //签约地址 "ElectronSignUrl": "${name}请您点击签约https://testwww.81812333.com/sgu/${code}" "ElectronSignUrl": "${name}请您点击签约https://testwww.81812333.com/sgu/${code}", //818平台短信验证码 "VerifyCode": "验证码:${code},请于5分钟内填写,请勿泄露,若非本人操作请忽略。", //818账号开通(管理端) "CreateOperationAccount": "尊敬的用户您好,人力无忧账号已开通,账号:${account},密码:${pwd},请登录网址 https://admin.81812333.com", //818手机号换绑 "UpdateUserPhoneNumberNotice": "尊敬的用户您好,818平台${code}的账户绑定手机号成功修改为${account},你可以使用该手机号登录,登录网址 https://www.81812333.com", //818重置密码 "ResetUserPhoneNumber": "验证码${code},您正在进行重置密码操作,请勿泄露,若非本人操作请忽略。", //818平台密码重置(通知) "ResetPasswordNotice": "您好,您的密码已重置,账号:${account},密码:${password},请妥善保存", //账号修改 "ChangeUserName": "尊敬的用户您好: 您的818平台账号成功修改为${account}您可以使用该账号进行登录,登录网址:https://www.81812333.com", //818账号开通 "CreateAccountNotice": "尊敬的用户您好,您的账号:${account},初始密码:${password},请妥善保存,您可使用账号密码登录并修改密码,登录网址 https://www.81812333.com", //手机号解绑 "UnbindingUserPhoneNumber": "尊敬的用户您好:818平台${account}的账号与${number}已解绑,你可以登录网址:https://www.81812333.com重新绑定手机号。", //解绑邮箱 "UnbindingUserEmail": "尊敬的用户您好:818平台${account}的账号与${mail}已解绑,你可以登录网址:https://www.81812333.com重新绑定邮箱。", //818实名认证 "UserCertificationAudit": "验证码${code},您正在进行实名认证操作,请勿泄露,若非本人操作请忽略。", //申请数字证书 "ApplyUserCertificate": "验证码${code},用户您好,您正在申请数字证书,验证码10分钟内有效。", //电子签 "UserElectronSign": "${unit_name}请您点击签约t.81812333.com/Inter/${code}" } }, "Aliyun": { @@ -128,19 +151,48 @@ "AccessKeyId": "LTAI5tLzz2jnXrUAAiC2kduH", "AccessSecret": "do1XqrgHJ5gOuFHhO5eku0FyYzZvbQ", "Version": "2017-05-25", "SignName": "818数字人力资产平台", "RegionId": "cn-hangzhou", "TemplateCodes": { //818平台登录/注册 验证码${code},用户您好,您正在进行平台登录/注册,验证码10分钟内有效。 "LoginOrRegister": "SMS_472170005", //818手机号码修改 验证码${code},您正在进行修改手机号码操作,请勿泄露,若非本人操作请忽略。 "UpdateUserPhoneNumber": "SMS_471100097", //818钱包开通 验证码${code},用户您好,您正在进行平台钱包开通,该验证码5分钟内有效,请勿泄露于他人。 "BankWalletAccountOpen": "SMS_473860301", //电子签邀约 ${name}请您点击签约http://testwww.81812333.com/sg/${code} "InviteElectronSign": "SMS_493755029", //签约地址 ${name}请您点击签约https://testwww.81812333.com/sgu/${code} "ElectronSignUrl": "SMS_493715033" "ElectronSignUrl": "SMS_493715033", //818平台短信验证码 验证码:${code},请于5分钟内填写,请勿泄露,若非本人操作请忽略。 "VerifyCode": "SMS_471100021", //818平台登录/注册 验证码${code},用户您好,您正在进行平台登录/注册,验证码10分钟内有效。 "LoginOrRegister": "SMS_472170005", //818账号开通(管理端)尊敬的用户您好,人力无忧账号已开通,账号:${account},密码:${pwd},请登录网址 https://admin.81812333.com "CreateOperationAccount": "SMS_471970028", //818手机号码修改 验证码${code},您正在进行修改手机号码操作,请勿泄露,若非本人操作请忽略。 "UpdateUserPhoneNumber": "SMS_471100097", //818手机号换绑 尊敬的用户您好,818平台${code}的账户绑定手机号成功修改为${account},你可以使用该手机号登录,登录网址 https://www.81812333.com "UpdateUserPhoneNumberNotice": "SMS_471925037", //818重置密码 验证码${code},您正在进行重置密码操作,请勿泄露,若非本人操作请忽略。 "ResetUserPhoneNumber": "SMS_471240080", //818平台密码重置(通知) 您好,您的密码已重置,账号:${account},密码:${password},请妥善保存 "ResetPasswordNotice": "SMS_476790229", //账号修改 尊敬的用户您好: 您的818平台账号成功修改为${account}您可以使用该账号进行登录,登录网址:https://www.81812333.com "ChangeUserName": "SMS_475895109", //818账号开通 尊敬的用户您好,您的账号:${account},初始密码:${password},请妥善保存,您可使用账号密码登录并修改密码,登录网址 https://www.81812333.com "CreateAccountNotice": "SMS_471980029", //手机号解绑 尊敬的用户您好:818平台${account}的账号与${number}已解绑,你可以登录网址:https://www.81812333.com重新绑定手机号。 "UnbindingUserPhoneNumber": "SMS_475840188", //解绑邮箱 尊敬的用户您好:818平台${account}的账号与${mail}已解绑,你可以登录网址:https://www.81812333.com重新绑定邮箱。 "UnbindingUserEmail": "SMS_475875117", //818实名认证 验证码${code},您正在进行实名认证操作,请勿泄露,若非本人操作请忽略。 "UserCertificationAudit": "SMS_471230080", //申请数字证书 验证码${code},用户您好,您正在申请数字证书,验证码10分钟内有效。 "ApplyUserCertificate": "SMS_475345383", //电子签 ${unit_name}请您点击签约t.81812333.com/Inter/${code} "UserElectronSign": "SMS_476485061", //818钱包开通 验证码${code},用户您好,您正在进行平台钱包开通,该验证码5分钟内有效,请勿泄露于他人。 "BankWalletAccountOpen": "SMS_473860301" } } },