-
Notifications
You must be signed in to change notification settings - Fork 1
[FEATURE] 리뷰 수정 및 삭제 #263
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
Merged
Merged
[FEATURE] 리뷰 수정 및 삭제 #263
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
780d611
feat(review): 리뷰 삭제
leebs0521 0032296
test(review): 리뷰 삭제 테스트
leebs0521 d7b65d4
feat(review): 리뷰 수정
leebs0521 c6d4f53
test(review): 리뷰 수정 테스트
leebs0521 5d1e664
refactor(review): 리뷰 조회 리팩토링
leebs0521 c9b3dee
test(review): 리뷰 조회 리팩토링 테스트
leebs0521 c083a43
refactor(volunteer-apply): 봉사 지원 조회 리팩토링
leebs0521 3f9c3a8
test(volunteer-apply): 봉사 지원 조회 리팩토링 테스트
leebs0521 901f6cb
refactor(review): 봉사 지원 생성 리팩토링
leebs0521 26543e9
test(review): 봉사 지원 생성 리팩토링에 따른 테스트
leebs0521 6b84b13
refactor(review): 봉사 지원 수정 및 삭제 리팩토링
leebs0521 1e2481f
chore: 불필요한 import 제거
leebs0521 c04d2a0
chore: sonarqube 이슈 해결
leebs0521 e3beb57
refactor: QueryUseCase에서 이미 작성된 테스트 삭제
leebs0521 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 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
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
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
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
19 changes: 19 additions & 0 deletions
19
src/main/java/com/somemore/domains/review/dto/request/ReviewUpdateRequestDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.somemore.domains.review.dto.request; | ||
|
|
||
| import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy; | ||
| import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import lombok.Builder; | ||
|
|
||
| @JsonNaming(SnakeCaseStrategy.class) | ||
| @Builder | ||
| public record ReviewUpdateRequestDto( | ||
| @Schema(description = "리뷰 제목", example = "내 인생 최고의 봉사 활동") | ||
| @NotBlank(message = "리뷰 제목은 필수 값입니다.") | ||
| String title, | ||
| @Schema(description = "리뷰 내용", example = "담당자님도 정말 친절하였고 정말 보람찬 봉사였어요 <br>") | ||
| @NotBlank(message = "리뷰 내용은 필수 값입니다.") | ||
| String content | ||
| ) { | ||
| } |
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
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
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/somemore/domains/review/service/DeleteReviewService.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.somemore.domains.review.service; | ||
|
|
||
| import com.somemore.domains.review.domain.Review; | ||
| import com.somemore.domains.review.service.validator.ReviewValidator; | ||
| import com.somemore.domains.review.usecase.DeleteReviewUseCase; | ||
| import com.somemore.domains.review.usecase.ReviewQueryUseCase; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| @RequiredArgsConstructor | ||
| @Transactional | ||
| @Service | ||
| public class DeleteReviewService implements DeleteReviewUseCase { | ||
|
|
||
| private final ReviewQueryUseCase reviewQueryUseCase; | ||
| private final ReviewValidator reviewValidator; | ||
|
|
||
| @Override | ||
| public void deleteReview(UUID volunteerId, Long id) { | ||
| Review review = reviewQueryUseCase.getById(id); | ||
|
|
||
| reviewValidator.validateAuthor(review, volunteerId); | ||
| review.markAsDeleted(); | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
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.
저는 이런 부분이 기본적이지만 상당히 느낌이 좋네요..