LanYinSettings.cs
3.81 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
namespace Rcs.Domain.Settings;
/// <summary>
/// LanYin系统配置
/// </summary>
public class LanYinSettings
{
/// <summary>
/// API基础URL
/// </summary>
public string BaseUrl { get; set; } = string.Empty;
/// <summary>
/// API密钥
/// </summary>
public string? ApiKey { get; set; }
/// <summary>
/// 认证Token
/// </summary>
public string? AuthToken { get; set; }
/// <summary>
/// 登录账号(用于自动重新登录)
/// </summary>
public string? Account { get; set; }
/// <summary>
/// 登录密码(用于自动重新登录)
/// </summary>
public string? Password { get; set; }
/// <summary>
/// 超时时间(秒)
/// </summary>
public int TimeoutSeconds { get; set; } = 30;
/// <summary>
/// 重试次数
/// </summary>
public int RetryCount { get; set; } = 3;
/// <summary>
/// 是否启用
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// API端点配置
/// </summary>
public LanYinEndpoints Endpoints { get; set; } = new();
/// <summary>
/// WebSocket配置
/// @author zzy
/// </summary>
public LanYinWsSettings WebSocket { get; set; } = new();
}
/// <summary>
/// LanYin API端点配置
/// </summary>
public class LanYinEndpoints
{
/// <summary>
/// 登录端点
/// </summary>
public string Login { get; set; } = "/user_backend/users/login";
/// <summary>
/// 获取库位信息端点
/// </summary>
public string GetLocations { get; set; } = "/map_server/locations/";
/// <summary>
/// 任务下发端点
/// </summary>
public string DispatchTask { get; set; } = "/dispatch_server/dispatch/start/location_call/task/";
/// <summary>
/// 确认工况异常端点
/// @author zzy
/// </summary>
public string ConfirmException { get; set; } = "/master_server/hosts/exception/";
/// <summary>
/// 取消任务端点
/// @author zzy
/// </summary>
public string CancelTask { get; set; } = "/dispatch_server/dispatch/cancel/task/";
/// <summary>
/// 复位机器人
/// @author zzy
/// </summary>
public string ResetRobot { get; set; } = "/master_server/master/fix_errors/";
/// <summary>
/// 新增库位类型
/// @author zzy
/// </summary>
public string AddLocationType { get; set; } = "/map_server/locations/location_type/";
/// <summary>
/// 查询库位类型
/// @author zzy
/// </summary>
public string GetLocationTypes { get; set; } = "/map_server/locations/location_type/";
/// <summary>
/// 机器人暂停
/// </summary>
public string RobotPause { get; set; } = "/master_server/slave_manage/slave/pause/";
/// <summary>
/// 机器人取消暂停
/// </summary>
public string RobotUnPause { get; set; } = "/master_server/slave_manage/slave/continue/";
/// <summary>
/// 机器人重定位
/// @author zzy
/// </summary>
public string RelocateRobot { get; set; } = "/master_server/slave_manage/scene/switch/";
}
/// <summary>
/// 蓝因 WebSocket 配置
/// @author zzy
/// </summary>
public class LanYinWsSettings
{
public bool Enabled {get;set;} = true;
public string WebSocketUrl { get; set; } = "ws://localhost:8080/ws";
/// <summary>
/// 订阅主题配置
/// </summary>
public LanYinWsTopics Topics { get; set; } = new();
}
/// <summary>
/// 蓝音 WebSocket 订阅主题配置
/// @author zzy
/// </summary>
public class LanYinWsTopics
{
public string RobotStatus { get; set; } = "robot_status";
public string RobotInfo { get; set; } = "robot_info";
public string RobotRealtimePath { get; set; } = "robot_realtime_path";
public List<string> ToList() => [RobotStatus, RobotInfo, RobotRealtimePath];
}