完成基础功能
This commit is contained in:
@@ -17,5 +17,5 @@ type User struct {
|
||||
|
||||
// 实现 TableName 方法指定表名
|
||||
func (User) TableName() string {
|
||||
return "d_user"
|
||||
return "user"
|
||||
}
|
||||
|
||||
17
models/user_token.go
Normal file
17
models/user_token.go
Normal file
@@ -0,0 +1,17 @@
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user