You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
808 B
22 lines
808 B
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// User 用户模型
|
|
type User struct {
|
|
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
Username string `gorm:"column:username;type:varchar(32);not null" json:"username"`
|
|
Email string `gorm:"column:email;type:varchar(128);not null" json:"email"`
|
|
Password string `gorm:"column:password;type:varbinary(64);not null" json:"-"`
|
|
Phone string `gorm:"column:phone;type:varchar(20);default:''" json:"phone"`
|
|
Status int64 `gorm:"column:status;type:tinyint;default:1" json:"status"`
|
|
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (User) TableName() string {
|
|
return "user"
|
|
}
|
|
|