Browse Source

关注列表不显示研究员头像

kobe6258 7 months ago
parent
commit
78e17c3586

+ 1 - 0
domian/financial_analyst/financial_analyst_service.go

@@ -24,6 +24,7 @@ func GetAnalystList(pageInfo page.Page) (analystsDTO []FinancialAnalystDTO, err
 	}
 	return
 }
+
 func GetAnalystById(id int) (financialAnalyst FinancialAnalystDTO, err error) {
 	analyst, err := financialAnalystDao.GetAnalystById(id)
 	if err != nil {

+ 1 - 0
routers/router.go

@@ -20,6 +20,7 @@ func init() {
 		MaxAge:           12 * time.Hour,
 	}))
 	//增加授权拦截
+
 	web.InsertFilter("*", web.BeforeRouter, middleware.AuthMiddleware())
 
 	ns := web.NewNamespace("/htapi",

+ 7 - 0
service/user/user_service.go

@@ -106,6 +106,13 @@ func GetFollowingAnalystList(userId int) (analysts []FollowAnalystDTO, err error
 		go func(followDTo *FollowAnalystDTO) {
 			defer wg.Done()
 			followDTo.NeedNotice = userService.NeedNotice(userId, followDTo.AnalystId)
+			var analystsDTO analystService.FinancialAnalystDTO
+			analystsDTO, err = analystService.GetAnalystById(followDTo.AnalystId)
+			if err != nil {
+				logger.Error("获取研究员信息失败")
+			} else {
+				followDTo.HeadImgUrl = analystsDTO.HeadImgUrl
+			}
 		}(&analysts[i])
 	}
 	wg.Wait()