结构调整
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 MimeKit;
namespace Service;
namespace Service.EmailServices;
/// <summary>
/// 邮件抓取服务接口

View File

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

View File

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

View File

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

View File

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

View File

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