支持显示运行进度

This commit is contained in:
algotao
2025-09-16 10:49:54 +08:00
parent fade72885f
commit ca81fba208
3 changed files with 29 additions and 8 deletions

View File

@@ -1327,10 +1327,12 @@ type Task struct {
SourcePath string `protobuf:"bytes,7,opt,name=source_path,json=sourcePath,proto3" json:"source_path,omitempty"` // 任务数据源路径
TaskSize uint64 `protobuf:"varint,8,opt,name=task_size,json=taskSize,proto3" json:"task_size,omitempty"` // 任务所有文件的总大小
// 以下字段只在返回时填写,用于提供服务端的任务状态。在请求时填写会被忽略
CreateTime string `protobuf:"bytes,10,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // 创建时间
RunTime string `protobuf:"bytes,11,opt,name=run_time,json=runTime,proto3" json:"run_time,omitempty"` // 运行时间
FinishTime string `protobuf:"bytes,12,opt,name=finish_time,json=finishTime,proto3" json:"finish_time,omitempty"` // 完成时间
Status TaskStatus `protobuf:"varint,15,opt,name=status,proto3,enum=saasapi.TaskStatus" json:"status,omitempty"` // 任务状态
CreateTime string `protobuf:"bytes,10,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // 创建时间
RunTime string `protobuf:"bytes,11,opt,name=run_time,json=runTime,proto3" json:"run_time,omitempty"` // 运行时间
FinishTime string `protobuf:"bytes,12,opt,name=finish_time,json=finishTime,proto3" json:"finish_time,omitempty"` // 完成时间
RunningBlock uint32 `protobuf:"varint,13,opt,name=running_block,json=runningBlock,proto3" json:"running_block,omitempty"` // 正在运行的块编号
TotalBlock uint32 `protobuf:"varint,14,opt,name=total_block,json=totalBlock,proto3" json:"total_block,omitempty"` // 总块数
Status TaskStatus `protobuf:"varint,15,opt,name=status,proto3,enum=saasapi.TaskStatus" json:"status,omitempty"` // 任务状态
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -1442,6 +1444,20 @@ func (x *Task) GetFinishTime() string {
return ""
}
func (x *Task) GetRunningBlock() uint32 {
if x != nil {
return x.RunningBlock
}
return 0
}
func (x *Task) GetTotalBlock() uint32 {
if x != nil {
return x.TotalBlock
}
return 0
}
func (x *Task) GetStatus() TaskStatus {
if x != nil {
return x.Status
@@ -3148,7 +3164,7 @@ const file_cmd_proto_rawDesc = "" +
"\vwrite_bytes\x18\x03 \x01(\v2\x0e.saasapi.BytesR\n" +
"writeBytes\x125\n" +
"\rwrite_uint32s\x18\x04 \x01(\v2\x10.saasapi.Uint32sR\fwriteUint32s\x12O\n" +
"\x17write_flags_with_expire\x18\x05 \x01(\v2\x18.saasapi.FlagsWithExpireR\x14writeFlagsWithExpire\"\xb6\x03\n" +
"\x17write_flags_with_expire\x18\x05 \x01(\v2\x18.saasapi.FlagsWithExpireR\x14writeFlagsWithExpire\"\xfc\x03\n" +
"\x04Task\x12!\n" +
"\fdataspace_id\x18\x01 \x01(\tR\vdataspaceId\x12\x14\n" +
"\x05appid\x18\x02 \x01(\tR\x05appid\x12\x1f\n" +
@@ -3165,7 +3181,10 @@ const file_cmd_proto_rawDesc = "" +
"createTime\x12\x19\n" +
"\brun_time\x18\v \x01(\tR\arunTime\x12\x1f\n" +
"\vfinish_time\x18\f \x01(\tR\n" +
"finishTime\x12+\n" +
"finishTime\x12#\n" +
"\rrunning_block\x18\r \x01(\rR\frunningBlock\x12\x1f\n" +
"\vtotal_block\x18\x0e \x01(\rR\n" +
"totalBlock\x12+\n" +
"\x06status\x18\x0f \x01(\x0e2\x13.saasapi.TaskStatusR\x06status\"D\n" +
"\bTaskList\x128\n" +
"\rstatus_filter\x18\x01 \x01(\x0e2\x13.saasapi.TaskStatusR\fstatusFilter\"*\n" +