Restructurization
This commit is contained in:
46
catalog/dto/dto.go
Normal file
46
catalog/dto/dto.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package catalog
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type GetProductRequest struct {
|
||||
ProductID int `json:"product_id"`
|
||||
}
|
||||
|
||||
type GetProductResponse struct {
|
||||
ID int `json:"id"`
|
||||
PID string `json:"pid"`
|
||||
Name string `json:"name"`
|
||||
Price float64 `json:"price"`
|
||||
CreatedAt time.Duration `json:"created_at"`
|
||||
UpdatedAt time.Duration `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
type GetProductListRequest struct {
|
||||
CategoryID int `json:"category_id"`
|
||||
}
|
||||
|
||||
type GetProductListResponse struct {
|
||||
Products []GetProductResponse `json:"products"`
|
||||
}
|
||||
|
||||
type AddProductToBasketRequest struct {
|
||||
ProductID int `json:"product_id"`
|
||||
Quantity int `json:"quantity"`
|
||||
}
|
||||
|
||||
type AddProductToBasketResponse struct {
|
||||
ProductID int `json:"product_id"`
|
||||
BasketID string `json:"basket_id"`
|
||||
}
|
||||
|
||||
type RemoveProductFromBasketRequest struct {
|
||||
ProductID int `json:"product_id"`
|
||||
Quantity int `json:"quantity"`
|
||||
}
|
||||
|
||||
type RemoveProductFromBasketResponse struct {
|
||||
ProductID int `json:"product_id"`
|
||||
BasketID string `json:"basket_id"`
|
||||
}
|
||||
Reference in New Issue
Block a user