Skip to content

Commit

Permalink
Fix/新增背景图片url字段 (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
Love-YeLin authored Apr 15, 2024
1 parent 28d0ba8 commit 077cb16
Show file tree
Hide file tree
Showing 8 changed files with 815 additions and 796 deletions.
1,553 changes: 787 additions & 766 deletions biz/application/dto/cloudmind/core_api/content.pb.go

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions biz/application/service/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ var CommentServiceSet = wire.NewSet(
)

type CommentService struct {
Config *config.Config
Platform platformservice.IPlatForm
CommentDomainService service.ICommentDomainService
Config *config.Config
Platform platformservice.IPlatForm
CommentDomainService service.ICommentDomainService
RelationDomainService service.RelationDomainService
}

func (s *CommentService) GetComment(ctx context.Context, req *core_api.GetCommentReq) (resp *core_api.GetCommentResp, err error) {
Expand Down Expand Up @@ -234,6 +235,7 @@ func (s *CommentService) CreateComment(ctx context.Context, req *core_api.Create
return resp, err
}
resp.CommentId = res.CommentId

return resp, nil
}

Expand Down
11 changes: 0 additions & 11 deletions biz/application/service/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,6 @@ func (s *FileService) GetPublicFiles(ctx context.Context, req *core_api.GetPubli
}, func() error {
s.FileDomainService.LoadCollectCount(ctx, file.FileCount, item.FileId) // 收藏量
return nil
}, func() error {
if err2 := s.RelationDomainService.CreateRelation(ctx, &core_api.Relation{
FromType: core_api.TargetType_UserType,
FromId: userData.UserId,
ToType: core_api.TargetType_FileType,
ToId: item.FileId,
RelationType: core_api.RelationType_ViewRelationType,
}); err2 != nil {
return err2
}
return nil
})
return file
})
Expand Down
4 changes: 4 additions & 0 deletions biz/application/service/recommend.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func (s *RecommendService) GetItemByItemId(ctx context.Context, userId string, c
return err
}
case core_api.Category_FileCategory:

case core_api.Category_PostCategory:
getPostsResp, err := s.CloudMindContent.GetPostsByPostIds(ctx, &content.GetPostsByPostIdsReq{
PostIds: itemIds,
Expand All @@ -221,6 +222,9 @@ func (s *RecommendService) GetItemByItemId(ctx context.Context, userId string, c
}, func() error {
s.PostDomainService.LoadCommentCount(ctx, &recommends.Posts[i].CommentCount, post.PostId) // 评论量
return nil
}, func() error {
s.PostDomainService.LoadViewCount(ctx, &recommends.Posts[i].ViewCount, post.PostId) // 浏览量
return nil
}, func() error {
s.PostDomainService.LoadLiked(ctx, &recommends.Posts[i].Liked, userId, post.PostId)
return nil
Expand Down
30 changes: 16 additions & 14 deletions biz/application/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ func (s *UserService) GetUser(ctx context.Context, req *core_api.GetUserReq) (re
return resp, err
}
resp = &core_api.GetUserResp{
UserId: req.UserId,
Name: getUserResp.Name,
Url: getUserResp.Url,
Description: getUserResp.Description,
Sex: getUserResp.Sex,
CreateTime: getUserResp.CreateTime,
UserId: req.UserId,
Name: getUserResp.Name,
Url: getUserResp.Url,
Description: getUserResp.Description,
Sex: getUserResp.Sex,
CreateTime: getUserResp.CreateTime,
BackgroundUrl: getUserResp.BackgroundUrl,
}
if err = mr.Finish(func() error {
s.UserDomainService.LoadLabel(ctx, getUserResp.Labels)
Expand Down Expand Up @@ -128,14 +129,15 @@ func (s *UserService) UpdateUser(ctx context.Context, req *core_api.UpdateUserRe
}

if _, err = s.CloudMindContent.UpdateUser(ctx, &content.UpdateUserReq{
UserId: userData.UserId,
Name: req.Name,
Sex: req.Sex,
FullName: req.FullName,
IdCard: req.IdCard,
Description: req.Description,
Labels: req.LabelIds,
Url: req.Url,
UserId: userData.UserId,
Name: req.Name,
Sex: req.Sex,
FullName: req.FullName,
IdCard: req.IdCard,
Description: req.Description,
Labels: req.LabelIds,
Url: req.Url,
BackgroundUrl: req.BackgroundUrl,
}); err != nil {
return resp, err
}
Expand Down
1 change: 0 additions & 1 deletion biz/domain/service/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ func (s *RelationDomainService) CreateRelation(ctx context.Context, r *core_api.
if err != nil {
return err
}

if !ok.Ok {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/CloudStriver/cloudmind-mq v1.0.12-0.20240406143558-b7090c0fbb80
github.com/CloudStriver/go-pkg v0.0.0-20240329084540-20ca37a52fea
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240414104057-eaf6315cb043
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240415063135-d3955d0682e0
github.com/bytedance/sonic v1.10.2
github.com/cloudwego/hertz v0.7.3
github.com/golang-jwt/jwt/v4 v4.5.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ github.com/CloudStriver/service-idl-gen-go v0.0.0-20240414082236-a2f4391d68a2 h1
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240414082236-a2f4391d68a2/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240414104057-eaf6315cb043 h1:l6TWqGYAQVmWoWAmCywgKxw0lOi+p++pWiCkDIsXaNU=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240414104057-eaf6315cb043/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240415063135-d3955d0682e0 h1:daaQ68hELBrjQW++Sw2ztgqr61FVhtJBjT0UI74CAhk=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240415063135-d3955d0682e0/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
Expand Down

0 comments on commit 077cb16

Please sign in to comment.