Skip to content

Commit

Permalink
fix: 修复BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansongxx committed Apr 16, 2024
1 parent d01926a commit 725a110
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion biz/application/service/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (s *PostService) GetPost(ctx context.Context, req *core_api.GetPostReq) (re
}

if err = mr.Finish(func() error {
s.PostDomainService.LoadAuthor(ctx, resp.Author, res.UserId) // 作者
s.PostDomainService.LoadAuthor(ctx, resp.Author, userData.GetUserId()) // 作者
return nil
}, func() error {
s.PostDomainService.LoadLikeCount(ctx, &resp.LikeCount, req.PostId) // 点赞量
Expand Down
6 changes: 3 additions & 3 deletions biz/domain/service/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (s *PostDomainService) LoadAuthor(ctx context.Context, user *core_api.PostU
RelationFilterOptions: &platform.GetRelationCountReq_ToFilterOptions{
ToFilterOptions: &platform.ToFilterOptions{
ToType: int64(core_api.TargetType_UserType),
ToId: userId,
ToId: user.UserId,
FromType: int64(core_api.TargetType_UserType),
},
},
Expand All @@ -101,7 +101,7 @@ func (s *PostDomainService) LoadAuthor(ctx context.Context, user *core_api.PostU
}, func() error {
getRelationPathsCountResp, err := s.Platform.GetRelationPathsCount(ctx, &platform.GetRelationPathsCountReq{
FromType1: int64(core_api.TargetType_UserType),
FromId1: userId,
FromId1: user.UserId,
FromType2: int64(core_api.TargetType_UserType),
EdgeType1: int64(core_api.RelationType_PublishRelationType),
EdgeType2: int64(core_api.RelationType_LikeRelationType),
Expand Down Expand Up @@ -132,7 +132,7 @@ func (s *PostDomainService) LoadAuthor(ctx context.Context, user *core_api.PostU
RelationFilterOptions: &platform.GetRelationCountReq_FromFilterOptions{
FromFilterOptions: &platform.FromFilterOptions{
ToType: int64(core_api.TargetType_PostType),
FromId: userId,
FromId: user.UserId,
FromType: int64(core_api.TargetType_UserType),
},
},
Expand Down

0 comments on commit 725a110

Please sign in to comment.