From 5e3b9e5d2374dd4ab7048f454c0e5af5105af02e Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Fri, 23 Dec 2022 08:37:21 +0100 Subject: [PATCH] catalog update --- http/catalog.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/http/catalog.go b/http/catalog.go index 6c60d92..52245a7 100644 --- a/http/catalog.go +++ b/http/catalog.go @@ -1,5 +1,30 @@ package http +import ( + "time" +) + +type GetProductRequest struct { + ProductID int `json:"product_id"` +} + +type GetProductResponse struct { + ID int `db:"id"` + PID string `db:"pid"` + Name string `db:"name"` + Price float64 `db:"price"` + CreatedAt time.Duration `db:"created_at"` + UpdatedAt time.Duration `db:"updated_at,omitempty"` +} + +type GetProductListRequest struct { + CategoryID int `json:"category_id"` +} + +type GetProductListResponse struct { + Products []GetProductResponse +} + type AddProductToBasketRequest struct { ProductID int `json:"product_id"` Quantity int `json:"quantity"`