Files
bl/modules/task/model/task_log.go

38 lines
758 B
Go
Raw Normal View History

2025-06-20 17:13:51 +08:00
package model
import (
"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
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{})
}