-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
211cd79
commit a262bd7
Showing
6 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.kampus.kbazaar.cart; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import java.io.Serializable; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Embeddable | ||
public class CartId implements Serializable { | ||
private Long shopper_id; | ||
private Long product_id; | ||
|
||
public CartId(Long shopper_id, Long product_id) { | ||
this.shopper_id = shopper_id; | ||
this.product_id = product_id; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
kbazaar/src/main/java/com/kampus/kbazaar/cart/CartRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.kampus.kbazaar.cart; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface CartRepository extends JpaRepository<Cart, CartId> { | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
kbazaar/src/main/java/com/kampus/kbazaar/cart/CartService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.kampus.kbazaar.cart; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class CartService { | ||
private CartRepository cartRepository; | ||
|
||
public CartService(CartRepository cartRepository) { | ||
this.cartRepository = cartRepository; | ||
} | ||
|
||
public String deleteCartItem(String username, String product_sku) { | ||
return "deleteL: " + username + product_sku; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters