From eecdf05d26a9e33bd2a3d8014161d61ca766aebc Mon Sep 17 00:00:00 2001 From: xiaolipro <2357729423@qq.com> Date: Mon, 1 Sep 2025 15:10:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=94=AF=E6=8C=81es=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/DebugApis/_EsInitService.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/TrackCenter.Application/Services/DebugApis/_EsInitService.cs diff --git a/src/TrackCenter.Application/Services/DebugApis/_EsInitService.cs b/src/TrackCenter.Application/Services/DebugApis/_EsInitService.cs new file mode 100644 index 00000000..11906335 --- /dev/null +++ b/src/TrackCenter.Application/Services/DebugApis/_EsInitService.cs @@ -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); + } +}