This repository was archived by the owner on Aug 13, 2022. It is now read-only.
[#29] 카페 오픈, 마감 기능 구현#42
Open
nicky-day wants to merge 6 commits into
Open
Conversation
Collaborator
Author
|
카페 등록하기 기능 수정 merge 이후에 다시 git rebase 하겠습니다.
|
|
|
||
| @PatchMapping("/{cafeId}") | ||
| public ResponseEntity updateCafe(@PathVariable long cafeId, | ||
| public ResponseEntity updateCafe(@PathVariable Long cafeId, |
Collaborator
There was a problem hiding this comment.
wrapper type 으로 변경한 이유가 있을까요?
| return ResponseEntity.ok(cafeDTO); | ||
| } | ||
|
|
||
| @PatchMapping("/{cafeId}/open") |
Collaborator
There was a problem hiding this comment.
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(); |
Comment on lines
+81
to
+90
| <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> |
Collaborator
There was a problem hiding this comment.
두개의 쿼리가 동일한것으로 보이는데 sql 은 하나로 하고 사용시 condition을 주는 방식으로 구현할수 있을것 같습니다.
Collaborator
|
충돌 해결 및 comment 확인 해주세요~ |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #29
개요
작업사항