Result由接口从对象Handler中读取,也就是作为一个配置项了,而不是强制
framework/Directory.Build.props
diff --git a/framework/Directory.Build.props b/framework/Directory.Build.props
index fb9b44e..a5dc3f1 100644
--- a/framework/Directory.Build.props
+++ b/framework/Directory.Build.props
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
- <Version>26.10.06</Version>
- <FileVersion>26.10.06</FileVersion>
- <AssemblyVersion>26.10.06</AssemblyVersion>
+ <Version>26.10.07</Version>
+ <FileVersion>26.10.07</FileVersion>
+ <AssemblyVersion>26.10.07</AssemblyVersion>
</PropertyGroup>
</Project>
\ No newline at end of file
framework/PasteApeart.Handler/common/EventActionHandler.cs
diff --git a/framework/PasteApeart.Handler/common/EventActionHandler.cs b/framework/PasteApeart.Handler/common/EventActionHandler.cs
index b83a5d4..af2eee3 100644
--- a/framework/PasteApeart.Handler/common/EventActionHandler.cs
+++ b/framework/PasteApeart.Handler/common/EventActionHandler.cs
@@ -88,6 +88,7 @@ namespace PasteApeart.Handler
{
if (string.IsNullOrWhiteSpace(msg))
{
+ _logger.LogError("传入的数据不能为空");
return null;
}
@@ -310,14 +311,12 @@ namespace PasteApeart.Handler
if (task != null)
{
await task;
- //var type = task.GetType();
- //if (type.IsGenericType)
- //{
- // return type.GetProperty("Result")?.GetValue(task);
- //}
- //return null;
- // 从 handler 实例上读 Result 属性(而不是从 Task<T> 里读)
- var resultProp = handlerType.GetProperty("Result");
+ //// 从 handler 接口上读 Result 属性(而不是从 Task<T> 里读)
+ //var resultProp = handlerType.GetProperty("Result");
+ //return resultProp?.GetValue(handler);
+
+ // 用具体类型读,而不是接口类型
+ var resultProp = handler.GetType().GetProperty("Result");
return resultProp?.GetValue(handler);
}
else