-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor/cqrs architecture decoupling todo 5 #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
GeWuYou
merged 16 commits into
refactor/cqrs-architecture-decoupling
from
refactor/cqrs-architecture-decoupling-todo-5
Apr 15, 2026
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
048f96c
feat(core): 添加架构上下文和CQRS运行时实现
GeWuYou 34e140e
feat(ioc): 添加 Microsoft DI 容器适配器和 CI/CD 工作流
GeWuYou 49ed5d0
refactor(tests): 添加CQRS抽象层依赖项
GeWuYou 1c5c5c8
chore(deps): 更新 Meziantou.Analyzer 和 Meziantou.Polyfill 依赖包版本
GeWuYou 28cdf79
refactor(tests): 移除项目警告级别配置
GeWuYou aba304f
test(cqrs): 添加CQRS处理器注册器单元测试
GeWuYou ede8a8f
fix(namespace): 修正命名空间
GeWuYou 932235e
refactor(tests): 更新CqrsCoroutineExtensionsTests中的命名空间引用
GeWuYou e200176
feat(arch): 添加架构上下文实现及完整测试
GeWuYou f9cc123
chore(project): 初始化项目结构和测试配置
GeWuYou 81897ce
docs(source-generators): 添加源码生成器文档
GeWuYou 82e6332
test(core): 添加架构上下文和依赖注入容器的单元测试
GeWuYou 2425d28
refactor(tests): 更新测试文件以支持Cqrs功能
GeWuYou a068a5e
test(arch): 优化架构上下文并发测试的超时配置
GeWuYou fe73d13
chore(tests): 添加Cqrs抽象依赖到架构测试
GeWuYou d881bd5
refactor(cqrs): 简化接口定义并分离流式命令和查询接口
GeWuYou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,52 @@ | ||
| using GFramework.Core.Abstractions.Architectures; | ||
| using GFramework.Cqrs.Abstractions.Cqrs; | ||
|
|
||
| namespace GFramework.Core.Abstractions.Cqrs; | ||
|
|
||
| /// <summary> | ||
| /// 定义架构上下文使用的 CQRS runtime seam。 | ||
| /// 该抽象把请求分发、通知发布与流式处理从具体实现中解耦, | ||
| /// 使 <see cref="IArchitectureContext" /> 不再直接依赖某个固定的 runtime 类型。 | ||
| /// </summary> | ||
| public interface ICqrsRuntime | ||
| { | ||
| /// <summary> | ||
| /// 发送请求并返回响应。 | ||
| /// </summary> | ||
| /// <typeparam name="TResponse">响应类型。</typeparam> | ||
| /// <param name="context">当前架构上下文,用于上下文感知处理器注入与嵌套请求访问。</param> | ||
| /// <param name="request">要分发的请求。</param> | ||
| /// <param name="cancellationToken">取消令牌。</param> | ||
| /// <returns>请求响应。</returns> | ||
| ValueTask<TResponse> SendAsync<TResponse>( | ||
| IArchitectureContext context, | ||
| IRequest<TResponse> request, | ||
| CancellationToken cancellationToken = default); | ||
|
|
||
| /// <summary> | ||
| /// 发布通知到所有已注册处理器。 | ||
| /// </summary> | ||
| /// <typeparam name="TNotification">通知类型。</typeparam> | ||
| /// <param name="context">当前架构上下文,用于上下文感知处理器注入。</param> | ||
| /// <param name="notification">要发布的通知。</param> | ||
| /// <param name="cancellationToken">取消令牌。</param> | ||
| /// <returns>表示通知分发完成的值任务。</returns> | ||
| ValueTask PublishAsync<TNotification>( | ||
| IArchitectureContext context, | ||
| TNotification notification, | ||
| CancellationToken cancellationToken = default) | ||
| where TNotification : INotification; | ||
|
|
||
| /// <summary> | ||
| /// 创建流式请求的异步响应序列。 | ||
| /// </summary> | ||
| /// <typeparam name="TResponse">流元素类型。</typeparam> | ||
| /// <param name="context">当前架构上下文,用于上下文感知处理器注入。</param> | ||
| /// <param name="request">流式请求。</param> | ||
| /// <param name="cancellationToken">取消令牌。</param> | ||
| /// <returns>按需生成的异步响应序列。</returns> | ||
| IAsyncEnumerable<TResponse> CreateStream<TResponse>( | ||
| IArchitectureContext context, | ||
| IStreamRequest<TResponse> request, | ||
| CancellationToken cancellationToken = default); | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.