Redis.cs
3.09 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
namespace Rcs.Domain.Settings;
/// <summary>
/// Redis 配置选项
/// @author zzy
/// </summary>
public record Redis
{
/// <summary>
/// Redis 服务器地址
/// </summary>
public required string Host { get; set; }
/// <summary>
/// Redis 端口
/// </summary>
public required string Port { get; set; }
/// <summary>
/// Redis 密码
/// </summary>
public required string Password { get; set; }
/// <summary>
/// Redis Key 前缀配置,统一管理防止重复命名
/// 默认值确保即使环境变量只覆盖部分配置也能正常工作
/// </summary>
public RedisKeyPrefixes KeyPrefixes { get; set; } = new();
}
/// <summary>
/// Redis Key 前缀配置
/// @author zzy
/// </summary>
public record RedisKeyPrefixes
{
/// <summary>
/// VDA5050 协议路径缓存前缀
/// </summary>
public string VdaPath { get; set; } = "rcs:vda:path";
/// <summary>
/// 机器人状态缓存前缀
/// </summary>
public string Robot { get; set; } = "rcs:robot";
/// <summary>
/// 机器人状态后缀
/// </summary>
public string RobotStatusSuffix { get; set; } = "status";
/// <summary>
/// 机器人位置后缀
/// </summary>
public string RobotLocationSuffix { get; set; } = "location";
/// <summary>
/// 机器人基础信息后缀
/// </summary>
public string RobotBasicSuffix { get; set; } = "basic";
/// <summary>
/// 机器人集合键
/// </summary>
public string RobotsSet { get; set; } = "rcs:robots";
/// <summary>
/// 在线机器人集合键
/// </summary>
public string RobotsOnlineSet { get; set; } = "rcs:robots:online";
/// <summary>
/// 空闲机器人集合键
/// </summary>
public string RobotsIdleSet { get; set; } = "rcs:robots:idle";
/// <summary>
/// 地图缓存前缀
/// </summary>
public string Map { get; set; } = "rcs:map";
/// <summary>
/// 地图列表键
/// </summary>
public string MapList { get; set; } = "rcs:maps";
/// <summary>
/// 地图节点索引后缀
/// </summary>
public string MapNodeIndexSuffix { get; set; } = "nodes";
/// <summary>
/// MQTT 接收头哈希键后缀
/// </summary>
public string MqttHeaderSuffix { get; set; } = "revice-headers";
#region 地图锁相关前缀
/// <summary>
/// 节点锁前缀
/// </summary>
public string NodeLockPrefix { get; set; } = "rcs:lock:node";
/// <summary>
/// 边锁前缀
/// </summary>
public string EdgeLockPrefix { get; set; } = "rcs:lock:edge";
/// <summary>
/// 机器人锁定的资源集合前缀(用于记录机器人持有的所有锁)
/// </summary>
public string RobotLockResourcesPrefix { get; set; } = "rcs:lock:robot";
/// <summary>
/// 机器人节点锁后缀
/// </summary>
public string RobotLockNodesSuffix { get; set; } = "nodes";
/// <summary>
/// 机器人边锁后缀
/// </summary>
public string RobotLockEdgesSuffix { get; set; } = "edges";
#endregion
}