feat:支持es索引初始化

This commit is contained in:
xiaolipro 2025-09-01 15:10:42 +08:00
parent 5e526a81e9
commit eecdf05d26

View File

@ -0,0 +1,20 @@
using TrackCenter.Domain.Aggregates.TrackDetailsAggregate;
using TrackCenter.Domain.Aggregates.WarningAggregate;
namespace TrackCenter.Application.Services.DebugApis;
[ApiExplorerSettings(GroupName = "调试专用")]
public class _EsInitService(
ITrackDetailsEsRepository trackDetailsEsRepository,
IWarningDetailsEsRepository warningDetailsEsRepository)
: ApplicationService
{
[HttpGet("EsInit")]
public async Task EsInit()
{
LogHelper.Warn($"ES索引初始化开始 OperationUserId:[{CurrentUser.Id}]", true);
await trackDetailsEsRepository.MigrateAsync();
await warningDetailsEsRepository.CreateAliasAsync();
LogHelper.Warn($"ES索引初始化完成 OperationUserId:[{CurrentUser.Id}]", true);
}
}