完善契约与客户端、服务端的收发代码
This commit is contained in:
71
SHH.Contracts/ServerRegistrationDto.cs
Normal file
71
SHH.Contracts/ServerRegistrationDto.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
|
||||
namespace SHH.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务端身份注册信息 (DTO)
|
||||
/// <para>用于服务端主动连上客户端后,上报自身的端口和身份信息</para>
|
||||
/// </summary>
|
||||
public class ServerRegistrationDto
|
||||
{
|
||||
#region --- 1. 身份标识 ---
|
||||
|
||||
/// <summary>
|
||||
/// 进程 ID (用于区分同一台机器上的多个实例)
|
||||
/// </summary>
|
||||
public int ProcessId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实例唯一标识符
|
||||
/// <para>启动时通过命令行传入,例如 "Gateway_Factory_A"</para>
|
||||
/// </summary>
|
||||
public string InstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务端版本号
|
||||
/// </summary>
|
||||
public string Version { get; set; } = "1.0.0";
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- 2. 网络诊断信息 (用于运维) ---
|
||||
|
||||
/// <summary>
|
||||
/// 服务端所在的局域网 IP
|
||||
/// <para>客户端无法直接连接此IP(因为可能是内网),但运维人员需要知道</para>
|
||||
/// </summary>
|
||||
public string ServerIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// WebAPI 监听端口 (HTTP)
|
||||
/// <para>用于运维人员打开 Swagger 进行调试</para>
|
||||
/// </summary>
|
||||
public int WebApiPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 视频流端口 (ZeroMQ Publisher/Push)
|
||||
/// </summary>
|
||||
public int VideoPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 指令流端口 (ZeroMQ Response)
|
||||
/// </summary>
|
||||
public int CmdPort { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- 3. 运行时状态 ---
|
||||
|
||||
/// <summary>
|
||||
/// 启动时间
|
||||
/// </summary>
|
||||
public DateTime StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述信息 (可选)
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user