新增部分模块
This commit is contained in:
21
models/user.go
Normal file
21
models/user.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
ID int8 `gorm:"id;primary_key"`
|
||||
Nickname string `gorm:"nickname"`
|
||||
Username string `gorm:"username"`
|
||||
Password string `gorm:"password"`
|
||||
Email string `gorm:"email"`
|
||||
Phone string `gorm:"phone"`
|
||||
Status int `gorm:"status"`
|
||||
Salt string `gorm:"salt"`
|
||||
CreatedAt time.Time `gorm:"created_at;type:timestamptz"`
|
||||
UpdatedAt time.Time `gorm:"updated_at;type:timestamptz"`
|
||||
}
|
||||
|
||||
// 实现 TableName 方法指定表名
|
||||
func (User) TableName() string {
|
||||
return "d_user"
|
||||
}
|
||||
Reference in New Issue
Block a user