Files
lone-services/services/user/internal/dao/user.go
T
2026-10-15 09:23:07 +08:00

44 lines
1.7 KiB
Go

package dao
import "lone-services/pkg/utils"
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"`
}
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 string `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"`
Avatar string `json:"avatar"`
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"`
}