refactor: 重构文档处理流程和任务管理
This commit is contained in:
66
model/entity/task.go
Normal file
66
model/entity/task.go
Normal file
@@ -0,0 +1,66 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"rag/common/task"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type taskCol struct {
|
||||
beans.SQLBaseCol
|
||||
TaskId string
|
||||
TaskType string
|
||||
Status string
|
||||
Executor string
|
||||
Remark string
|
||||
//Priority string
|
||||
//ParentTaskId string
|
||||
//TotalItems string
|
||||
//ProcessedItems string
|
||||
//Progress string
|
||||
//StartTime string
|
||||
//EndTime string
|
||||
//Duration string
|
||||
//SuccessCount string
|
||||
//FailCount string
|
||||
}
|
||||
|
||||
var TaskCol = taskCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
TaskId: "task_id",
|
||||
TaskType: "task_type",
|
||||
Status: "status",
|
||||
Executor: "executor",
|
||||
Remark: "remark",
|
||||
//Priority: "priority",
|
||||
//ParentTaskId: "parent_task_id",
|
||||
//TotalItems: "total_items",
|
||||
//ProcessedItems: "processed_items",
|
||||
//Progress: "progress",
|
||||
//StartTime: "start_time",
|
||||
//EndTime: "end_time",
|
||||
//Duration: "duration",
|
||||
//SuccessCount: "success_count",
|
||||
//FailCount: "fail_count",
|
||||
}
|
||||
|
||||
// Task 任务记录表
|
||||
type Task struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
|
||||
TaskId int64 `orm:"task_id" json:"taskId" dc:"任务ID"`
|
||||
TaskType task.TaskType `orm:"task_type" json:"taskType" dc:"任务类型"`
|
||||
Status task.TaskStatus `orm:"status" json:"status" dc:"任务状态"`
|
||||
Executor string `orm:"executor" json:"executor" dc:"执行器"`
|
||||
Remark string `orm:"remark" json:"remark" dc:"备注"`
|
||||
//Priority task.TaskPriority `orm:"priority" json:"priority" dc:"任务优先级"`
|
||||
//ParentTaskId int64 `orm:"parent_task_id" json:"parentTaskId" dc:"父任务ID"`
|
||||
//TotalItems int64 `orm:"total_items" json:"totalItems" dc:"总项数"`
|
||||
//ProcessedItems int64 `orm:"processed_items" json:"processedItems" dc:"已处理项数"`
|
||||
//SuccessCount int64 `orm:"success_count" json:"successCount" dc:"成功数"`
|
||||
//FailCount int64 `orm:"fail_count" json:"failCount" dc:"失败数"`
|
||||
//Progress float64 `orm:"progress" json:"progress" dc:"进度百分比"`
|
||||
//StartTime *gtime.Time `orm:"start_time" json:"startTime" dc:"开始时间戳"`
|
||||
//EndTime *gtime.Time `orm:"end_time" json:"endTime" dc:"结束时间戳"`
|
||||
//Duration int64 `orm:"duration" json:"duration" dc:"耗时(毫秒)"`
|
||||
}
|
||||
Reference in New Issue
Block a user