46 lines
1.8 KiB
Go
46 lines
1.8 KiB
Go
package dao
|
||
|
||
import "lone-services/pkg/utils"
|
||
|
||
// UserRow 主用户(表 users)
|
||
type UserRow struct {
|
||
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
||
Mobile string `gorm:"column:mobile" json:"mobile"`
|
||
Name string `gorm:"column:name" json:"name"`
|
||
Avatar string `gorm:"column:avatar" json:"avatar"`
|
||
Gender uint8 `gorm:"column:gender" json:"gender"`
|
||
Birthday utils.CustomTime `gorm:"column:birthday;type:date" json:"birthday"`
|
||
Status uint8 `gorm:"column:status" json:"status"`
|
||
CreatedAt utils.CustomTime `gorm:"column:created_at" json:"created_at"`
|
||
UpdatedAt utils.CustomTime `gorm:"column:updated_at" json:"updated_at"`
|
||
}
|
||
|
||
// UserCreate 新建用户
|
||
type UserCreate struct {
|
||
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
||
Mobile string `gorm:"column:mobile" json:"mobile"`
|
||
Name string `gorm:"column:name" json:"name"`
|
||
Avatar string `gorm:"column:avatar" json:"avatar"`
|
||
Gender uint8 `gorm:"column:gender" json:"gender"`
|
||
Birthday utils.CustomTime `gorm:"column:birthday;type:date" json:"birthday"`
|
||
Status uint8 `gorm:"column:status" json:"status"`
|
||
}
|
||
|
||
type UserListItem struct {
|
||
Id int64 `json:"id"`
|
||
Name string `json:"name"`
|
||
HeadPortrait string `json:"head_portrait"`
|
||
Mobile string `json:"mobile"`
|
||
OriginMobile string `json:"origin_mobile"`
|
||
Gender uint8 `json:"gender"`
|
||
Birthday string `json:"birthday"`
|
||
Status uint8 `json:"status"`
|
||
CreatedAt utils.CustomTime `json:"created_at"`
|
||
UpdatedAt utils.CustomTime `json:"updated_at"`
|
||
}
|
||
|
||
type UserItemsData struct {
|
||
Count int64 `json:"count"`
|
||
Items []UserListItem `json:"items"`
|
||
}
|