diff --git a/app/svc/friend_circle/svc_firend_circle.go b/app/svc/friend_circle/svc_firend_circle.go index e99f110..ae401ee 100644 --- a/app/svc/friend_circle/svc_firend_circle.go +++ b/app/svc/friend_circle/svc_firend_circle.go @@ -9,6 +9,7 @@ import ( "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "code.fnuoos.com/EggPlanet/egg_system_rules.git/md" md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" + svc3 "code.fnuoos.com/EggPlanet/egg_system_rules.git/svc" "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es" "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" "context" @@ -114,6 +115,11 @@ func MySelfList(c *gin.Context, req friend_circles.MySelfListReq) (resp friend_c return } doc.CircleIndexId = hit.Id + likeId := svc3.GetEggFriendCircleLikeEsIndexId(user.Id, hit.Index) + likeDoc, _ := es.FirstDoc(md.EggFriendCircleLikeEsAlias, likeId) + if likeDoc.Found { // 表示已点赞 + doc.IsLike = true + } resp.List = append(resp.List, doc) } @@ -202,6 +208,8 @@ func CommentList(req friend_circles.CommentListReq) (resp friend_circles.Comment doc.NickName = user.Nickname doc.AvatarUrl = user.AvatarUrl doc.CommentIndexId = hit.Id + isLike, _ := GetUserWithCommentLike(hit.Index, doc.Uid) + doc.IsLike = isLike resp.List = append(resp.List, doc) }