Refactoring

This commit is contained in:
Piotr Biernat
2024-12-06 16:44:42 +01:00
parent 2cf4d4c25d
commit 5a5f643be8
18 changed files with 62 additions and 66 deletions

View File

@@ -4,11 +4,11 @@ import (
"time"
)
type GetProductRequest struct {
type GetProductRequestDTO struct {
ProductID int `json:"product_id"`
}
type GetProductResponse struct {
type GetProductResponseDTO struct {
ID int `json:"id"`
PID string `json:"pid"`
Name string `json:"name"`
@@ -17,30 +17,30 @@ type GetProductResponse struct {
UpdatedAt time.Duration `json:"updated_at,omitempty"`
}
type GetProductListRequest struct {
type GetProductListRequestDTO struct {
CategoryID int `json:"category_id"`
}
type GetProductListResponse struct {
Products []GetProductResponse `json:"products"`
type GetProductListResponseDTO struct {
Products []GetProductResponseDTO `json:"products"`
}
type AddProductToBasketRequest struct {
type AddProductToBasketRequestDTO struct {
ProductID int `json:"product_id"`
Quantity int `json:"quantity"`
}
type AddProductToBasketResponse struct {
type AddProductToBasketResponseDTO struct {
ProductID int `json:"product_id"`
BasketID string `json:"basket_id"`
}
type RemoveProductFromBasketRequest struct {
type RemoveProductFromBasketRequestDTO struct {
ProductID int `json:"product_id"`
Quantity int `json:"quantity"`
}
type RemoveProductFromBasketResponse struct {
type RemoveProductFromBasketResponseDTO struct {
ProductID int `json:"product_id"`
BasketID string `json:"basket_id"`
}