Skip to content

Commit

Permalink
feat: plan优化
Browse files Browse the repository at this point in the history
  • Loading branch information
Cbgogogog committed Dec 3, 2023
1 parent 3f0d231 commit 2ac2c54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions biz/application/service/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,19 @@ func (s *PlanService) ListDonateByUser(ctx context.Context, req *content.ListDon
if p.LastToken != nil {
resp.Token = *p.LastToken
}
resp.Plans = make([]*content.Plan, 0)
resp.Donations = make([]*content.Donation, 0)
for _, v := range data {
temp := &content.Plan{}
temp.Id = v.PlanId
plan_, err := s.PlanMongoMapper.FindOne(ctx, v.PlanId)
if err == nil {
temp = convertor.ConvertPlan(plan_)
}
temp.DonateNum = v.FishNum
temp.DonateTime = v.CreateAt.Unix()
resp.Plans = append(resp.Plans, temp)
resp.Donations = append(resp.Donations, &content.Donation{
Plan: temp,
DonateTime: v.CreateAt.Unix(),
DonateNum: v.FishNum,
})
}
return resp, nil
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/mitchellh/mapstructure v1.1.2
github.com/samber/lo v1.38.1
github.com/xh-polaris/gopkg v0.0.0-20231013165226-76f4d7108b9d
github.com/xh-polaris/service-idl-gen-go v0.0.0-20231202185651-ef33c5b2abe5
github.com/xh-polaris/service-idl-gen-go v0.0.0-20231203035520-2efab6c40c89
github.com/zeromicro/go-zero v1.6.0
go.mongodb.org/mongo-driver v1.12.1
google.golang.org/grpc v1.59.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
github.com/xh-polaris/gopkg v0.0.0-20231013165226-76f4d7108b9d h1:YnQOM/FdJQFfQ2aZyeeXyDvqQBm8eETXFiXWBhaaB10=
github.com/xh-polaris/gopkg v0.0.0-20231013165226-76f4d7108b9d/go.mod h1:eFkuwj6uq1k4hbDa66TijCWGL4PrNeWaNmAnxfWDeU0=
github.com/xh-polaris/service-idl-gen-go v0.0.0-20231202185651-ef33c5b2abe5 h1:R1cV669sOfg8E0JGnJk+7MObPkgmMEpu45ed6hyfrnI=
github.com/xh-polaris/service-idl-gen-go v0.0.0-20231202185651-ef33c5b2abe5/go.mod h1:KjBt4ZOfugCsdAbFlrniKMDrpJAJobm8KEezTvKVnJM=
github.com/xh-polaris/service-idl-gen-go v0.0.0-20231203035520-2efab6c40c89 h1:CmeHcj4depCNxR2W8F/WYmJSB1ABs8NEGsdTi1mOJXI=
github.com/xh-polaris/service-idl-gen-go v0.0.0-20231203035520-2efab6c40c89/go.mod h1:KjBt4ZOfugCsdAbFlrniKMDrpJAJobm8KEezTvKVnJM=
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk=
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4=
Expand Down

0 comments on commit 2ac2c54

Please sign in to comment.