package models import "time" type UserToken struct { ID int64 `gorm:"id;primary_key"` UserId int64 `gorm:"UserId"` Token string `gorm:"token"` ExpirationTime time.Time `gorm:"expiration_time"` CreatedAt time.Time `gorm:"created_at;type:timestamptz"` UpdatedAt time.Time `gorm:"updated_at;type:timestamptz"` } // 实现 TableName 方法指定表名 func (UserToken) TableName() string { return "user_token" }