更改协议

This commit is contained in:
algotao
2025-03-31 11:58:51 +08:00
parent e5bbaf659c
commit 1793e2c3d9
2 changed files with 175 additions and 103 deletions

View File

@@ -5,44 +5,46 @@ package saasapi;
option go_package = "./saasapi";
// Cmds 批量命令
message Cmds {
message SaasReq {
UserIdType userid_type = 1; // 用户ID类型
string appid = 2; // 小程序/小游戏/公众号/视频号的appid
repeated Cmd cmd = 3; // 批量写入命令
repeated WriteCmd cmds = 3; // 批量写入命令
}
// Cmd 上传命令
message Cmd {
// WriteCmd 上传命令
message WriteCmd {
string userid = 1; // 用户ID
WriteBytes write_bytes = 2; // byte区域
WriteUint32s write_uint32s = 3; // uint32区域
WriteFlagsWithExpire write_flags_with_expire = 4; // 标志位区域
bool is_full_overwrite = 5; // 是否全量覆盖
}
// WriteBytes 写入byte
message WriteBytes {
bytes write_bytes = 1; // 写入的byte
uint64 write_index_1 = 2; // 写入byte的索引值(0..63)
uint64 write_index_2 = 3; // 写入byte的索引值(64..127)
bytes bytes = 1; // 写入的byte
uint64 index_1 = 2; // 写入byte的索引值(0..63)
uint64 index_2 = 3; // 写入byte的索引值(64..127)
}
// WriteUint32s 写入uint32
message WriteUint32s {
repeated uint32 write_uint32s = 1; // 写入的uint32
uint64 write_index_1 = 2; // 写入uint32的索引值(0..63)
uint64 write_index_2 = 3; // 写入uint32的索引值(64..127)
repeated uint32 uint32s = 1; // 写入的uint32
uint64 index_1 = 2; // 写入uint32的索引值(0..63)
//uint64 index_2 = 3; // 写入uint32的索引值(64..127)
}
// WriteFlagsWithExpire 写入标志位
message WriteFlagsWithExpire {
repeated FlagWithExpire write_flags_with_expire = 1; // 写入的标志位
uint64 write_index_1 = 2; // 写入标志位的索引值
repeated FlagWithExpire flags_with_expire = 1; // 写入的标志位
uint64 index_1 = 2; // 写入标志位的索引值
}
// FlagWithExpire 标志位
message FlagWithExpire {
bool flag = 1; // 标志位
uint32 expire = 2; // 过期时间
bool default_flag = 2; // 默认值。超时后则回到默认值。
uint32 expire = 3; // 过期时间,为 0 则永不过期
}
// UserIdType 用户 ID 类型
@@ -51,6 +53,12 @@ enum UserIdType {
OpenId = 1; // OpenId
}
message SaasRes {
uint32 code = 1; // 返回码
string status = 2; // 返回信息
// repeated CmdsResItem cmd_res = 3; // 返回的命令
}
/*
//肯德基
Cmds {