-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactor dcc configuration (#215)
* refactor: refactor dcc configuration * refactor: refactor dcc configuration * chore: adjust dcc test * refactor: refactor dcc configuration * test: adjust dcc configuration test * fix: fix configuration test error * fix: adjust InitializeAppConfiguration function * refactor(ConfigurationApi.Dcc): Refactor Dcc * refactor: Optimize ConfigurationApi.Dcc And Perfect unit tests * refactor(Configuration): Simplified code * chore: Deal with code smells * chore: deal with code smells Co-authored-by: yanpengju <[email protected]> Co-authored-by: 阎鹏举 <阎鹏举@DESKTOP-28NV352> Co-authored-by: zhenlei520 <[email protected]>
- Loading branch information
1 parent
4714160
commit ee11ccd
Showing
26 changed files
with
931 additions
and
842 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...onfiguration.ConfigurationApi.Dcc/Internal/Extensions/DistributedCacheClientExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) MASA Stack All rights reserved. | ||
// Licensed under the MIT License. See LICENSE.txt in the project root for license information. | ||
|
||
namespace Masa.Utils.Caching.Core.Interfaces; | ||
|
||
internal static class DistributedCacheClientExtensions | ||
{ | ||
public static List<string> GetAllConfigObjects( | ||
this IDistributedCacheClient distributedCacheClient, | ||
string appId, | ||
string environment, | ||
string cluster) | ||
{ | ||
var defaultConfigObjects = new List<string>(); | ||
|
||
string partialKey = | ||
$"{environment}-{cluster}-{appId}".ToLower(); | ||
List<string> keys = distributedCacheClient.GetKeys($"{partialKey}*"); | ||
foreach (var key in keys) | ||
{ | ||
var configObject = key.Split($"{partialKey}-", StringSplitOptions.RemoveEmptyEntries).LastOrDefault(); | ||
if (configObject == null) continue; | ||
|
||
defaultConfigObjects.Add(configObject); | ||
} | ||
|
||
return defaultConfigObjects; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
...urationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.