Skip to content

Commit

Permalink
[feature] add dynamic_id_str
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrie committed Jan 27, 2023
1 parent ec5df33 commit 981b81e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions internal/app/api/idl/bilibili_picture.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ type BilibiliPictureRandomResp struct {
DynamicURL string `json:"dynamic_url"`
}
type BilibiliDynamicDTO struct {
DynamicID uint64 `json:"dynamic_id"`
Pictures BilibiliDynamicPictures `json:"pictures"`
SentAt uint64 `json:"sent_at"`
DynamicID uint64 `json:"dynamic_id"`
Pictures BilibiliDynamicPictures `json:"pictures"`
SentAt uint64 `json:"sent_at"`
DynamicIDStr string `json:"dynamic_id_str"`
}
type BilibiliRandomPictures []BilibiliRandomPicture
type BilibiliRandomPicture struct {
Expand Down
14 changes: 8 additions & 6 deletions internal/app/api/service/bilbil_picture.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ func (service *BilbilPicture) Latest(ctx context.Context, req idl.BilibiliPictur
}
for i := range list {
resp.Result = append(resp.Result, &idl.BilibiliDynamicDTO{
DynamicID: list[i].DynamicID,
Pictures: list[i].Pictures,
SentAt: list[i].SentAt,
DynamicID: list[i].DynamicID,
Pictures: list[i].Pictures,
SentAt: list[i].SentAt,
DynamicIDStr: fmt.Sprintf("%d", list[i].DynamicID),
})
}
return &resp, nil
Expand All @@ -147,9 +148,10 @@ func (service *BilbilPicture) Recommend(ctx context.Context, req idl.BilibiliPic
}
for i := range list {
resp.Result = append(resp.Result, &idl.BilibiliDynamicDTO{
DynamicID: list[i].DynamicID,
Pictures: list[i].Pictures,
SentAt: list[i].SentAt,
DynamicID: list[i].DynamicID,
Pictures: list[i].Pictures,
SentAt: list[i].SentAt,
DynamicIDStr: fmt.Sprintf("%d", list[i].DynamicID),
})
}
return &resp, nil
Expand Down

0 comments on commit 981b81e

Please sign in to comment.