fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 4m27s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 4m27s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
32
Application/Dto/HolidayDto.cs
Normal file
32
Application/Dto/HolidayDto.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace Application.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 节假日数据传输对象
|
||||
/// </summary>
|
||||
public class HolidayDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 日期(yyyy-MM-dd格式)
|
||||
/// </summary>
|
||||
public string Date { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 节假日名称(如:春节、国庆节)
|
||||
/// </summary>
|
||||
public string HolidayName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 日期类型:1=节假日放假,3=调休工作日
|
||||
/// </summary>
|
||||
public int DayType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否休息:1=休息,0=工作
|
||||
/// </summary>
|
||||
public int Rest { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 星期描述(中文)
|
||||
/// </summary>
|
||||
public string WeekDescCn { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -41,8 +41,7 @@ public class EmailMessageApplication(
|
||||
IEmailMessageRepository emailRepository,
|
||||
ITransactionRecordRepository transactionRepository,
|
||||
IEmailHandleService emailHandleService,
|
||||
IEmailSyncService emailSyncService,
|
||||
ILogger<EmailMessageApplication> logger
|
||||
IEmailSyncService emailSyncService
|
||||
) : IEmailMessageApplication
|
||||
{
|
||||
public async Task<EmailPagedResult> GetListAsync(EmailQueryRequest request)
|
||||
|
||||
@@ -29,6 +29,11 @@ public static class ServiceCollectionExtensions
|
||||
{
|
||||
services.AddScoped(interfaceType, implementationType);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有接口,直接注册实现类
|
||||
services.AddScoped(implementationType);
|
||||
}
|
||||
}
|
||||
|
||||
return services;
|
||||
|
||||
35
Application/HolidayApplication.cs
Normal file
35
Application/HolidayApplication.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace Application;
|
||||
|
||||
/// <summary>
|
||||
/// 节假日应用服务
|
||||
/// </summary>
|
||||
public class HolidayApplication(IHolidayService holidayService)
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取指定年月的节假日数据
|
||||
/// </summary>
|
||||
public async Task<List<HolidayDto>> GetMonthHolidaysAsync(int year, int month)
|
||||
{
|
||||
var startDate = new DateTime(year, month, 1).ToString("yyyy-MM-dd");
|
||||
var endDate = new DateTime(year, month, DateTime.DaysInMonth(year, month)).ToString("yyyy-MM-dd");
|
||||
|
||||
var holidays = await holidayService.GetHolidaysByDateRangeAsync(startDate, endDate);
|
||||
|
||||
return holidays.Select(h => new HolidayDto
|
||||
{
|
||||
Date = h.Date,
|
||||
HolidayName = h.HolidayName,
|
||||
DayType = h.DayType,
|
||||
Rest = h.Rest,
|
||||
WeekDescCn = h.WeekDescCn
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手动触发同步节假日数据
|
||||
/// </summary>
|
||||
public async Task<bool> SyncHolidaysAsync(int year)
|
||||
{
|
||||
return await holidayService.FetchAndCacheHolidaysAsync(year);
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,7 @@ public interface IJobApplication
|
||||
/// 任务应用服务实现
|
||||
/// </summary>
|
||||
public class JobApplication(
|
||||
ISchedulerFactory schedulerFactory,
|
||||
ILogger<JobApplication> logger
|
||||
ISchedulerFactory schedulerFactory
|
||||
) : IJobApplication
|
||||
{
|
||||
public async Task<List<JobStatus>> GetJobsAsync()
|
||||
|
||||
@@ -43,8 +43,7 @@ public interface IMessageRecordApplication
|
||||
/// 消息记录应用服务实现
|
||||
/// </summary>
|
||||
public class MessageRecordApplication(
|
||||
IMessageService messageService,
|
||||
ILogger<MessageRecordApplication> logger
|
||||
IMessageService messageService
|
||||
) : IMessageRecordApplication
|
||||
{
|
||||
public async Task<MessagePagedResult> GetListAsync(int pageIndex = 1, int pageSize = 20)
|
||||
|
||||
@@ -16,8 +16,7 @@ public interface INotificationApplication
|
||||
/// 通知应用服务实现
|
||||
/// </summary>
|
||||
public class NotificationApplication(
|
||||
INotificationService notificationService,
|
||||
ILogger<NotificationApplication> logger
|
||||
INotificationService notificationService
|
||||
) : INotificationApplication
|
||||
{
|
||||
public async Task<string> GetVapidPublicKeyAsync()
|
||||
|
||||
@@ -99,8 +99,7 @@ public interface ITransactionApplication
|
||||
/// </summary>
|
||||
public class TransactionApplication(
|
||||
ITransactionRecordRepository transactionRepository,
|
||||
ISmartHandleService smartHandleService,
|
||||
ILogger<TransactionApplication> logger
|
||||
ISmartHandleService smartHandleService
|
||||
) : ITransactionApplication
|
||||
{
|
||||
public async Task<PagedResult<TransactionResponse>> GetListAsync(TransactionQueryRequest request)
|
||||
|
||||
@@ -26,8 +26,7 @@ public class TransactionCategoryApplication(
|
||||
ITransactionCategoryRepository categoryRepository,
|
||||
ITransactionRecordRepository transactionRepository,
|
||||
IBudgetRepository budgetRepository,
|
||||
ISmartHandleService smartHandleService,
|
||||
ILogger<TransactionCategoryApplication> logger
|
||||
ISmartHandleService smartHandleService
|
||||
) : ITransactionCategoryApplication
|
||||
{
|
||||
public async Task<List<CategoryResponse>> GetListAsync(TransactionType? type = null)
|
||||
|
||||
@@ -44,8 +44,7 @@ public interface ITransactionPeriodicApplication
|
||||
/// </summary>
|
||||
public class TransactionPeriodicApplication(
|
||||
ITransactionPeriodicRepository periodicRepository,
|
||||
ITransactionPeriodicService periodicService,
|
||||
ILogger<TransactionPeriodicApplication> logger
|
||||
ITransactionPeriodicService periodicService
|
||||
) : ITransactionPeriodicApplication
|
||||
{
|
||||
public async Task<PeriodicPagedResult> GetListAsync(int pageIndex = 1, int pageSize = 20, string? searchKeyword = null)
|
||||
|
||||
@@ -61,8 +61,7 @@ public interface ITransactionStatisticsApplication
|
||||
/// </summary>
|
||||
public class TransactionStatisticsApplication(
|
||||
ITransactionStatisticsService statisticsService,
|
||||
IConfigService configService,
|
||||
ILogger<TransactionStatisticsApplication> logger
|
||||
IConfigService configService
|
||||
) : ITransactionStatisticsApplication
|
||||
{
|
||||
// === 新统一接口实现 ===
|
||||
|
||||
Reference in New Issue
Block a user