fbc_starter/cache/
cache_key_table.rs

1/// 缓存 Key 表
2///
3/// 用于统一管理和生成缓存的 key,避免多个项目使用的 key 重复
4///
5/// 使用 @Cacheable 时,其 value 值一定要在此处指定
6
7/// 验证码前缀
8/// 完整 key: captcha:{key} -> str
9pub const CAPTCHA: &str = "captcha";
10
11/// Token 前缀
12/// 完整 key: token:{token} -> userid
13pub const TOKEN: &str = "token";
14
15//------------------
16// 权限系统缓存 start
17
18/// 总登录次数
19/// total_login_pv:{TENANT} -> Long
20pub const TOTAL_LOGIN_PV: &str = "total_login_pv";
21
22/// 今日登录次数
23/// today_login_pv:{TENANT}:{today} -> Long
24pub const TODAY_LOGIN_PV: &str = "today_login_pv";
25
26/// 今日登录总 IP
27/// today_login_iv:{TENANT}:{today} -> int
28pub const TODAY_LOGIN_IV: &str = "today_login_iv";
29
30/// 今日登录总 IP
31/// TOTAL_LOGIN_IV:{TENANT} -> int
32pub const TOTAL_LOGIN_IV: &str = "total_login_iv";
33
34/// 今日 PV
35/// today_pv:{TENANT} -> int
36pub const TODAY_PV: &str = "today_pv";
37
38/// 总 PV
39/// total_pv:{TENANT} -> int
40pub const TOTAL_PV: &str = "total_pv";
41
42/// 最近 10 天访问记录
43/// login_log_tenday:{TENANT}:{today}:{account} -> Map
44pub const LOGIN_LOG_TEN_DAY: &str = "login_log_tenday";
45
46/// 登录总次数
47/// login_log_browser:{TENANT} -> Map
48pub const LOGIN_LOG_BROWSER: &str = "login_log_browser";
49
50/// 登录总次数
51/// login_log_system{TENANT} -> Map
52pub const LOGIN_LOG_SYSTEM: &str = "login_log_system";
53
54/// 参数前缀
55/// 完整 key: parameter_key:{key} -> obj
56pub const PARAMETER_KEY: &str = "parameter_key";
57
58/// 在线用户前缀
59/// 完整 key: online:{userid} -> token (String)
60pub const ONLINE: &str = "online";
61
62/// 用户 token 前缀
63/// 完整 key: token_user_id:{token} -> userid (Long)
64pub const TOKEN_USER_ID: &str = "token_user_id";
65
66/// 用户注册前缀
67/// 完整 key: register:{注册类型}:{手机号}
68pub const REGISTER_USER: &str = "register";
69
70// 权限系统缓存 end
71
72/// 好友相关缓存 Key
73pub mod friend {
74    /// 好友的关联映射
75    pub const RELATION: &str = "friend_relation";
76
77    /// 好友的反向映射
78    pub const REVERSE_FRIENDS: &str = "reverse_friends";
79
80    /// 好友关系
81    pub const USER_FRIENDS: &str = "user_friends";
82
83    /// 好友关联的状态映射
84    pub const RELATION_STATUS: &str = "relation_status";
85}
86
87/// 在线状态相关缓存 Key
88pub mod presence {
89    /// 全局用户
90    pub const GLOBAL_USERS_ONLINE: &str = "global_users_online";
91
92    /// 全局用户映射
93    pub const GLOBAL_DEVICES_ONLINE: &str = "global_devices_online";
94
95    /// 用户有多少个群的映射
96    pub const USERS_GROUP: &str = "users_group";
97
98    /// 用户有多少个群中在线的映射
99    pub const USERS_GROUP_ONLINE: &str = "users_group_online";
100
101    /// 群组成员构建器
102    pub const GROUP_MEMBERS: &str = "group_members";
103
104    /// 群组在线成员构建器
105    pub const GROUP_MEMBERS_ONLINE: &str = "group_members_online";
106}
107
108/// 视频通话相关缓存 Key
109pub mod video_call {
110    /// 管理员的元数据
111    pub const META_DATA_ADMIN: &str = "meta_data_admin";
112}
113
114/// 系统相关缓存 Key
115pub mod system {
116    /// 系统缓存
117    pub const SYS_CONFIG: &str = "sys_config";
118
119    /// 租户
120    pub const TENANT: &str = "def_tenant";
121
122    /// 应用
123    pub const APPLICATION: &str = "def_application";
124
125    /// 默认字典
126    pub const DICT: &str = "def_dict";
127
128    /// 默认参数
129    pub const DEF_PARAMETER: &str = "def_parameter";
130
131    /// 用户前缀
132    pub const DEF_USER: &str = "def_user";
133
134    /// 客户端
135    pub const DEF_CLIENT: &str = "def_client";
136
137    /// 租户拥有的资源
138    pub const TENANT_APPLICATION_RESOURCE: &str = "t_a_r";
139
140    /// 租户拥有的应用
141    pub const TENANT_APPLICATION: &str = "t_a";
142
143    /// 资源
144    pub const RESOURCE: &str = "dr";
145
146    /// 资源接口
147    pub const RESOURCE_API: &str = "dra";
148
149    /// 应用的资源
150    pub const APPLICATION_RESOURCE: &str = "app_res";
151
152    pub const ALL_RESOURCE_API: &str = "all_dra";
153}
154
155/// 聊天相关缓存 Key
156pub mod chat {
157    /// 房间元数据
158    pub const ROOM_META: &str = "room_meta";
159
160    /// 关闭房间
161    pub const CLOSE_ROOM: &str = "close_room";
162
163    /// 密码
164    pub const CHAT_PASSWORD: &str = "chat_password";
165
166    /// chat-gpt
167    pub const CHAT_GPT: &str = "chat_GPT";
168
169    /// 认证
170    pub const AUTH: &str = "auth";
171
172    /// 异步
173    pub const AYSNC: &str = "aysnc";
174
175    /// 聊天 token
176    pub const CHAT_TOKEN: &str = "chat_token";
177
178    /// 用户
179    pub const USER_CACHE: &str = "user_cache";
180
181    /// 微信消息
182    pub const WX_MSG: &str = "wxMsg";
183
184    /// 用户在线状态
185    pub const USER_STATE: &str = "user_state";
186
187    /// 用户在线状态
188    pub const ANNOUNCEMENTS: &str = "announcements";
189
190    /// 朋友圈
191    pub const FEED: &str = "feed";
192
193    /// 朋友圈素材
194    pub const FEED_MEDIA: &str = "feedMedia";
195
196    /// 朋友圈权限
197    pub const FEED_TARGET: &str = "feedTarget";
198
199    /// 朋友圈评论
200    pub const FEED_COMMENT: &str = "feedComment";
201
202    /// 朋友圈点赞
203    pub const FEED_LIKE: &str = "feedLike";
204
205    /// 会话信息
206    pub const USER_CONTACT: &str = "user_contact";
207
208    /// 在途消息
209    pub const PASSAGE_MSG: &str = "passage_msg";
210
211    /// 群组信息(基于 group_id)
212    pub const GROUP_INFO_FORMAT: &str = "group_info";
213
214    /// 群组信息(基于 room_id)
215    pub const ROOM_GROUP_INFO_FORMAT: &str = "room_group_info";
216
217    /// 房间信息
218    pub const ROOM_INFO_FORMAT: &str = "room_info";
219
220    /// 单聊房间信息
221    pub const ROOM_FRIEND_FORMAT: &str = "room_friend";
222
223    /// 房间消息
224    pub const ROOM_MSG_FORMAT: &str = "room_msg";
225
226    /// 群公告已读数量
227    pub const GROUP_ANNOUNCEMENTS_FORMAT: &str = "group_announcements";
228
229    /// 热门房间 ZSet
230    pub const HOT_ROOM_ZET: &str = "hot_room";
231}
232
233/// OAuth 相关缓存 Key
234pub mod oauth {
235    /// 租户自定义字典
236    pub const QR: &str = "qr_status";
237}
238
239/// 基础服务相关缓存 Key
240pub mod base {
241    /// 租户自定义字典
242    pub const BASE_DICT: &str = "base_dict";
243
244    /// 组织前缀
245    pub const BASE_ORG: &str = "base_org";
246
247    /// 岗位前缀
248    pub const BASE_POSITION: &str = "base_position";
249
250    /// 员工前缀
251    pub const BASE_EMPLOYEE: &str = "base_employee";
252
253    /// 全局员工前缀
254    pub const DEF_USER_TENANT: &str = "def_user_tenant";
255
256    /// 角色前缀
257    /// 完整 key: role:{roleId}
258    pub const ROLE: &str = "role";
259
260    /// 角色拥有那些资源前缀
261    /// 完整 key: role_resource:{ROLE_ID} -> [RESOURCE_ID, ...]
262    pub const ROLE_RESOURCE: &str = "role_resource";
263
264    /// 员工拥有那些角色前缀
265    /// 完整 key: employee_role:{EMPLOYEE_ID} -> [ROLE_ID, ...]
266    pub const EMPLOYEE_ROLE: &str = "employee_role";
267
268    /// 角色拥有那些组织前缀
269    /// 完整 key: employee_org:{EMPLOYEE_ID} -> [ORG_ID, ...]
270    pub const EMPLOYEE_ORG: &str = "employee_org";
271
272    /// 角色拥有那些组织前缀
273    /// 完整 key: org_role:{ORG_ID} -> [ROLE_ID, ...]
274    pub const ORG_ROLE: &str = "org_role";
275}