From 55708518210d5b9ee3973c135b0602a2fb4ca2ca Mon Sep 17 00:00:00 2001 From: WorabordinC Date: Sun, 31 Mar 2024 13:18:59 +0700 Subject: [PATCH] fix sonar issues --- .../main/java/com/kampus/kbazaar/cart/CartService.java | 8 +------- .../com/kampus/kbazaar/promotion/PromotionService.java | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/kbazaar/src/main/java/com/kampus/kbazaar/cart/CartService.java b/kbazaar/src/main/java/com/kampus/kbazaar/cart/CartService.java index a20372c..beb8d40 100644 --- a/kbazaar/src/main/java/com/kampus/kbazaar/cart/CartService.java +++ b/kbazaar/src/main/java/com/kampus/kbazaar/cart/CartService.java @@ -1,7 +1,6 @@ package com.kampus.kbazaar.cart; import com.kampus.kbazaar.cartitem.CartItemService; -import com.kampus.kbazaar.promotion.PromotionApplyCartRequest; import com.kampus.kbazaar.shopper.Shopper; import com.kampus.kbazaar.shopper.ShopperRepository; import java.util.List; @@ -14,11 +13,6 @@ public class CartService { private final ShopperRepository shopperRepository; - public CartResponse applyCartPromotion( - String username, PromotionApplyCartRequest promotionApplyCartRequest) { - return new CartResponse(); - } - public CartService(ShopperRepository shopperRepository, CartItemService cartItemService) { this.shopperRepository = shopperRepository; this.cartItemService = cartItemService; @@ -27,7 +21,7 @@ public CartService(ShopperRepository shopperRepository, CartItemService cartItem // get all carts public List getAllCart() { - // getb all user + // get all user List usernameList = shopperRepository.findAll().stream().map(Shopper::getUsername).toList(); diff --git a/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionService.java b/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionService.java index 39117ce..e4afa4c 100644 --- a/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionService.java +++ b/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionService.java @@ -19,8 +19,6 @@ public class PromotionService { private final CartItemService cartItemService; - private final CartRepository cartRepository; - public PromotionService( PromotionRepository promotionRepository, CartItemRepository cartItemRepository, @@ -28,7 +26,6 @@ public PromotionService( CartItemService cartItemService) { this.promotionRepository = promotionRepository; this.cartItemRepository = cartItemRepository; - this.cartRepository = cartRepository; this.cartItemService = cartItemService; } @@ -57,8 +54,6 @@ public CartResponse applyPromotion(String username, Promotion promotion) { } } - CartResponse response = cartItemService.getCartByUsername(username); - - return response; + return cartItemService.getCartByUsername(username); } }