diff --git a/GFramework.Cqrs.Abstractions/Cqrs/Command/ICommand.cs b/GFramework.Cqrs.Abstractions/Cqrs/Command/ICommand.cs index 6eaa1869..9c62f8f5 100644 --- a/GFramework.Cqrs.Abstractions/Cqrs/Command/ICommand.cs +++ b/GFramework.Cqrs.Abstractions/Cqrs/Command/ICommand.cs @@ -5,21 +5,9 @@ namespace GFramework.Cqrs.Abstractions.Cqrs.Command; /// 命令通常用于修改系统状态。 /// /// 命令响应类型。 -public interface ICommand : IRequest -{ -} +public interface ICommand : IRequest; /// /// 表示一个无显式返回值的 CQRS 命令。 /// -public interface ICommand : ICommand -{ -} - -/// -/// 表示一个流式 CQRS 命令。 -/// -/// 流式响应元素类型。 -public interface IStreamCommand : IStreamRequest -{ -} +public interface ICommand : ICommand; diff --git a/GFramework.Cqrs.Abstractions/Cqrs/Command/IStreamCommand.cs b/GFramework.Cqrs.Abstractions/Cqrs/Command/IStreamCommand.cs new file mode 100644 index 00000000..51323d19 --- /dev/null +++ b/GFramework.Cqrs.Abstractions/Cqrs/Command/IStreamCommand.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2026 GeWuYou +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace GFramework.Cqrs.Abstractions.Cqrs.Command; + +/// +/// 表示一个流式 CQRS 命令。 +/// +/// 流式响应元素类型。 +public interface IStreamCommand : IStreamRequest; diff --git a/GFramework.Cqrs.Abstractions/Cqrs/INotification.cs b/GFramework.Cqrs.Abstractions/Cqrs/INotification.cs index 727f9c07..4a2dbb68 100644 --- a/GFramework.Cqrs.Abstractions/Cqrs/INotification.cs +++ b/GFramework.Cqrs.Abstractions/Cqrs/INotification.cs @@ -4,6 +4,4 @@ namespace GFramework.Cqrs.Abstractions.Cqrs; /// 表示一个一对多发布的通知消息。 /// 通知不要求返回值,允许被零个或多个处理器消费。 /// -public interface INotification -{ -} +public interface INotification; diff --git a/GFramework.Cqrs.Abstractions/Cqrs/IRequest.cs b/GFramework.Cqrs.Abstractions/Cqrs/IRequest.cs index 78627e4b..dd6abb62 100644 --- a/GFramework.Cqrs.Abstractions/Cqrs/IRequest.cs +++ b/GFramework.Cqrs.Abstractions/Cqrs/IRequest.cs @@ -5,6 +5,4 @@ namespace GFramework.Cqrs.Abstractions.Cqrs; /// 该接口是命令、查询以及其他请求语义的统一基接口。 /// /// 请求响应类型。 -public interface IRequest -{ -} +public interface IRequest; diff --git a/GFramework.Cqrs.Abstractions/Cqrs/IStreamRequest.cs b/GFramework.Cqrs.Abstractions/Cqrs/IStreamRequest.cs index 37a211d4..5464459b 100644 --- a/GFramework.Cqrs.Abstractions/Cqrs/IStreamRequest.cs +++ b/GFramework.Cqrs.Abstractions/Cqrs/IStreamRequest.cs @@ -5,6 +5,4 @@ namespace GFramework.Cqrs.Abstractions.Cqrs; /// 请求处理器可以逐步产生响应序列,而不是一次性返回完整结果。 /// /// 流式响应元素类型。 -public interface IStreamRequest -{ -} +public interface IStreamRequest; diff --git a/GFramework.Cqrs.Abstractions/Cqrs/Query/IQuery.cs b/GFramework.Cqrs.Abstractions/Cqrs/Query/IQuery.cs index 9592a9bd..edf5e1a2 100644 --- a/GFramework.Cqrs.Abstractions/Cqrs/Query/IQuery.cs +++ b/GFramework.Cqrs.Abstractions/Cqrs/Query/IQuery.cs @@ -5,14 +5,4 @@ namespace GFramework.Cqrs.Abstractions.Cqrs.Query; /// 查询用于读取数据,不应产生副作用。 /// /// 查询响应类型。 -public interface IQuery : IRequest -{ -} - -/// -/// 表示一个流式 CQRS 查询。 -/// -/// 流式响应元素类型。 -public interface IStreamQuery : IStreamRequest -{ -} +public interface IQuery : IRequest; diff --git a/GFramework.Cqrs.Abstractions/Cqrs/Query/IStreamQuery.cs b/GFramework.Cqrs.Abstractions/Cqrs/Query/IStreamQuery.cs new file mode 100644 index 00000000..150fb32c --- /dev/null +++ b/GFramework.Cqrs.Abstractions/Cqrs/Query/IStreamQuery.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2026 GeWuYou +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace GFramework.Cqrs.Abstractions.Cqrs.Query; + +/// +/// 表示一个流式 CQRS 查询。 +/// +/// 流式响应元素类型。 +public interface IStreamQuery : IStreamRequest;