结构调整
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 14s
Docker Build & Deploy / Deploy to Production (push) Has been skipped

This commit is contained in:
2026-01-01 12:32:08 +08:00
parent c1aa4df4f3
commit 8dfe7f1688
15 changed files with 152 additions and 150 deletions

View File

@@ -4,7 +4,7 @@ using MailKit.Search;
using MailKit.Security; using MailKit.Security;
using MimeKit; using MimeKit;
namespace Service; namespace Service.EmailServices;
/// <summary> /// <summary>
/// 邮件抓取服务接口 /// 邮件抓取服务接口

View File

@@ -1,6 +1,6 @@
using Service.EmailParseServices; using Service.EmailParseServices;
namespace Service; namespace Service.EmailServices;
public interface IEmailHandleService public interface IEmailHandleService
{ {

View File

@@ -1,9 +1,9 @@
using System.ComponentModel; using System.ComponentModel;
using MimeKit; using MimeKit;
namespace Service; namespace Service.EmailServices;
public interface IEmailBackgroundService public interface IEmailSyncService
{ {
/// <summary> /// <summary>
/// 手动触发邮件同步 /// 手动触发邮件同步
@@ -11,12 +11,12 @@ public interface IEmailBackgroundService
Task SyncEmailsAsync(); Task SyncEmailsAsync();
} }
public class EmailBackgroundService( public class EmailSyncService(
IOptions<EmailSettings> emailSettings, IOptions<EmailSettings> emailSettings,
IServiceProvider serviceProvider, IServiceProvider serviceProvider,
IEmailHandleService emailHandleService, IEmailHandleService emailHandleService,
ILogger<EmailBackgroundService> logger) ILogger<EmailSyncService> logger)
: BackgroundWorker, IEmailBackgroundService : BackgroundWorker, IEmailSyncService
{ {
private readonly Dictionary<string, IEmailFetchService> _emailFetchServices = new(); private readonly Dictionary<string, IEmailFetchService> _emailFetchServices = new();
private bool _isInitialized; private bool _isInitialized;

View File

@@ -496,4 +496,3 @@ public class ImportService(
"yyyyMMddHHmmss", "yyyyMMddHHmmss",
]; ];
} }

View File

@@ -1,5 +1,6 @@
using MimeKit; using MimeKit;
using Quartz; using Quartz;
using Service.EmailServices;
namespace Service.Jobs; namespace Service.Jobs;

View File

@@ -1,4 +1,6 @@
namespace WebApi.Controllers.EmailMessage; using Service.EmailServices;
namespace WebApi.Controllers.EmailMessage;
[ApiController] [ApiController]
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
@@ -7,7 +9,7 @@ public class EmailMessageController(
ITransactionRecordRepository transactionRepository, ITransactionRecordRepository transactionRepository,
ILogger<EmailMessageController> logger, ILogger<EmailMessageController> logger,
IEmailHandleService emailHandleService, IEmailHandleService emailHandleService,
IEmailBackgroundService emailBackgroundService IEmailSyncService emailBackgroundService
) : ControllerBase ) : ControllerBase
{ {
/// <summary> /// <summary>