feat(rewards): API 返回奖品参考价字段 price_snapshot_cents

rewards 接口的 rewardItem 新增 price_snapshot_cents 字段,
将数据库中的商品价格快照(分)暴露给前端用于展示参考价。
This commit is contained in:
Zuncle 2026-03-25 22:01:28 +08:00
parent 89be01f8e3
commit be245c1476

View File

@ -25,6 +25,7 @@ type rewardItem struct {
ProductImage string `json:"product_image"`
MinScore int64 `json:"min_score"`
DropQuantity int32 `json:"drop_quantity"`
PriceSnapshotCents int64 `json:"price_snapshot_cents"` // 参考价(分)
}
type listRewardsResponse struct {
@ -132,6 +133,7 @@ func (h *handler) ListIssueRewards() core.HandlerFunc {
ProductImage: imageMap[v.ProductID],
MinScore: v.MinScore,
DropQuantity: v.DropQuantity,
PriceSnapshotCents: v.PriceSnapshotCents,
}
}
ctx.Payload(res)