This commit is contained in:
2025-12-15 13:04:44 +08:00
parent 9edff983d8
commit 9b8bf43eb6
2 changed files with 15 additions and 7 deletions

View File

@@ -15,7 +15,6 @@ using Blazored.LocalStorage;
using FluentValidation; using FluentValidation;
using Hangfire; using Hangfire;
using Hangfire.PostgreSql; using Hangfire.PostgreSql;
using Hangfire.PostgreSql.Factories;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Authorization;
@@ -23,9 +22,7 @@ using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.ResponseCompression; using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using Npgsql;
using Scalar.AspNetCore; using Scalar.AspNetCore;
using Serilog; using Serilog;
using System.Globalization; using System.Globalization;

View File

@@ -1,9 +1,7 @@
using Atomx.Data; using Atomx.Data;
using Atomx.Data.CacheServices; using Atomx.Data.CacheServices;
using Hangfire;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
namespace Atomx.Core.Jos namespace Atomx.Core.Jos
{ {
@@ -19,7 +17,20 @@ namespace Atomx.Core.Jos
_cacheService = cacheService; _cacheService = cacheService;
} }
public void Execute(string email, string code) /// <summary>
/// 发送短信验证码任务
/// </summary>
/// <param name="phone"></param>
/// <param name="code"></param>
[AutomaticRetry(Attempts = 3, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
[DisableConcurrentExecution(60)]
public void SendSMSCode(string phone, string code)
{
_logger.LogInformation("SendVerificationCodeJob executed at: {time}", DateTimeOffset.Now);
// 在这里添加发送验证码的具体任务逻辑
}
public void SendEmailCode(string email, string code)
{ {
_logger.LogInformation("SendVerificationCodeJob executed at: {time}", DateTimeOffset.Now); _logger.LogInformation("SendVerificationCodeJob executed at: {time}", DateTimeOffset.Now);
// 在这里添加发送验证码的具体任务逻辑 // 在这里添加发送验证码的具体任务逻辑