From f130eaedd7749beef01eff292a9b38a7a878d559 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Tue, 24 Dec 2024 17:59:01 +0100 Subject: [PATCH] API Basket update --- api/basket.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/basket.go b/api/basket.go index 80a096d..32a55e8 100644 --- a/api/basket.go +++ b/api/basket.go @@ -3,7 +3,8 @@ package api import ( "fmt" - def "git.pbiernat.io/egommerce/api-entities/http" + "git.ego.cloudns.be/egommerce/api-entities/basket" + basket "git.ego.cloudns.be/egommerce/api-entities/basket/dto" "github.com/go-redis/redis/v8" ) @@ -15,9 +16,9 @@ type BasketAPI struct { httpClient *HttpClient } -func (a *BasketAPI) GetBasket(basketID string) (*def.GetBasketResponse, error) { - req := &def.GetBasketRequest{BasketID: basketID} - res := new(def.GetBasketResponse) +func (a *BasketAPI) GetBasket(basketID string) (*basket.GetBasketResponseDTO, error) { + req := &basket.GetBasketRequestDTO{BasketID: basketID} + res := new(basket.GetBasketResponse) if err := a.httpClient.SendGet("basket-svc", "/api/v1/basket", req, res); err != nil { return nil, err } @@ -25,9 +26,9 @@ func (a *BasketAPI) GetBasket(basketID string) (*def.GetBasketResponse, error) { return res, nil } -func (a *BasketAPI) GetBasketItems(basketID string) ([]*def.GetBasketItemsResponse, error) { +func (a *BasketAPI) GetBasketItems(basketID string) ([]*basket.GetBasketItemsResponseDTO, error) { url := fmt.Sprintf("/api/v1/basket/%s/items", basketID) - var res []*def.GetBasketItemsResponse + var res []*basket.GetBasketItemsResponseDTO if err := a.httpClient.SendGet("basket-svc", url, nil, &res); err != nil { return nil, err }