2025-06-20 17:13:51 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
2025-06-20 22:03:38 +00:00
|
|
|
"blazing/cool"
|
2025-06-20 17:13:51 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const TableNameTaskLog = "task_log"
|
|
|
|
|
|
|
|
|
|
// TaskLog mapped from table <task_log>
|
|
|
|
|
type TaskLog struct {
|
|
|
|
|
*cool.Model
|
2025-06-22 12:05:07 +08:00
|
|
|
TaskId uint32 `gorm:"column:taskId;comment:任务ID" json:"taskId"`
|
2025-06-20 17:13:51 +08:00
|
|
|
Status uint8 `gorm:"column:status;not null;comment:状态 0:失败 1:成功" json:"status"`
|
|
|
|
|
Detail string `gorm:"column:detail;comment:详情" json:"detail"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName TaskLog's table name
|
|
|
|
|
func (*TaskLog) TableName() string {
|
|
|
|
|
return TableNameTaskLog
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GroupName TaskLog's table group
|
|
|
|
|
func (*TaskLog) GroupName() string {
|
|
|
|
|
return "default"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewTaskLog create a new TaskLog
|
|
|
|
|
func NewTaskLog() *TaskLog {
|
|
|
|
|
return &TaskLog{
|
|
|
|
|
Model: cool.NewModel(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// init 创建表
|
|
|
|
|
func init() {
|
|
|
|
|
cool.CreateTable(&TaskLog{})
|
|
|
|
|
}
|