video,user使用gorm.model

This commit is contained in:
junleea 2024-06-03 17:13:23 +08:00
parent 288feb822c
commit d002a4cb45
2 changed files with 4 additions and 2 deletions

View File

@ -2,10 +2,11 @@ package dao
import ( import (
"fmt" "fmt"
"gorm.io/gorm"
) )
type User struct { type User struct {
ID uint `gorm:"primarykey column:id"` gorm.Model
Name string `gorm:"column:name"` Name string `gorm:"column:name"`
Age int `gorm:"column:age"` Age int `gorm:"column:age"`
Email string `gorm:"column:email"` Email string `gorm:"column:email"`

View File

@ -1,11 +1,12 @@
package dao package dao
import ( import (
"gorm.io/gorm"
"time" "time"
) )
type Video struct { type Video struct {
ID uint `gorm:"primarykey column:id"` gorm.Model
CameraID int `gorm:"column:camera_id"` CameraID int `gorm:"column:camera_id"`
VideoPath string `gorm:"column:video_path"` VideoPath string `gorm:"column:video_path"`
VideoName string `gorm:"column:video_name"` VideoName string `gorm:"column:video_name"`