video,user使用gorm.model
This commit is contained in:
parent
288feb822c
commit
d002a4cb45
|
|
@ -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"`
|
||||||
|
|
|
||||||
|
|
@ -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"`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue