diff --git a/models/User.go b/models/User.go index cd40644..d4cf60f 100644 --- a/models/User.go +++ b/models/User.go @@ -8,13 +8,13 @@ import ( ) type User struct { - ID int `json:"id"` + ID int `json:"id" gorm:"primary_key"` Name string `json:"name"` Email string `json:"email"` Password string `json:"-"` Slat string `json:"-"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } func init() {