23 lines
837 B
Go
23 lines
837 B
Go
package common
|
||
|
||
import "time"
|
||
|
||
// 定义user结构体
|
||
// 包括id,密码,用户名,手机号,头像,性别,微信unionid
|
||
type User struct {
|
||
ID int64 `json:"id,omitempty" gorm:"primaryKey;column:id"`
|
||
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
|
||
Password string `json:"password,omitempty" gorm:"column:password"`
|
||
NickName string `json:"nick_name" gorm:"column:nick_name"`
|
||
Phone string `json:"phone" gorm:"column:phone"`
|
||
Avatar string `json:"avatar" gorm:"column:avatar"`
|
||
Gender int32 `json:"gender" gorm:"column:gender"`
|
||
WxUnionID string `json:"wx_union_id,omitempty" gorm:"column:wx_union_id,unique"`
|
||
WxSession string `json:"wx_session,omitempty" gorm:"column:wx_session"`
|
||
}
|
||
|
||
// TableName 返回表名
|
||
func (u *User) TableName() string {
|
||
return "users"
|
||
}
|