18 lines
468 B
Go
18 lines
468 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type UserToken struct {
|
|
ID int8 `gorm:"id;primary_key"`
|
|
UserId int8 `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"
|
|
}
|