From 82cd2585d57f2c42f23e7dfcdc9f1d5178a7d913 Mon Sep 17 00:00:00 2001
From: GeWuYou <95328647+GeWuYou@users.noreply.github.com>
Date: Mon, 16 Feb 2026 20:49:00 +0800
Subject: [PATCH] =?UTF-8?q?refactor(cqrs):=20=E5=B0=86=E5=9F=BA=E7=A1=80?=
=?UTF-8?q?=E7=B1=BB=E6=94=B9=E4=B8=BA=E6=8A=BD=E8=B1=A1=E7=B1=BB=E4=BB=A5?=
=?UTF-8?q?=E5=A2=9E=E5=BC=BA=E6=9E=B6=E6=9E=84=E8=AE=BE=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将 CommandBase 类标记为抽象类
- 将 NotificationBase 类标记为抽象类
- 将 QueryBase 类标记为抽象类
- 将 RequestBase 类标记为抽象类
- 保持所有泛型约束和接口继承关系不变
- 保留构造函数和输入数据属性的原有功能
---
GFramework.Core/cqrs/command/CommandBase.cs | 2 +-
GFramework.Core/cqrs/notification/NotificationBase.cs | 2 +-
GFramework.Core/cqrs/query/QueryBase.cs | 2 +-
GFramework.Core/cqrs/request/RequestBase.cs | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/GFramework.Core/cqrs/command/CommandBase.cs b/GFramework.Core/cqrs/command/CommandBase.cs
index 781b08f..308ccca 100644
--- a/GFramework.Core/cqrs/command/CommandBase.cs
+++ b/GFramework.Core/cqrs/command/CommandBase.cs
@@ -23,7 +23,7 @@ namespace GFramework.Core.cqrs.command;
/// 命令输入数据的类型
/// 命令执行后返回结果的类型
/// 命令执行所需的输入数据
-public class CommandBase(TInput input) : ICommand where TInput : ICommandInput
+public abstract class CommandBase(TInput input) : ICommand where TInput : ICommandInput
{
///
/// 获取命令的输入数据。
diff --git a/GFramework.Core/cqrs/notification/NotificationBase.cs b/GFramework.Core/cqrs/notification/NotificationBase.cs
index fe976a8..edb1d48 100644
--- a/GFramework.Core/cqrs/notification/NotificationBase.cs
+++ b/GFramework.Core/cqrs/notification/NotificationBase.cs
@@ -22,7 +22,7 @@ namespace GFramework.Core.cqrs.notification;
///
/// 通知输入数据的类型,必须实现 INotificationInput 接口
/// 通知执行所需的输入数据
-public class NotificationBase(TInput input) : INotification where TInput : INotificationInput
+public abstract class NotificationBase(TInput input) : INotification where TInput : INotificationInput
{
///
/// 获取通知的输入数据。
diff --git a/GFramework.Core/cqrs/query/QueryBase.cs b/GFramework.Core/cqrs/query/QueryBase.cs
index 77d4b0f..ac21f79 100644
--- a/GFramework.Core/cqrs/query/QueryBase.cs
+++ b/GFramework.Core/cqrs/query/QueryBase.cs
@@ -23,7 +23,7 @@ namespace GFramework.Core.cqrs.query;
/// 查询输入数据的类型,必须实现 IQueryInput 接口
/// 查询执行后返回结果的类型
/// 查询执行所需的输入数据
-public class QueryBase(TInput input) : IQuery where TInput : IQueryInput
+public abstract class QueryBase(TInput input) : IQuery where TInput : IQueryInput
{
///
/// 获取查询的输入数据。
diff --git a/GFramework.Core/cqrs/request/RequestBase.cs b/GFramework.Core/cqrs/request/RequestBase.cs
index 9143c8d..9e89935 100644
--- a/GFramework.Core/cqrs/request/RequestBase.cs
+++ b/GFramework.Core/cqrs/request/RequestBase.cs
@@ -23,7 +23,7 @@ namespace GFramework.Core.cqrs.request;
/// 请求输入数据的类型,必须实现 IRequestInput 接口
/// 请求执行后返回结果的类型
/// 请求执行所需的输入数据
-public class RequestBase(TInput input) : IRequest where TInput : IRequestInput
+public abstract class RequestBase(TInput input) : IRequest where TInput : IRequestInput
{
///
/// 获取请求的输入数据。