改良写入字段,减少使用者失误

This commit is contained in:
algotao
2025-12-16 17:19:06 +08:00
parent 9a892eb533
commit d4bf3297d4
7 changed files with 265 additions and 199 deletions

View File

@@ -73,21 +73,24 @@ message Write {
// WriteItem 写入命令
message WriteItem {
string userid = 1; // 用户ID
Bytes write_bytes = 2; // byte区域
Uint32s write_uint32s = 3; // uint32区域
FlagsWithExpire write_flags_with_expire = 4; // 标志位区域
Bytes write_bytes = 2 [deprecated = true]; // byte区域。!!!弃用请使用bytes_kv
Uint32s write_uint32s = 3 [deprecated = true]; // uint32区域。!!!弃用请使用uint32s_kv
FlagsWithExpire write_flags_with_expire = 4 [deprecated = true]; // 标志位区域。!!!弃用请使用flags_with_expire_kv
map<uint32, uint32> bytes_kv = 5; // 写入bytekey为1-64索引值value为0-255数值。index/value超限会丢弃
map<uint32, uint32> uint32s_kv = 6; // 写入uint32key为1-64索引值value为uint32数值。index超限会丢弃
map<uint32, FlagWithExpire> flags_with_expire_kv = 7; // 写入标志位key为1-64索引值index超限会丢弃
}
// Bytes 写入byte区域
message Bytes {
bytes bytes = 1; // 写入的byte
uint64 index_1 = 2; // 写入byte的索引值(0..63)
bytes bytes = 1 ; // 写入的byte
uint64 index_1 = 2 ; // 写入byte的索引值(0..63)
}
// Uint32s 写入uint32区域
message Uint32s {
repeated uint32 uint32s = 1; // 写入的uint32
uint64 index_1 = 2; // 写入uint32的索引值(0..7) 最多 8 个
repeated uint32 uint32s = 1; // 写入的uint32
uint64 index_1 = 2; // 写入uint32的索引值(0..7) 最多 8 个
}
// FlagsWithExpire 写入标志位区域
@@ -330,7 +333,7 @@ message InfoRes {
message ReadRes {
uint32 succ_cmd_count = 1; // 成功的命令数量
uint32 fail_cmd_count = 2; // 失败的命令数量
repeated ValueItem cmd_res = 3; // 返回的命令
repeated ValueItem cmd_res = 3 ; // 返回的命令
}
// WriteRes 写记录返回
@@ -344,11 +347,14 @@ message WriteRes {
message ValueItem {
uint32 cmd_index = 1; // 命令索引
CmdErrorCode cmd_code = 2; // 状态
bytes bytes = 3; // byte区域
repeated uint32 uint32s = 4; // uint32区域
repeated FlagWithExpire flags_with_expire = 5; // 标志位区域
bytes bytes = 3 [deprecated = true]; // byte区域。!!!弃用
repeated uint32 uint32s = 4 [deprecated = true]; // uint32区域。!!!弃用
repeated FlagWithExpire flags_with_expire = 5 [deprecated = true]; // 标志位区域。!!!弃用
uint32 last_modify_time = 6; // 最后修改时间
uint32 version = 7; // 存储版本
map<uint32, uint32> bytes_kv = 8; // byte区域
map<uint32, uint32> uint32s_kv = 9; // uint32区域
map<uint32, FlagWithExpire> flags_with_expire_kv = 10; // 标志位区域
}
// TaskListRes 任务列表返回