-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 해당 review에 달린 tag를 삭제하는 기능 추가 * feat: 해당 review에 달린 favorite을 삭제하는 기능 추가 * feat: NotAuthorOfReviewException 추가 * feat: 리뷰 삭제 기능 구현 * feat: s3 이미지 삭제 기능 구현 * test: 리뷰 삭제 기능에 대한 인수테스트 작성 * refactor: 리뷰 반영 * refactor: deleteAllByIdInBatch적용 * test: 리뷰 삭제 실패 케이스 추가 * refactor: updateProductImage 메서드 중복 제거 * feat: s3 파일 경로 지정 로직 추가 * refactor: 리뷰에 이미지가 존재할 때에만 s3 delete 로직 실행하도록 수정 * refactor: 리뷰 삭제 성공시 상태코드 204 반환 * test: 리뷰 삭제 성공시 상태코드 204 반환하도록 인수테스트 수정 * feat: s3 이미지 삭제 로직 이벤트 처리 * refactor: 이미지 있을 때만 이벤트 발행하던 로직을 이미지 유무 상관없이 이벤트 발행하도록 수정 (이미지 유무 처리를 이벤트리스너에서 하도록) * test: 리뷰 삭제 이벤트 관련 테스트 추가 * test: 리뷰 삭제 이벤트 관련 테스트 보완 * refactor: ReviewTagRepositoryTest의 deleteByReview 테스트 간소화 * feat: application.yml에 스레드 풀 설정 추가 * refactor: member를 equals로 비교하도록 수정 * chore: 컨벤션 적용 * refactor: 세션 이름 복구 * refactor: 리뷰 반영 * refactor: reviewId 대신 review로 delete하도록 수정 * refactor: s3 이미지 삭제 실패 로그 문구 수정 * refactor: 리뷰 삭제시 deleteById 대신 delete로 수정 * feat: 리뷰 삭제 api 수정 사항 적용 * style: EventTest 메소드 줄바꿈
- Loading branch information
Showing
25 changed files
with
858 additions
and
24 deletions.
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 |
---|---|---|
|
@@ -5,4 +5,6 @@ | |
public interface ImageUploader { | ||
|
||
String upload(final MultipartFile image); | ||
|
||
void delete(final String fileName); | ||
} |
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
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
14 changes: 14 additions & 0 deletions
14
backend/src/main/java/com/funeat/review/application/ReviewDeleteEvent.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,14 @@ | ||
package com.funeat.review.application; | ||
|
||
public class ReviewDeleteEvent { | ||
|
||
private final String image; | ||
|
||
public ReviewDeleteEvent(final String image) { | ||
this.image = image; | ||
} | ||
|
||
public String getImage() { | ||
return image; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
backend/src/main/java/com/funeat/review/application/ReviewDeleteEventListener.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,27 @@ | ||
package com.funeat.review.application; | ||
|
||
import com.funeat.common.ImageUploader; | ||
import io.micrometer.core.instrument.util.StringUtils; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.transaction.event.TransactionPhase; | ||
import org.springframework.transaction.event.TransactionalEventListener; | ||
|
||
@Component | ||
public class ReviewDeleteEventListener { | ||
|
||
private final ImageUploader imageUploader; | ||
|
||
public ReviewDeleteEventListener(final ImageUploader imageUploader) { | ||
this.imageUploader = imageUploader; | ||
} | ||
|
||
@Async | ||
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) | ||
public void deleteReviewImageInS3(final ReviewDeleteEvent event) { | ||
final String image = event.getImage(); | ||
if (StringUtils.isBlank(image)) { | ||
imageUploader.delete(image); | ||
} | ||
} | ||
} |
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
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
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.