mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-14 20:06:34 +08:00
1. Serein.Proto.WebSocket项目中,ws方法入参新增了对于使用流程上下文作为参数的识别
This commit is contained in:
@@ -56,6 +56,11 @@ namespace Serein.Proto.WebSocket.Handle
|
||||
/// </summary>
|
||||
public bool[] UseMsgId { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用上下文作为参数
|
||||
/// </summary>
|
||||
public bool[] UseContent { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 参数名称
|
||||
/// </summary>
|
||||
|
||||
@@ -254,6 +254,12 @@ namespace Serein.Proto.WebSocket.Handle
|
||||
args[i] = data;
|
||||
}
|
||||
#endregion
|
||||
#region 传递上下文
|
||||
else if (config.UseContent[i])
|
||||
{
|
||||
args[i] = context;
|
||||
}
|
||||
#endregion
|
||||
#region 传递消息委托
|
||||
else if (config.IsNeedSendDelegate[i]) // 传递SendAsync委托
|
||||
{
|
||||
@@ -308,6 +314,7 @@ namespace Serein.Proto.WebSocket.Handle
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
if (!isCanInvoke)
|
||||
{
|
||||
|
||||
@@ -25,9 +25,5 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Library\Serein.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -210,6 +210,7 @@ namespace Serein.Proto.WebSocket
|
||||
UseRequest = parameterInfos.Select(p => p.GetCustomAttribute<UseRequestAttribute>() is not null).ToArray(),// 是否使用整体data数据
|
||||
UseData = parameterInfos.Select(p => p.GetCustomAttribute<UseDataAttribute>() is not null).ToArray(), // 是否使用整体data数据
|
||||
UseMsgId = parameterInfos.Select(p => p.GetCustomAttribute<UseMsgIdAttribute>() is not null).ToArray(), // 是否使用消息ID
|
||||
UseContent = parameterInfos.Select(p => p.ParameterType.IsAssignableFrom(typeof(WebSocketHandleContext))).ToArray(), // 是否使用上下文
|
||||
IsNeedSendDelegate = temp_array.Select(p => p.IsNeedSend).ToArray(), // 是否需要发送消息的委托
|
||||
SendDelegateType = temp_array.Select(p => p.Type).ToArray(), // 发送消息的委托类型
|
||||
CachedSendDelegates = new Delegate[temp_array.Length], // 提前缓存发送委托数组
|
||||
|
||||
Reference in New Issue
Block a user