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