-
Notifications
You must be signed in to change notification settings - Fork 4
[#29] 카페 오픈, 마감 기능 구현 #42
base: develop
Are you sure you want to change the base?
Conversation
|
카페 등록하기 기능 수정 merge 이후에 다시 git rebase 하겠습니다.
|
|
|
||
| @PatchMapping("/{cafeId}") | ||
| public ResponseEntity updateCafe(@PathVariable long cafeId, | ||
| public ResponseEntity updateCafe(@PathVariable Long cafeId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapper type 으로 변경한 이유가 있을까요?
| return ResponseEntity.ok(cafeDTO); | ||
| } | ||
|
|
||
| @PatchMapping("/{cafeId}/open") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restful 한 uri 를 설계한다고 했을때 open 이나 close 와 같은 동사를 uri 상에 표현하는것은 좋지 않습니다.
cafe 의 상태에 open, closed 를 만들고 cafe 를 업데이트 하는 형태의 uri 설계가 더 좋습니다.
| boolean openCafe = cafeService.openCafe(cafeId); | ||
| if (!openCafe) { | ||
| LOGGER.info("카페를 오픈할 수 없습니다. userId = {}, cafeId = {}", userId, cafeId); | ||
| return ResponseEntity.badRequest().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앞의 PR의 comment 참고
| <update id="openCafe"> | ||
| UPDATE CAFE | ||
| SET cafe_condition = #{cafeCondition} | ||
| WHERE cafe_id = #{cafeId} | ||
| </update> | ||
| <update id="closeCafe"> | ||
| UPDATE CAFE | ||
| SET cafe_condition = #{cafeCondition} | ||
| WHERE cafe_id = #{cafeId} | ||
| </update> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
두개의 쿼리가 동일한것으로 보이는데 sql 은 하나로 하고 사용시 condition을 주는 방식으로 구현할수 있을것 같습니다.
|
충돌 해결 및 comment 확인 해주세요~ |
Fixes #29
개요
작업사항