增加策略列表、绑定、解绑
This commit is contained in:
94
cmd.proto
94
cmd.proto
@@ -17,7 +17,12 @@ message SaasReq {
|
||||
TaskDelete task_delete = 23; // 删除任务
|
||||
TaskInfo task_info = 24; // 任务详情
|
||||
|
||||
Debug debug = 30; // 试运行lua脚本
|
||||
TargetList target_list = 50; // 列出策略及绑定
|
||||
|
||||
BindSet bind_set = 61; // 设置绑定
|
||||
BindDelete bind_delete = 62; // 解除绑定
|
||||
|
||||
Debug debug = 90; // 试运行lua脚本
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,18 +128,37 @@ message TaskInfo {
|
||||
string task_sha256 = 1; // 任务sha256
|
||||
}
|
||||
|
||||
// FileInfo 任务文件信息
|
||||
message FileInfo {
|
||||
string file_name = 1; // 文件名
|
||||
uint64 file_size = 2; // 文件大小
|
||||
repeated FileBlock file_blocks = 3; // 文件块列表
|
||||
}
|
||||
|
||||
// FileBlock 文件块信息
|
||||
message FileBlock {
|
||||
string block_sha256 = 1; // 块的sha256
|
||||
uint64 block_length = 2; // 块的字节长度
|
||||
bool uploaded = 3; // 是否已上传(在TaskCreate/TaskInfo请求返回)
|
||||
}
|
||||
|
||||
// TargetList 列出策略
|
||||
message TargetList {
|
||||
repeated string targets = 1; // 指定要列出的绑定的策略列表,如不指定则返回全部
|
||||
bool list_bind = 2; // 是否同时列出绑定信息
|
||||
}
|
||||
|
||||
// BindSet 设置绑定
|
||||
message BindSet {
|
||||
repeated Bind binds = 2; // 设置绑定内容
|
||||
}
|
||||
|
||||
// BindDelete 删除绑定
|
||||
message BindDelete {
|
||||
repeated Bind binds = 2; // 解除绑定内容
|
||||
}
|
||||
|
||||
// Debug 调试
|
||||
message Debug {
|
||||
string lua_script = 1; // 要调试的lua脚本
|
||||
bool use_server_data = 2; // 是否使用服务端用户数据
|
||||
@@ -158,15 +182,22 @@ message SaasRes {
|
||||
Task task_run_res = 22; // 运行任务返回状态
|
||||
Task task_delete_res = 23; // 删除任务返回状态
|
||||
Task task_info_res = 24; // 任务详情返回状态
|
||||
|
||||
TargetListRes target_list_res = 50; // 列出策略及绑定返回状态
|
||||
|
||||
BindSetRes bind_set_res = 61; // 设置绑定返回状态
|
||||
BindDeleteRes bind_delete_res = 62; // 删除绑定返回状态
|
||||
}
|
||||
}
|
||||
|
||||
// ReadRes 读记录返回
|
||||
message ReadRes {
|
||||
uint32 succ_cmd_count = 1; // 成功的命令数量
|
||||
uint32 fail_cmd_count = 2; // 失败的命令数量
|
||||
repeated ValueItem cmd_res = 3; // 返回的命令
|
||||
}
|
||||
|
||||
// WriteRes 写记录返回
|
||||
message WriteRes {
|
||||
//uint32 succ_cmd_count = 1; // 成功的命令数量
|
||||
//uint32 fail_cmd_count = 2; // 失败的命令数量
|
||||
@@ -183,10 +214,69 @@ message ValueItem {
|
||||
uint32 last_modify_time = 6; // 最后修改时间
|
||||
}
|
||||
|
||||
// TaskListRes 任务列表返回
|
||||
message TaskListRes {
|
||||
repeated Task tasks = 1; // 任务列表
|
||||
}
|
||||
|
||||
// TargetListRes 策略列表返回
|
||||
message TargetListRes {
|
||||
map<string, Binds> target_list = 1; // 绑定列表
|
||||
}
|
||||
|
||||
message Binds {
|
||||
repeated Bind binds = 1;
|
||||
}
|
||||
|
||||
// Bind 绑定信息
|
||||
message Bind {
|
||||
int64 bind_id = 1; //绑定的ID
|
||||
BindType bind_type = 2; //绑定类型
|
||||
string target_id = 3; //策略ID
|
||||
int64 account_id = 4; //广告主ID
|
||||
BindSourceType bind_source = 5; //绑定操作来源
|
||||
}
|
||||
|
||||
|
||||
// BindType 绑定类型
|
||||
enum BindType {
|
||||
UnknownBindType = 0;
|
||||
AdgroupId = 1; //广告
|
||||
AccountId = 3; //广告主
|
||||
}
|
||||
|
||||
// BindSourceType 绑定操作来源
|
||||
enum BindSourceType {
|
||||
DefaultBindSourceType = 0; //广告主或未填写
|
||||
ThirdPartyApi = 1; //第三方API
|
||||
ADQ = 2; //ADQ平台
|
||||
MP = 3; //MP平台
|
||||
MktApi = 4; //MarketingAPI
|
||||
}
|
||||
|
||||
// BindSetRes 设置绑定返回
|
||||
message BindSetRes {
|
||||
int32 success_num = 1; //成功数
|
||||
int32 error_num = 2; //错误数
|
||||
repeated BindError errors = 3; //绑定错误的记录
|
||||
}
|
||||
|
||||
// BindDeleteRes 删除绑定返回
|
||||
message BindDeleteRes {
|
||||
int32 success_num = 1; //成功数
|
||||
int32 error_num = 2; //错误数
|
||||
repeated BindError errors = 3; //绑定错误的记录
|
||||
}
|
||||
|
||||
// BindError 绑定错误信息
|
||||
message BindError {
|
||||
int64 bind_id = 1; //错误绑定的绑定ID
|
||||
int32 bind_type = 2; //绑定类型
|
||||
string reason = 3; //错误绑定原因
|
||||
}
|
||||
|
||||
|
||||
// DebugRes 调试返回
|
||||
message DebugRes {
|
||||
string PrintOutput = 1; // print输出
|
||||
string Error = 2; // 错误信息
|
||||
@@ -224,6 +314,8 @@ enum ErrorCode {
|
||||
|
||||
DATA_ERROR = 201; // 数据错误
|
||||
CMD_ERROR = 202; // 命令行执行错误
|
||||
|
||||
API_ERROR = 301; // 调用内部API错误
|
||||
}
|
||||
|
||||
enum CmdErrorCode {
|
||||
|
||||
Reference in New Issue
Block a user