支持dataspace

This commit is contained in:
algotao
2025-05-21 17:06:32 +08:00
parent e7d4aa27f1
commit b8c2a3a7d4
7 changed files with 265 additions and 342 deletions

View File

@@ -6,10 +6,6 @@ option go_package = "e.coding.net/rta/public/saasapi";
// SaasReq 命令请求
message SaasReq {
UserIdType userid_type = 1; // 用户ID类型
string appid = 2; // 小程序/小游戏/公众号/视频号的appid
uint32 namespace_id = 3; // 命名空间ID
oneof cmd {
Read read = 10; // 批量读取
Write write = 11; // 批量写入
@@ -25,7 +21,9 @@ message SaasReq {
// Read 批量读取命令
message Read {
repeated ReadItem read_items = 1; // 批量获取命令
string dataspace_id = 1; // 数据空间ID
string appid = 2; // 小程序/小游戏/公众号/视频号的appid
repeated ReadItem read_items = 3; // 批量获取命令
}
// ReadItem 读取命令
@@ -35,8 +33,10 @@ message ReadItem {
// Write 批量写入命令
message Write {
bool is_clear_all_first = 1; // 是否先清空该用户所有数据
repeated WriteItem write_items = 2; // 批量写入命令
string dataspace_id = 1; // 数据空间ID
string appid = 2; // 小程序/小游戏/公众号/视频号的appid
bool is_clear_all_first = 3; // 是否先清空该用户所有数据
repeated WriteItem write_items = 4; // 批量写入命令
}
// WriteItem 写入命令
@@ -74,32 +74,22 @@ message FlagWithExpire {
uint32 expire = 3; // 过期时间,为 0 则永不过期
}
// UserIdType 用户 ID 类型
enum UserIdType {
DEVICEID = 0; // 设备号
OPENID = 1; // OpenId
INNERID1 = 10; // 内部ID1
}
// NameSpaceId 用户 ID 类型
enum NameSpaceId {
DID = 0; // 默认设备号命名空间
WUID = 1; // 默认WUID命名空间
}
// ColumnWrite 全量列式写入命令
message ColumnWrite {
bool is_clear_all_first = 1; // 是否先执行清空
Bytes write_bytes = 2; // byte区域
Uint32s write_uint32s = 3; // uint32区域
FlagsWithExpire write_flags_with_expire = 4; // 标志位区域
string dataspace_id = 1; // 数据空间ID
bool is_clear_all_first = 2; // 是否先执行清空
Bytes write_bytes = 3; // byte区域
Uint32s write_uint32s = 4; // uint32区域
FlagsWithExpire write_flags_with_expire = 5; // 标志位区域
}
message Task {
string task_sha256 = 1; // 任务sha256
string task_description = 2; // 任务描述
repeated FileInfo task_file_infos = 3; // 文件列表
uint64 task_block_size = 4; // 文件块字节大小推荐200M
string dataspace_id = 1; // 数据空间ID
string appid = 2; // 小程序/小游戏/公众号/视频号的appid
string task_sha256 = 3; // 任务sha256
string task_description = 4; // 任务描述
repeated FileInfo task_file_infos = 5; // 文件列表
uint64 task_block_size = 6; // 文件块字节大小推荐200M
// 以下字段只在返回时填写,用于提供服务端的任务状态。在请求时填写会被忽略
string create_time = 10; // 创建时间
@@ -164,9 +154,9 @@ message ReadRes {
}
message WriteRes {
uint32 succ_cmd_count = 1; // 成功的命令数量
uint32 fail_cmd_count = 2; // 失败的命令数量
repeated ValueItem cmd_res = 3; // 返回的失败命令仅填写cmd_index和cmd_code
//uint32 succ_cmd_count = 1; // 成功的命令数量
//uint32 fail_cmd_count = 2; // 失败的命令数量
repeated string failed_userid = 3; // 返回的失败的用户ID
}
// ValueItem 读取命令返回内容
@@ -197,6 +187,7 @@ enum ErrorCode {
QPS_LIMIT = 113; // 并发请求量超限
CMDS_LIMIT = 114; // 命令数量超限
CMDS_NULL = 115; // 命令为空
DATASPACE_NOT_EXISTS = 116; // 数据空间不存在
TASK_EXISTS = 120; // 任务已存在
TASK_IS_NOT_EXISTS = 121; // 任务不存在