-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDebugStartRequest.cs
More file actions
46 lines (40 loc) · 1.36 KB
/
Copy pathDebugStartRequest.cs
File metadata and controls
46 lines (40 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using AppBoxCore;
namespace AppBoxDesign;
public sealed class DebugStartRequest : IBinSerializable
{
public ModelId ModelId { get; set; }
public string AppName { get; set; } = null!;
public string ServiceName { get; set; } = null!;
public string MethodName { get; set; } = null!;
public int[] Breakpoints { get; set; } = null!;
//TODO: 调用服务的参数
public void WriteTo<TWriter>(ref TWriter w) where TWriter : struct, IOutputStream
{
//写入模型标识
w.WriteLong(ModelId);
//写入待调试的服务方法
w.WriteString(AppName);
w.WriteString(ServiceName);
w.WriteString(MethodName);
//写入Breakpoints
w.WriteVariant(Breakpoints.Length);
for (var i = 0; i < Breakpoints.Length; i++)
{
w.WriteInt(Breakpoints[i] + 1 /*暂加1行*/);
}
//TODO:最后写入调用参数
}
public void ReadFrom<TReader>(ref TReader rs) where TReader : struct, IInputStream
{
ModelId = rs.ReadLong();
AppName = rs.ReadString()!;
ServiceName = rs.ReadString()!;
MethodName = rs.ReadString()!;
var breakpointCount = rs.ReadVariant();
Breakpoints = new int[breakpointCount];
for (var i = 0; i < breakpointCount; i++)
{
Breakpoints[i] = rs.ReadInt();
}
}
}