From e47a48998bf06558fc82816423e1217497a6172d Mon Sep 17 00:00:00 2001 From: wzh425 Date: Sat, 14 Dec 2024 14:53:21 +0800 Subject: [PATCH] refactor: Remove GetPublicConfigAsync (#646) --- .../App/Queries/PublicConfigQuery.cs | 9 --------- Masa.Dcc.Infrastructure.Domain/App/QueryHandler.cs | 10 ---------- .../Masa.Dcc.Service/Services/OpenApiService.cs | 8 -------- 3 files changed, 27 deletions(-) delete mode 100644 Masa.Dcc.Infrastructure.Domain/App/Queries/PublicConfigQuery.cs diff --git a/Masa.Dcc.Infrastructure.Domain/App/Queries/PublicConfigQuery.cs b/Masa.Dcc.Infrastructure.Domain/App/Queries/PublicConfigQuery.cs deleted file mode 100644 index 6a832aa..0000000 --- a/Masa.Dcc.Infrastructure.Domain/App/Queries/PublicConfigQuery.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Masa.Dcc.Infrastructure.Domain.Queries; - -public record class PublicConfigQuery(string Environment, string Cluster, string ConfigObject) : Query> -{ - public override Dictionary Result { get; set; } -} diff --git a/Masa.Dcc.Infrastructure.Domain/App/QueryHandler.cs b/Masa.Dcc.Infrastructure.Domain/App/QueryHandler.cs index 5759e9f..be7cb47 100644 --- a/Masa.Dcc.Infrastructure.Domain/App/QueryHandler.cs +++ b/Masa.Dcc.Infrastructure.Domain/App/QueryHandler.cs @@ -277,14 +277,4 @@ public async Task GetConfigObjectsAsync(ConfigObjectsByDynamicQuery query) { query.Result = await _configObjectDomainService.GetConfigObjectsAsync(query.environment, query.cluster, query.appId, query.configObjects); } - - [EventHandler] - public async Task GetPublicConfigAsync(PublicConfigQuery query) - { - query.Result = await _configurationApiClient.GetAsync>( - query.Environment, - query.Cluster, - "public-$Config", - query.ConfigObject); - } } diff --git a/src/Services/Masa.Dcc.Service/Services/OpenApiService.cs b/src/Services/Masa.Dcc.Service/Services/OpenApiService.cs index 87c17be..7d0bc44 100644 --- a/src/Services/Masa.Dcc.Service/Services/OpenApiService.cs +++ b/src/Services/Masa.Dcc.Service/Services/OpenApiService.cs @@ -11,7 +11,6 @@ public OpenApiService() App.MapPut("open-api/releasing/{environment}/{cluster}/{appId}/{configObject}", UpdateConfigObjectAsync); App.MapPost("open-api/releasing/{environment}/{cluster}/{appId}/{isEncryption}", AddConfigObjectAsync); App.MapPost("open-api/releasing/get/{environment}/{cluster}/{appId}", GetConfigObjectsAsync); - App.MapGet("open-api/releasing/{environment}/{cluster}/publicConfig/{configObject}", GetPublicConfigAsync); } public async Task UpdateConfigObjectAsync(IEventBus eventBus, string environment, string cluster, string appId, string configObject, @@ -36,12 +35,5 @@ public async Task> GetConfigObjectsAsync await eventBus.PublishAsync(query); return query.Result; } - - public async Task> GetPublicConfigAsync(IEventBus eventBus, string environment, string cluster, string configObject) - { - var query = new PublicConfigQuery(environment, cluster, configObject); - await eventBus.PublishAsync(query); - return query.Result; - } } }