Refactor video handling and integrate new services
- Removed legacy video handling code and models to streamline the codebase. - Updated main.go to include new services for removing watermarks and smoke logging. - Enhanced route registration to accommodate new handlers for watermark removal and smoke logging. - Improved database migration to include new models for watermark processing.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// SmokeLog 对应数据库表 fa_smoke_log(戒烟/抽烟记录)。
|
||||
//
|
||||
// 注意:这个表的字段命名来自旧系统(createtime/updatetime/deletetime 为秒级时间戳),
|
||||
// 因此这里不使用 gorm.Model 的 created_at/updated_at/deleted_at。
|
||||
type SmokeLog struct {
|
||||
// 复合主键(id, uid),其中 id 自增。
|
||||
ID int `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
||||
UID int `gorm:"column:uid;primaryKey" json:"-"`
|
||||
|
||||
// smoke_time 在库里是 date 类型(只包含日期,不包含时分秒)。
|
||||
SmokeTime *time.Time `gorm:"column:smoke_time;type:date" json:"smoke_time,omitempty"`
|
||||
|
||||
Remark string `gorm:"column:remark;type:text" json:"remark,omitempty"`
|
||||
|
||||
// createtime/updatetime/deletetime:秒级 Unix 时间戳(与 gorm 默认字段不同)
|
||||
CreateTime *int64 `gorm:"column:createtime" json:"createtime,omitempty"`
|
||||
UpdateTime *int64 `gorm:"column:updatetime" json:"updatetime,omitempty"`
|
||||
DeleteTime *int64 `gorm:"column:deletetime" json:"deletetime,omitempty"`
|
||||
|
||||
Level int64 `gorm:"column:level;default:1" json:"level"`
|
||||
Num int `gorm:"column:num;default:1" json:"num"`
|
||||
}
|
||||
|
||||
func (SmokeLog) TableName() string {
|
||||
return "fa_smoke_log"
|
||||
}
|
||||
Reference in New Issue
Block a user