This commit is contained in:
yanghao05
2025-04-29 10:15:36 +08:00
parent 75e39a0283
commit da8ad94eda
9 changed files with 232 additions and 35 deletions

View File

@@ -66,6 +66,7 @@ func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *Li
})
return PostItem{
ID: item.ID,
Title: item.Title,
Description: item.Description,
Price: item.Price,
@@ -84,6 +85,7 @@ func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *Li
}
type PostItem struct {
ID int64 `json:"id"`
Bought bool `json:"bought"`
Title string `json:"title"`
Description string `json:"description"`
@@ -127,6 +129,7 @@ func (ctl *posts) Show(ctx fiber.Ctx, id int64, user *model.Users) (*PostItem, e
})
return &PostItem{
ID: post.ID,
Title: post.Title,
Description: post.Description,
Content: post.Content,