🐛 fix bug

This commit is contained in:
2024-01-11 16:03:51 +08:00
parent cb7bce5cef
commit 26220f0276
21 changed files with 224 additions and 364 deletions

View File

@@ -2,10 +2,11 @@ package response
import (
"miniapp/model/app"
"miniapp/model/common"
"miniapp/model/common/constant"
"miniapp/model/types"
"miniapp/utils"
"strconv"
"time"
)
type UserItem struct {
@@ -26,14 +27,16 @@ type UserVO struct {
Phone string `json:"phone"`
Status constant.UserStatus `json:"status"`
Avatar string `json:"avatar"`
LastLoginAt *types.DateTime `json:"lastLoginAt"`
LastLoginAt *time.Time `json:"lastLoginAt"`
LastLoginIp *string `json:"lastLoginIp"`
CreatedAt types.DateTime `json:"createdAt"`
CreatedAt time.Time `json:"createdAt"`
TimeNote string `json:"timeNote"`
IsSurgery int `json:"isSurgery" gorm:"default:0;comment:是否已经手术 0未手术 1已手术"`
IsInfo int `json:"isInfo" gorm:"default:0;comment:是否已经填写信息 0未填写 1已填写"`
HospitalId int `json:"hospital_id" gorm:"comment:手术医院"`
SurgeryTime *types.DateTime `json:"surgery_time" gorm:"comment:手术时间"`
SurgeryTime time.Time `json:"surgery_time" gorm:"comment:手术时间"`
Todos []common.UserTodo `json:"todos" gorm:"comment:用户待办事项"`
Notes []common.Notes `json:"notes" gorm:"comment:用户须知"`
}
func (auv *UserVO) ParseOrdinary(u app.User) {
@@ -43,7 +46,7 @@ func (auv *UserVO) ParseOrdinary(u app.User) {
auv.Status = u.Status
auv.LastLoginAt = u.LastLoginAt
auv.Avatar = u.Avatar
auv.CreatedAt = types.DateTime(u.CreatedAt)
auv.CreatedAt = u.CreatedAt
auv.IsSurgery = u.IsSurgery
auv.IsInfo = u.IsInfo
auv.HospitalId = u.HospitalId