新增加载用户属性
This commit is contained in:
parent
934120bb92
commit
e9687cc593
@ -17,6 +17,7 @@ type UserDto struct {
|
||||
RegisterMethod int `json:"register_method"` // 注册方式(1:微信小程序)
|
||||
Age uint `json:"age"` // 年龄
|
||||
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
Email string `json:"email"` // 邮箱
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
IsOnline int `json:"is_online"` // 是否在线(0:不在线 1:在线)
|
||||
LoginAt model.LocalTime `json:"login_at"` // 小程序登陆时间
|
||||
@ -39,6 +40,7 @@ func GetUserDto(m *model.User) *UserDto {
|
||||
RegisterMethod: m.RegisterMethod,
|
||||
Age: m.Age,
|
||||
Sex: m.Sex,
|
||||
Email: m.Email,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
IsOnline: m.IsOnline,
|
||||
LoginAt: m.LoginAt,
|
||||
@ -62,6 +64,7 @@ func GetMaskUserDto(m *model.User) *UserDto {
|
||||
RegisterMethod: m.RegisterMethod,
|
||||
Age: m.Age,
|
||||
Sex: m.Sex,
|
||||
Email: m.Email,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
IsOnline: m.IsOnline,
|
||||
LoginAt: m.LoginAt,
|
||||
@ -90,6 +93,7 @@ func GetUserListDto(m []*model.User) []UserDto {
|
||||
RegisterMethod: v.RegisterMethod,
|
||||
Age: v.Age,
|
||||
Sex: v.Sex,
|
||||
Email: v.Email,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
IsOnline: v.IsOnline,
|
||||
LoginAt: v.LoginAt,
|
||||
|
||||
@ -105,6 +105,7 @@ type UserDoctorIntroductionDto struct {
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
Age uint `json:"age"` // 年龄
|
||||
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
Email string `json:"email"` // 邮箱
|
||||
RegisterMethod int `json:"register_method"` // 注册方式(1:微信小程序 2:后台添加 )
|
||||
ApplyTime model.LocalTime `json:"apply_time"` // 申请时间
|
||||
BeGoodAt string `json:"be_good_at"` // 擅长
|
||||
@ -558,6 +559,7 @@ func (r *UserDoctorIntroductionDto) LoadUserAttr(m *model.User) *UserDoctorIntro
|
||||
r.RegisterMethod = m.RegisterMethod
|
||||
r.Age = m.Age
|
||||
r.Sex = m.Sex
|
||||
r.Email = m.Email
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ type User struct {
|
||||
RegisterMethod int `gorm:"column:register_method;type:tinyint(1);comment:注册方式(1:微信小程序 )" json:"register_method"`
|
||||
Age uint `gorm:"column:age;type:int(10) unsigned;comment:年龄" json:"age"`
|
||||
Sex int `gorm:"column:sex;type:tinyint(1);default:0;comment:性别(0:未知 1:男 2:女)" json:"sex"`
|
||||
Email string `gorm:"column:email;type:varchar(100);comment:邮箱" json:"email"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||
IsOnline int `gorm:"column:is_online;type:tinyint(1);default:0;comment:是否在线(0:不在线 1:在线)" json:"is_online"`
|
||||
LoginAt LocalTime `gorm:"column:login_at;type:datetime;comment:小程序登陆时间" json:"login_at"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user