结构调整
This commit is contained in:
@@ -4,7 +4,7 @@ using MailKit.Search;
|
||||
using MailKit.Security;
|
||||
using MimeKit;
|
||||
|
||||
namespace Service;
|
||||
namespace Service.EmailServices;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件抓取服务接口
|
||||
@@ -1,6 +1,6 @@
|
||||
using Service.EmailParseServices;
|
||||
|
||||
namespace Service;
|
||||
namespace Service.EmailServices;
|
||||
|
||||
public interface IEmailHandleService
|
||||
{
|
||||
@@ -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;
|
||||
@@ -496,4 +496,3 @@ public class ImportService(
|
||||
"yyyyMMddHHmmss",
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using MimeKit;
|
||||
using Quartz;
|
||||
using Service.EmailServices;
|
||||
|
||||
namespace Service.Jobs;
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user