🎨 优化部分接口

master
loser 9 months ago
parent c804986a68
commit 28055e99c9

@ -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
)

@ -84,6 +84,7 @@ func Routers() *gin.Engine {
systemRouter.InitBannerRouter(PublicGroup) // banner路由
systemRouter.InitArticleRouter(PublicGroup) // 文章路由
systemRouter.InitAiKefuRouterRouter(PrivateGroup) // AI客服路由
systemRouter.InitPosterRouter(PublicGroup) // 海报路由
}

@ -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 = "距离下次复查时间还剩:"

@ -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
}

@ -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)
}

@ -21,4 +21,5 @@ type ServiceGroup struct {
BannerService
ArticleService
AiKefuService
PosterService
}

Loading…
Cancel
Save