feat:支持es索引初始化
This commit is contained in:
parent
5e526a81e9
commit
eecdf05d26
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user