Skip to content

Conversation

@kmw2378
Copy link
Contributor

@kmw2378 kmw2378 commented Feb 7, 2025

작업 내용

  • 댓글 생성
    • 요청 값의 componentId 검증 로직 추가
    • 요청 값의 componentIdparentId 간 관계 검증 로직 추가
    • 컴포넌트 댓글 수 증가 이벤트 발행 (ComponentCommentCountIncreaseEvent)
    • 컴포넌트 댓글 수 증가 이벤트 리스너 추가 (ComponentCommentCountEventListener)
    • 이미지 경로 변경 로직 변경
      • 기존: StorageService 사용
      • 변경: 별도 이벤트 리스너 사용 (CommentImageEventListener)
      • 도메인간 결합도를 낮추기 위해 공통 Service 대신 Spring Event Listener 활용
  • 댓글 삭제
    • 컴포넌트 댓글 수 감소 이벤트 발행 (ComponentCommentCountDecreaseEvent)
    • 컴포넌트 댓글 수 감소 이벤트 리스너 추가 (ComponentCommentCountEventListener)
  • 댓글 수정
    • 이미지 경로 변경 로직 변경
      • 기존: StorageService 사용
      • 변경: 별도 이벤트 리스너 사용 (CommentImageEventListener)
      • 도메인간 결합도를 낮추기 위해 공통 Service 대신 Spring Event Listener 활용
  • 그 외
    • 모든 이벤트 리스너 클래스명 Suffix를 Listener 로 변경

테스트

Repository

  • 테스트 성공 내역을 캡쳐해서 업로드

Service

image

Controller

  • Postman 내역 캡쳐해서 업로드

기타 사항 (참고 자료, 문의 사항 등)

  • 없음

@kmw2378 kmw2378 added ✔︎pull requests pull requests 코드 체크 요청 👨🏻‍💻backend 백엔드 작업 🪄refactor 리팩토링 labels Feb 7, 2025
@kmw2378 kmw2378 requested a review from SSUHYUNKIM February 7, 2025 12:43
@kmw2378 kmw2378 self-assigned this Feb 7, 2025
@kmw2378 kmw2378 changed the base branch from main to develop February 7, 2025 12:43
Copy link
Contributor

@SSUHYUNKIM SSUHYUNKIM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

private final ComponentRepository componentRepository;

@Async
@Transactional(propagation = Propagation.REQUIRES_NEW)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

궁금증) Progation.REQUIRES_NEW에 대해서 찾아봤는데 댓글 저장은 롤백되더라도, 댓글 수 증가 이벤트는 정상적으로 반영됨! 이라고 나와서 저장이 롤백되면 댓글 증가 이벤트도 반영이 안되어야하는게 아닌가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어우 그 부분을 고려 못했네요.. 감사합니다!

@kmw2378 kmw2378 merged commit 405ae9d into develop Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👨🏻‍💻backend 백엔드 작업 ✔︎pull requests pull requests 코드 체크 요청 🪄refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants