47 lines
1.0 KiB
Go
47 lines
1.0 KiB
Go
package dto
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type GetProductRequestDTO struct {
|
|
ProductID int `json:"product_id"`
|
|
}
|
|
|
|
type GetProductResponseDTO 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 GetProductListRequestDTO struct {
|
|
CategoryID int `json:"category_id"`
|
|
}
|
|
|
|
type GetProductListResponseDTO struct {
|
|
Products []GetProductResponseDTO `json:"products"`
|
|
}
|
|
|
|
type AddProductToBasketRequestDTO struct {
|
|
ProductID int `json:"product_id"`
|
|
Quantity int `json:"quantity"`
|
|
}
|
|
|
|
type AddProductToBasketResponseDTO struct {
|
|
ProductID int `json:"product_id"`
|
|
BasketID string `json:"basket_id"`
|
|
}
|
|
|
|
type RemoveProductFromBasketRequestDTO struct {
|
|
ProductID int `json:"product_id"`
|
|
Quantity int `json:"quantity"`
|
|
}
|
|
|
|
type RemoveProductFromBasketResponseDTO struct {
|
|
ProductID int `json:"product_id"`
|
|
BasketID string `json:"basket_id"`
|
|
}
|