diff --git a/dao/user.go b/dao/user.go index a085829..2786d3d 100644 --- a/dao/user.go +++ b/dao/user.go @@ -2,10 +2,11 @@ package dao import ( "fmt" + "gorm.io/gorm" ) type User struct { - ID uint `gorm:"primarykey column:id"` + gorm.Model Name string `gorm:"column:name"` Age int `gorm:"column:age"` Email string `gorm:"column:email"` diff --git a/dao/video.go b/dao/video.go index b5fcbb8..8c4fb72 100644 --- a/dao/video.go +++ b/dao/video.go @@ -1,11 +1,12 @@ package dao import ( + "gorm.io/gorm" "time" ) type Video struct { - ID uint `gorm:"primarykey column:id"` + gorm.Model CameraID int `gorm:"column:camera_id"` VideoPath string `gorm:"column:video_path"` VideoName string `gorm:"column:video_name"`