File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464 2.2 . 2. 존재하는 상품이면 200 OK 반환
6565
6666 2.3 . 해당 상품에 대해 좋아요 등록/ 취소를 이미 했는지 확인
67- 2.3 . 1. 좋아요 등록/ 취소가 이미 이루어진 상태면 400 BAD_REQUEST 반환
68- 2.3 . 2. 좋아요 등록/ 취소가 최초이면 201 CREATED + 등록/ 취소 반영
67+ 2.3 . 1. 좋아요 등록/ 취소가 이미 이루어져 있는 경우에는 201 CREATED / 204 NO_CONTENT 반환
68+ 2.3 . 2. 좋아요 등록/ 취소가 최초이면 201 CREATED + " 좋아요 등록/취소 성공 " 반환
6969```
7070
7171> 주문 생성 및 결제 흐름 (재고 차감, 포인트 차감, 외부 시스템 연동)
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ sequenceDiagram
3737 participant LikeRepository
3838
3939 User->>LikeController: POST /likes
40- LikeController->>LikeService: cratedLike (userId, productId)
40+ LikeController->>LikeService: createLike (userId, productId)
4141
4242 %% 사용자 검증
4343 LikeService->>UserService: findUser(userId)
@@ -57,8 +57,8 @@ sequenceDiagram
5757 %% 좋아요 존재 여부 확인
5858 LikeService->>LikeRepository: findByUserIdAndProductId(userId, productId)
5959 alt 좋아요가 이미 존재하는 경우
60- LikeService-->> LikeController: 200 OK + "좋아요 등록이 되어 있는 상품입니다." 반환
61- LikeController-->> User: 200 OK
60+ LikeService-->> LikeController: 201 CREATED + "좋아요 등록이 되어 있는 상품입니다." 반환
61+ LikeController-->> User: 201 CREATED + "좋아요 등록이 되어 있는 상품입니다." 반환
6262 else 좋아요가 존재하지 않는 경우
6363 LikeService->>LikeRepository: save(like)
6464 LikeRepository-->>LikeService: Like created
@@ -77,6 +77,8 @@ sequenceDiagram
7777 actor User
7878 participant LikeController
7979 participant LikeService
80+ participant UserService
81+ participant ProductService
8082 participant LikeRepository
8183
8284 User->>LikeController: DELETE /likes/{productId}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ classDiagram
1515
1616 class Point {
1717 - Long id
18- - Long refUserId
18+ - Long userId
1919 - int balance
2020
2121 + void chargePoint(int amount)
@@ -30,7 +30,7 @@ classDiagram
3030
3131 class Product {
3232 - Long id
33- - Long refBrandId
33+ - Long brandId
3434 - String name
3535 - BigDecimal price
3636 - int stock
@@ -45,16 +45,16 @@ classDiagram
4545
4646 class Like {
4747 - Long id
48- - Long refUserId
49- - Long refProductId
48+ - Long userId
49+ - Long productId
5050
51- + static void createLike(Long userId, Long productId)
51+ + static Like createLike(Long userId, Long productId)
5252
5353 }
5454
5555 class Cart {
5656 - Long id
57- - Long refUserId
57+ - Long userId
5858
5959 + void addItemToCart(Long productId, int amount)
6060 + void deleteItemFromCart(Long productId, int amount)
@@ -63,19 +63,19 @@ classDiagram
6363 class CartItem {
6464 - Long id
6565 - String name
66- - Long refCartId
67- - Long refProductId
68- - int quantity
66+ - Long cartId
67+ - Long productId
68+ - int quantity
6969
7070 + void changeQuantity(int amount)
7171 }
7272
7373 class Order {
7474 - Long id
75- - Long refUserId
75+ - Long userId
7676 - OrderStatus status
7777
78- + void addItemToOrder(Product product , int quantity)
78+ + void addItemToOrder(Long productId , int quantity)
7979 + BigDecimal calculateTotalPrice()
8080 + void complete()
8181 + void cancel()
@@ -84,15 +84,15 @@ classDiagram
8484
8585 class OrderItem {
8686 - Long id
87- - Long refOrderId
88- - Long refProductId
87+ - Long orderId
88+ - Long productId
8989 - Integer quantity
9090 - BigDecimal orderPrice
9191 }
9292
9393 class Payment {
9494 - Long id
95- - Long refOrderId
95+ - Long orderId
9696 - BigDecimal totalPrice
9797 - PaymentStatus status
9898 - PaymentMethod method
You can’t perform that action at this time.
0 commit comments