-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from jxnkwlp/feature/dictionary-management2
feat: refactor dictionary management
- Loading branch information
Showing
84 changed files
with
729 additions
and
9,223 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
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` |
Oops, something went wrong.