64 lines
2.0 KiB
C#
64 lines
2.0 KiB
C#
namespace SHH.Contracts
|
|
{
|
|
/// <summary>
|
|
/// 服务端身份注册信息 (DTO)
|
|
/// <para>用于服务端主动连上客户端后,上报自身的端口和身份信息</para>
|
|
/// </summary>
|
|
public class RegisterPayload
|
|
{
|
|
#region --- 0. 协议自描述 ---
|
|
|
|
/// <summary>协议类型标识 (人工可读)</summary>
|
|
public string Protocol { get; set; } = ProtocolCodes.ServerRegister;
|
|
|
|
#endregion
|
|
|
|
#region --- 1. 身份标识 ---
|
|
|
|
/// <summary>进程 ID (用于区分同一台机器上的多个实例)</summary>
|
|
public int ProcessId { get; set; }
|
|
|
|
/// <summary>调用进程 ID (用于区分同一台机器上的多个实例)</summary>
|
|
public int InvokeProcId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 实例唯一标识符
|
|
/// <para>启动时通过命令行传入,例如 "Gateway_Factory_A"</para>
|
|
/// </summary>
|
|
public string InstanceId { get; set; } = string.Empty;
|
|
|
|
/// <summary>服务端版本号</summary>
|
|
public string Version { get; set; } = "1.0.0";
|
|
|
|
#endregion
|
|
|
|
#region --- 2. 网络诊断信息 (用于运维) ---
|
|
|
|
/// <summary>
|
|
/// 服务端所在的局域网 IP
|
|
/// <para>客户端无法直接连接此IP(因为可能是内网),但运维人员需要知道</para>
|
|
/// </summary>
|
|
public string ServerIp { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// WebAPI 监听端口 (HTTP)
|
|
/// <para>用于运维人员打开 Swagger 进行调试</para>
|
|
/// </summary>
|
|
public int WebApiPort { get; set; }
|
|
|
|
/// <summary>Grpc通讯端口</summary>
|
|
public int GrpcPort { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region --- 3. 运行时状态 ---
|
|
|
|
/// <summary>启动时间</summary>
|
|
public DateTime StartTime { get; set; }
|
|
|
|
/// <summary>描述信息 (可选)</summary>
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
#endregion
|
|
}
|
|
} |