From 28055e99c9a6796f90c77a9e6a68116f8135757c Mon Sep 17 00:00:00 2001 From: Echo <1711788888@qq.com> Date: Mon, 11 Dec 2023 18:56:19 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/v1/system/enter.go | 2 ++ initialize/router.go | 1 + model/app/response/user.go | 9 ++++++++- oauth2/handle/oauth2.go | 3 +++ router/app/vision.go | 2 +- service/system/enter.go | 1 + 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/api/v1/system/enter.go b/api/v1/system/enter.go index 61a3d41..7cbc229 100644 --- a/api/v1/system/enter.go +++ b/api/v1/system/enter.go @@ -22,6 +22,7 @@ type ApiGroup struct { HospitalApi ArticleApi AiKefulApi + PosterApi } var ( @@ -45,4 +46,5 @@ var ( bannerService = service.ServiceGroupApp.SystemServiceGroup.BannerService articleService = service.ServiceGroupApp.SystemServiceGroup.ArticleService aiKefuService = service.ServiceGroupApp.SystemServiceGroup.AiKefuService + posterService = service.ServiceGroupApp.SystemServiceGroup.PosterService ) diff --git a/initialize/router.go b/initialize/router.go index a716b56..983511e 100644 --- a/initialize/router.go +++ b/initialize/router.go @@ -84,6 +84,7 @@ func Routers() *gin.Engine { systemRouter.InitBannerRouter(PublicGroup) // banner路由 systemRouter.InitArticleRouter(PublicGroup) // 文章路由 systemRouter.InitAiKefuRouterRouter(PrivateGroup) // AI客服路由 + systemRouter.InitPosterRouter(PublicGroup) // 海报路由 } diff --git a/model/app/response/user.go b/model/app/response/user.go index 93519b5..ea5373b 100644 --- a/model/app/response/user.go +++ b/model/app/response/user.go @@ -25,12 +25,15 @@ type UserVO struct { Username string `json:"username"` Phone string `json:"phone"` Status constant.UserStatus `json:"status"` - Birthday string `json:"birthday"` Avatar string `json:"avatar"` LastLoginAt *types.DateTime `json:"lastLoginAt"` LastLoginIp *string `json:"lastLoginIp"` CreatedAt types.DateTime `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:手术时间"` } func (auv *UserVO) ParseOrdinary(u app.User) { @@ -41,6 +44,10 @@ func (auv *UserVO) ParseOrdinary(u app.User) { auv.LastLoginAt = u.LastLoginAt auv.Avatar = u.Avatar auv.CreatedAt = types.DateTime(u.CreatedAt) + auv.IsSurgery = u.IsSurgery + auv.IsInfo = u.IsInfo + auv.HospitalId = u.HospitalId + auv.SurgeryTime = u.SurgeryTime if u.IsSurgery == 1 { auv.TimeNote = "距离下次复查时间还剩:" diff --git a/oauth2/handle/oauth2.go b/oauth2/handle/oauth2.go index 2dd0a95..9844039 100644 --- a/oauth2/handle/oauth2.go +++ b/oauth2/handle/oauth2.go @@ -113,6 +113,9 @@ func ExtensionFields(ti oauth2.TokenInfo) (fieldsValue map[string]any) { fieldsValue["userId"] = userInfo.ID fieldsValue["avatar"] = userInfo.Avatar fieldsValue["TimeNote"] = userInfo.Avatar + fieldsValue["IsSurgery"] = userInfo.IsSurgery + fieldsValue["HospitalId"] = userInfo.HospitalId + fieldsValue["IsInfo"] = userInfo.IsInfo return } diff --git a/router/app/vision.go b/router/app/vision.go index 9e24e39..e218d89 100644 --- a/router/app/vision.go +++ b/router/app/vision.go @@ -13,7 +13,7 @@ func (s *VisionRouter) InitVisionRouter(Router *gin.RouterGroup) { //publicRouter := Router.Group("user") baseApi := v1.ApiGroupApp.AppApiGroup.VisionApi { - userRouter.GET("", baseApi.GetList) + userRouter.GET("list", baseApi.GetList) userRouter.POST("", baseApi.Create) } diff --git a/service/system/enter.go b/service/system/enter.go index d340f84..2a329a3 100644 --- a/service/system/enter.go +++ b/service/system/enter.go @@ -21,4 +21,5 @@ type ServiceGroup struct { BannerService ArticleService AiKefuService + PosterService }