🐛 fix bug
This commit is contained in:
@@ -4,11 +4,11 @@ import "miniapp/global"
|
||||
|
||||
type Favorite struct {
|
||||
global.GVA_MODEL
|
||||
UserId int `json:"userId" gorm:"not null;column:user_id;comment:'用户id'"` // 用户id
|
||||
WzId int `json:"wzId" gorm:"not null;comment:收藏id"` // 收藏id
|
||||
Cover string `json:"cover" gorm:"size:50;comment:封面"`
|
||||
Titte string `json:"title" comment:"收藏商品名称"` // 收藏商品名称
|
||||
Introduction string `json:"introduction" comment:"简介"` // 简介
|
||||
UserId int `json:"userId" form:"userId" gorm:"not null;column:user_id;comment:'用户id'"` // 用户id
|
||||
WzId int `json:"wzId" form:"wzId" gorm:"not null;comment:收藏id"` // 收藏id
|
||||
Cover string `json:"cover" form:"cover" gorm:"comment:封面"`
|
||||
Titte string `json:"title" form:"title" comment:"收藏商品名称"` // 收藏商品名称
|
||||
Introduction string `json:"introduction" form:"introduction" comment:"简介"` // 简介
|
||||
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,6 @@ package request
|
||||
import (
|
||||
"miniapp/model/common/constant"
|
||||
"miniapp/model/common/request"
|
||||
"miniapp/model/types"
|
||||
)
|
||||
|
||||
type BindingWeChat struct {
|
||||
@@ -47,8 +46,8 @@ type SaveUser struct {
|
||||
}
|
||||
|
||||
type ChangeUserHospital struct {
|
||||
UserId int `json:"userId" form:"userId" binding:"required"` // 用户ID
|
||||
HospitalId int `json:"hospitalId" form:"hospitalId" binding:"required"` // 医院ID
|
||||
IsSurgery int `json:"isSurgery" form:"isSurgery"` // 是否已经手术 0未手术 1已手术
|
||||
SurgeryTime *types.DateTime `json:"surgeryTime" form:"surgeryTime"` // 手术时间
|
||||
UserId int `json:"userId" form:"userId" binding:"required"` // 用户ID
|
||||
HospitalId int `json:"hospitalId" form:"hospitalId" binding:"required"` // 医院ID
|
||||
IsSurgery int `json:"isSurgery" form:"isSurgery"` // 是否已经手术 0未手术 1已手术
|
||||
SurgeryTime string `json:"surgery_time" form:"surgery_time"` // 手术时间
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -3,7 +3,7 @@ package app
|
||||
import (
|
||||
"miniapp/global"
|
||||
"miniapp/model/common/constant"
|
||||
"miniapp/model/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@@ -17,8 +17,8 @@ type User struct {
|
||||
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:手术时间"`
|
||||
LastLoginAt *types.DateTime `json:"last_login_at" gorm:"comment:'最后登录时间'"`
|
||||
SurgeryTime time.Time `json:"surgery_time" gorm:"comment:手术时间"`
|
||||
LastLoginAt *time.Time `json:"last_login_at" gorm:"comment:'最后登录时间'"`
|
||||
}
|
||||
|
||||
func (User) TableName() string {
|
||||
|
@@ -6,7 +6,7 @@ type Article struct {
|
||||
global.GVA_MODEL
|
||||
Title string `json:"title" form:"title" gorm:"column:title;comment:标题;type:varchar(255);size:255;"`
|
||||
Content string `json:"content" form:"content" gorm:"column:content;comment:内容;type:longtext;"`
|
||||
CoverImg string `json:"cover_img" form:"coverImg" gorm:"column:cover_img;comment:封面图;type:varchar(255);size:255;"`
|
||||
CoverImg string `json:"cover_img" form:"coverImg" gorm:"column:cover_img;comment:封面图;"`
|
||||
ReadingNum int `json:"reading_num" form:"reading_num" gorm:"column:reading_num;comment:阅读量;type:int;size:10;"`
|
||||
IsFavorite int `json:"is_favorite" form:"is_favorite" gorm:"column:is_favorite;comment:是否收藏;type:int;size:10;"`
|
||||
}
|
||||
|
@@ -4,8 +4,9 @@ import "miniapp/global"
|
||||
|
||||
type Notes struct {
|
||||
global.GVA_MODEL
|
||||
Content string `json:"content" form:"content" gorm:"comment:注意事项内容;"`
|
||||
NotesTime string `json:"notes_time" form:"notes_time" gorm:"comment:注意事项时间;"` //手术前、手术后、术中
|
||||
Content string `json:"content" form:"content" gorm:"comment:注意事项内容;"`
|
||||
NotesTime string `json:"notes_time" form:"notes_time" gorm:"comment:注意事项时间;"` //手术前、手术后、术中
|
||||
NotestimeNum int `json:"notes_time_num" form:"notes_time_num" gorm:"comment:注意事项时间;"` //手术前、手术后、术中
|
||||
}
|
||||
|
||||
func (n Notes) TableName() string {
|
||||
|
6
model/common/request/hospital.go
Normal file
6
model/common/request/hospital.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package request
|
||||
|
||||
type GetHospitalNotes struct {
|
||||
HospitalId int `json:"hospitalId" form:"hospitalId" binding:"required"`
|
||||
TimeNum int `json:"timeNum" form:"timeNum" binding:"required"`
|
||||
}
|
6
model/common/request/notes.go
Normal file
6
model/common/request/notes.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package request
|
||||
|
||||
type GetUserNotes struct {
|
||||
UserId string `json:"userId" form:"userId" binding:"required"`
|
||||
IsFinish string `json:"isFinish" form:"isFinish" binding:"required"`
|
||||
}
|
Reference in New Issue
Block a user