mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-27 10:13:23 +08:00
重新设计了Libray.Json Api以及 WebSocket 的交互处理方式
This commit is contained in:
15
Serein.Proto.WebSocket/Attributes/SendAttribute.cs
Normal file
15
Serein.Proto.WebSocket/Attributes/SendAttribute.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Proto.WebSocket.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// 指示需要发送消息的处理方法
|
||||
/// </summary>
|
||||
public sealed class SendAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Proto.WebSocket.Attributes
|
||||
{
|
||||
internal sealed class UseRequestAttribute : Attribute
|
||||
/// <summary>
|
||||
/// 指示使用 WebSocket 中请求的整体数据
|
||||
/// </summary>
|
||||
public sealed class UseRequestAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace Serein.Proto.WebSocket.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>标记该类是处理模板,需要获取WebSocketServer/WebSocketClient了实例后,使用(Server/Client).MsgHandleHelper.AddModule()进行添加。</para>
|
||||
/// <para>处理模板需要继承 ISocketHandleModule 接口,否则WebSocket接受到数据时,将无法进行调用相应的处理模板。</para>
|
||||
/// <para>标记该类是处理模板</para>
|
||||
/// <para>处理模板需要继承 ISocketHandleModule 接口,否则接受到 WebSocket 数据时,将无法进行调用相应的处理模板。</para>
|
||||
/// <para>使用方式:</para>
|
||||
/// <para>[AutoSocketModule(ThemeKey = "theme", DataKey = "data")]</para>
|
||||
/// <para>public class PlcSocketService : ISocketHandleModule</para>
|
||||
@@ -16,7 +16,7 @@
|
||||
/// <para></para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public sealed class AutoSocketModuleAttribute : Attribute
|
||||
public sealed class WebSocketModuleAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务标识
|
||||
@@ -16,7 +16,7 @@
|
||||
/// <para>Func<dynamic,Task> : 会自动将对象解析为Json字符串,异步发送文本内容。</para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public sealed class AutoSocketHandleAttribute : Attribute
|
||||
public sealed class WsMethodAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 描述Json业务字段,如果不设置,将默认使用方法名称。
|
||||
@@ -32,12 +32,6 @@
|
||||
/// <para>会进行异步等待,当Task结束后,自动获取TResult进行发送(请避免Task<Task<TResult>>诸如此类的Task泛型嵌套)</para>
|
||||
/// </summary>
|
||||
public bool IsReturnValue = true;
|
||||
/// <summary>
|
||||
/// <para>表示该方法所有入参不能为空(所需的参数在请求Json的Data不存在)</para>
|
||||
/// <para>若有一个参数无法从data获取,则不会进行调用该方法</para>
|
||||
/// <para>如果设置该属性为 false ,但某些入参不能为空,而不希望在代码中进行检查,请为入参添加[NotNull]/[Needful]特性</para>
|
||||
/// </summary>
|
||||
public bool ArgNotNull = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user