-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE] issue195: 리뷰 수정 및 삭제 #198
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6732515
test: 내가 작성한 리뷰 삭제하는 인수 테스트 작성
sc0116 e0bed44
feat: 내가 작성하지 않은 리뷰 삭제 시 예외 처리 구현
sc0116 e32e340
refactor: 리뷰 삭제 시 리뷰 Id로만 리뷰 불러오도록 수정
sc0116 87d6bd6
test: 내가 작성한 리뷰 수정하는 인수 테스트 작성
sc0116 715422f
feat: 내가 작성하지 않은 리뷰 수정 시 예외 처리 구현
sc0116 7699405
Merge branch 'develop' into feat/195-update-or-delete-review
sc0116 0a7f7a0
test: 리뷰 관련 테스트 추가
sc0116 c28ab23
test: 리뷰 관련 테스트 수정
sc0116 9761e1d
test: 리뷰 수정 및 삭제 REST Docs 테스트 추가
sc0116 b5588dc
feat: 인증 관련 설정
sc0116 df6ac53
chore: develop merge 충돌 해결
sc0116 1507f98
test: 리뷰 수정 및 삭제 인수테스트 추가
sc0116 c93db00
feat: 리뷰 삭제 시 Soft Delete로 변경 및 테스트 추가
sc0116 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,10 @@ public class AuthRequestMatchConfig { | |
@Bean | ||
public AuthenticationRequestMatcher authenticationRequestMatcher() { | ||
return new AuthenticationRequestMatcherBuilder() | ||
.addUpAuthenticationPath(HttpMethod.POST, "/api/studies", "/api/studies/\\d+/reviews") | ||
.addUpAuthenticationPath(HttpMethod.POST, "/api/studies", "/api/studies/\\d+/reviews", "/api/studies/\\d+/reviews/\\d+") | ||
.addUpAuthenticationPath(HttpMethod.GET, "/api/my/studies") | ||
.addUpAuthenticationPath(HttpMethod.PUT, "/api/studies/\\d+/reviews/\\d+") | ||
.addUpAuthenticationPath(HttpMethod.DELETE, "/api/studies/\\d+/reviews/\\d+") | ||
Comment on lines
-17
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 중복된 URL이 너무 많은데 어떻게 하면 중복을 최대한 없앨 수 있을지 addUpAuthenticationPath의 시그니처를 변경해서 생각해보면 좋을 것 같아요. |
||
.build(); | ||
} | ||
} |
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
7 changes: 5 additions & 2 deletions
7
backend/src/main/java/com/woowacourse/moamoa/review/domain/repository/ReviewRepository.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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package com.woowacourse.moamoa.review.domain.repository; | ||
|
||
import com.woowacourse.moamoa.review.domain.AssociatedStudy; | ||
import com.woowacourse.moamoa.review.domain.Review; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface ReviewRepository { | ||
|
||
Review save(Review review); | ||
|
||
Optional<Review> findById(Long id); | ||
|
||
void deleteById(Long id); | ||
} |
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
10 changes: 10 additions & 0 deletions
10
...rc/main/java/com/woowacourse/moamoa/review/service/exception/ReviewNotFoundException.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,10 @@ | ||
package com.woowacourse.moamoa.review.service.exception; | ||
|
||
import com.woowacourse.moamoa.common.exception.NotFoundException; | ||
|
||
public class ReviewNotFoundException extends NotFoundException { | ||
|
||
public ReviewNotFoundException() { | ||
super("후기를 찾을 수 없습니다."); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...c/main/java/com/woowacourse/moamoa/review/service/exception/UnwrittenReviewException.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,10 @@ | ||
package com.woowacourse.moamoa.review.service.exception; | ||
|
||
import com.woowacourse.moamoa.common.exception.BadRequestException; | ||
|
||
public class UnwrittenReviewException extends BadRequestException { | ||
public UnwrittenReviewException() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 한 칸 띄어도 될 것 같아요 |
||
|
||
super("내가 작성한 후기가 아닙니다."); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...end/src/main/java/com/woowacourse/moamoa/review/service/request/EditingReviewRequest.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,15 @@ | ||
package com.woowacourse.moamoa.review.service.request; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Getter | ||
public class EditingReviewRequest { | ||
|
||
@NotBlank(message = "내용을 입력해 주세요.") | ||
private String content; | ||
} |
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
Oops, something went wrong.
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.
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.
👍