package models // PrintLog 打印日志表 type PrintLog struct { ID int64 `json:"id" gorm:"primarykey;comment:日志ID"` PrintTaskID int64 `json:"print_task_id" gorm:"not null;default:0;index;comment:打印任务ID"` PrintedAt int64 `json:"printed_at" gorm:"default:0;comment:打印时间戳(秒)"` Result int8 `json:"result" gorm:"type:tinyint(1);default:1;comment:打印结果(1:成功,0:失败)"` ErrorInfo string `json:"error_info" gorm:"size:255;default:'';comment:错误信息"` IsDel int8 `json:"is_del" gorm:"type:tinyint(1);default:0;comment:逻辑删除标记(0:未删除,1:已删除)"` } func (PrintLog) TableName() string { return "print_log" } func (PrintLog) TableOptions() string { return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='打印日志表'" }