using Atomx.Data; using Atomx.Data.CacheServices; using Hangfire; using Microsoft.Extensions.Logging; namespace Atomx.Core.Jos { public class SendVerificationCodeJob { readonly ILogger _logger; readonly DataContext _dbContext; readonly ICacheService _cacheService; public SendVerificationCodeJob(ILogger logger, DataContext dataContext, ICacheService cacheService) { _logger = logger; _dbContext = dataContext; _cacheService = cacheService; } /// /// 发送短信验证码任务 /// /// /// [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); // 在这里添加发送验证码的具体任务逻辑 } } }