Skip to content

Commit

Permalink
Merge pull request #14 from jxnkwlp/feature/dictionary-management2
Browse files Browse the repository at this point in the history
feat: refactor dictionary management
  • Loading branch information
jxnkwlp authored Jul 7, 2024
2 parents 7da5f06 + 63952eb commit 5de216e
Show file tree
Hide file tree
Showing 84 changed files with 729 additions and 9,223 deletions.
38 changes: 38 additions & 0 deletions Sample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.Identity.En
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.Identity.MongoDB", "modules\identity\src\Passingwind.Abp.Identity.MongoDB\Passingwind.Abp.Identity.MongoDB.csproj", "{142ACC29-6460-4E1C-9979-EB9BCA61114C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A117DB50-D9B9-4590-BB62-15D87ABA19A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.TestBase", "modules\dictionary-management\test\Passingwind.Abp.DictionaryManagement.TestBase\Passingwind.Abp.DictionaryManagement.TestBase.csproj", "{6A0995B6-E2DD-4AD8-9E47-BED77B296030}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.Domain.Tests", "modules\dictionary-management\test\Passingwind.Abp.DictionaryManagement.Domain.Tests\Passingwind.Abp.DictionaryManagement.Domain.Tests.csproj", "{39732764-8050-4871-8470-992239A685DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.Application.Tests", "modules\dictionary-management\test\Passingwind.Abp.DictionaryManagement.Application.Tests\Passingwind.Abp.DictionaryManagement.Application.Tests.csproj", "{B401EA9D-2336-44AC-8D3E-FD7D2DAE7C97}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.EntityFrameworkCore.Tests", "modules\dictionary-management\test\Passingwind.Abp.DictionaryManagement.EntityFrameworkCore.Tests\Passingwind.Abp.DictionaryManagement.EntityFrameworkCore.Tests.csproj", "{DF459EDD-8E5D-4CE5-B879-8E7260E15E7F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.MongoDB.Tests", "modules\dictionary-management\test\Passingwind.Abp.DictionaryManagement.MongoDB.Tests\Passingwind.Abp.DictionaryManagement.MongoDB.Tests.csproj", "{F60E2974-A7C7-41EF-96E8-23E38619E98F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -451,6 +463,26 @@ Global
{142ACC29-6460-4E1C-9979-EB9BCA61114C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142ACC29-6460-4E1C-9979-EB9BCA61114C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142ACC29-6460-4E1C-9979-EB9BCA61114C}.Release|Any CPU.Build.0 = Release|Any CPU
{6A0995B6-E2DD-4AD8-9E47-BED77B296030}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6A0995B6-E2DD-4AD8-9E47-BED77B296030}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A0995B6-E2DD-4AD8-9E47-BED77B296030}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A0995B6-E2DD-4AD8-9E47-BED77B296030}.Release|Any CPU.Build.0 = Release|Any CPU
{39732764-8050-4871-8470-992239A685DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39732764-8050-4871-8470-992239A685DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39732764-8050-4871-8470-992239A685DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39732764-8050-4871-8470-992239A685DC}.Release|Any CPU.Build.0 = Release|Any CPU
{B401EA9D-2336-44AC-8D3E-FD7D2DAE7C97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B401EA9D-2336-44AC-8D3E-FD7D2DAE7C97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B401EA9D-2336-44AC-8D3E-FD7D2DAE7C97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B401EA9D-2336-44AC-8D3E-FD7D2DAE7C97}.Release|Any CPU.Build.0 = Release|Any CPU
{DF459EDD-8E5D-4CE5-B879-8E7260E15E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF459EDD-8E5D-4CE5-B879-8E7260E15E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF459EDD-8E5D-4CE5-B879-8E7260E15E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF459EDD-8E5D-4CE5-B879-8E7260E15E7F}.Release|Any CPU.Build.0 = Release|Any CPU
{F60E2974-A7C7-41EF-96E8-23E38619E98F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F60E2974-A7C7-41EF-96E8-23E38619E98F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F60E2974-A7C7-41EF-96E8-23E38619E98F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F60E2974-A7C7-41EF-96E8-23E38619E98F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -538,6 +570,12 @@ Global
{05512A8D-B154-468D-87A2-70AF6709FE27} = {0FBA4154-8477-4C8E-BFF0-D5D9017F1064}
{DA2351B1-696F-4EA1-9AA6-5904158D1BB0} = {1D9AB036-09A0-4645-B692-4CFC6B63A5C9}
{142ACC29-6460-4E1C-9979-EB9BCA61114C} = {1D9AB036-09A0-4645-B692-4CFC6B63A5C9}
{A117DB50-D9B9-4590-BB62-15D87ABA19A8} = {A372DE5B-C4BB-4842-8A2C-28F0A37551B1}
{6A0995B6-E2DD-4AD8-9E47-BED77B296030} = {A117DB50-D9B9-4590-BB62-15D87ABA19A8}
{39732764-8050-4871-8470-992239A685DC} = {A117DB50-D9B9-4590-BB62-15D87ABA19A8}
{B401EA9D-2336-44AC-8D3E-FD7D2DAE7C97} = {A117DB50-D9B9-4590-BB62-15D87ABA19A8}
{DF459EDD-8E5D-4CE5-B879-8E7260E15E7F} = {A117DB50-D9B9-4590-BB62-15D87ABA19A8}
{F60E2974-A7C7-41EF-96E8-23E38619E98F} = {A117DB50-D9B9-4590-BB62-15D87ABA19A8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.EntityFrameworkCore", "src\Passingwind.Abp.DictionaryManagement.EntityFrameworkCore\Passingwind.Abp.DictionaryManagement.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.MongoDB", "src\Passingwind.Abp.DictionaryManagement.MongoDB\Passingwind.Abp.DictionaryManagement.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}"
Expand All @@ -35,14 +33,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryM
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.Application.Tests", "test\Passingwind.Abp.DictionaryManagement.Application.Tests\Passingwind.Abp.DictionaryManagement.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.HttpApi.Host", "host\Passingwind.Abp.DictionaryManagement.HttpApi.Host\Passingwind.Abp.DictionaryManagement.HttpApi.Host.csproj", "{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.HttpApi.Client.ConsoleTestApp", "test\Passingwind.Abp.DictionaryManagement.HttpApi.Client.ConsoleTestApp\Passingwind.Abp.DictionaryManagement.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.AuthServer", "host\Passingwind.Abp.DictionaryManagement.AuthServer\Passingwind.Abp.DictionaryManagement.AuthServer.csproj", "{690203F4-3CD5-4569-88D9-EE831EEA5F5F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.Host.Shared", "host\Passingwind.Abp.DictionaryManagement.Host.Shared\Passingwind.Abp.DictionaryManagement.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Passingwind.Abp.DictionaryManagement.Installer", "src\Passingwind.Abp.DictionaryManagement.Installer\Passingwind.Abp.DictionaryManagement.Installer.csproj", "{BE39FD00-745B-4049-8161-FC129817CBE4}"
EndProject
Global
Expand Down Expand Up @@ -103,22 +93,6 @@ Global
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.Build.0 = Release|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU
{690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Release|Any CPU.Build.0 = Release|Any CPU
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU
{BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE39FD00-745B-4049-8161-FC129817CBE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -141,10 +115,6 @@ Global
{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2} = {E400416D-2895-4512-9D17-90681EEC7E0A}
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{690203F4-3CD5-4569-88D9-EE831EEA5F5F} = {E400416D-2895-4512-9D17-90681EEC7E0A}
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A}
{BE39FD00-745B-4049-8161-FC129817CBE4} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
77 changes: 77 additions & 0 deletions modules/dictionary-management/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,78 @@
# Dictionary management

Provides dictionary items and groups data

## How to use

### Domain

Start from `IDictionaryManager`

```cs
/// <summary>
/// Get items
/// </summary>
Task<IReadOnlyList<DictionaryItemDescriptor>> GetItemsAsync(string groupName, bool onlyEnabled = true, CancellationToken cancellationToken = default);
/// <summary>
/// Get groups
/// </summary>
Task<IReadOnlyList<DictionaryGroupDescriptor>> GetGroupsAsync(string? parentName = null, bool onlyPublic = true, CancellationToken cancellationToken = default);

/// <summary>
/// Get item value by name
/// </summary>
Task<string?> GetItemValueAsync(string itemName, string? defaultValue = null, CancellationToken cancellationToken = default);
/// <summary>
/// set an item value by name
/// </summary>
Task SetItemValueAsync(string name, string value, CancellationToken cancellationToken = default);

/// <summary>
/// Set item is enabled
/// </summary>
Task SetItemEnabledAsync(string name, bool isEnabled, CancellationToken cancellationToken = default);
/// <summary>
/// Set group is public
/// </summary>
Task SetGroupPublicAsync(string name, bool isPublic, CancellationToken cancellationToken = default);

/// <summary>
/// Get item descriptor by name
/// </summary>
Task<DictionaryItemDescriptor> GetItemAsync(string name, CancellationToken cancellationToken = default);
/// <summary>
/// Get group descriptor by name
/// </summary>
Task<DictionaryGroupDescriptor> GetGroupAsync(string name, CancellationToken cancellationToken = default);

/// <summary>
/// Check group is exists by name
/// </summary>
Task<bool> IsGroupExistsAsync(string name, CancellationToken cancellationToken = default);
/// <summary>
/// Check item is exists by name
/// </summary>
Task<bool> IsItemExistsAsync(string name, CancellationToken cancellationToken = default);

/// <summary>
/// Create item
/// </summary>
Task<DictionaryItem> CreateItemAsync(string name, string displayName, string? value = null, string? description = null, string? groupName = null, int displayOrder = 100, bool isEnabled = true, CancellationToken cancellationToken = default);
/// <summary>
/// Create group
/// </summary>
Task<DictionaryGroup> CreateGroupAsync(string name, string displayName, string? parentName = null, string? description = null, bool isPublic = false, CancellationToken cancellationToken = default);

/// <summary>
/// Delete item by name
/// </summary>
Task DeleteItemAsync(string name, CancellationToken cancellationToken = default);
/// <summary>
/// Delete group by name
/// </summary>
Task DeleteGroupAsync(string name, bool removeAllItems = true, CancellationToken cancellationToken = default);
```

### App Service

Start from `IDictionaryAppService`
Loading

0 comments on commit 5de216e

Please sign in to comment.