Skip to content

Conversation

@GitJIHO
Copy link
Contributor

@GitJIHO GitJIHO commented Sep 8, 2025

#️⃣ 연관된 이슈

📚 배경

  • DDIP Event 관련 아키텍쳐와 플로우를 정리한 이후, 실제 핵심 비즈니스 로직에 대한 구현이 필요하다.

📝 작업 내용

도메인 레이어 비즈니스 로직 구현

  • DDD 패턴 적용: 비즈니스 로직을 도메인 엔티티에 최대한 집중
  • DdipEvent 루트 애그리거트: 사진 업로드, 피드백 처리, 띱 완료/취소 등 핵심 비즈니스 로직 구현
  • Photo 도메인: 사진 상태 관리, 피드백 처리 로직 구현
  • Interaction 도메인: 사용자 간 상호작용 추적을 위한 도메인 객체

파일 저장 시스템 구현

  • S3FileStorageService: AWS S3 기반 파일 저장 구현체
  • 파일 검증 로직: 파일 크기, 타입, 유효성 검사
  • FileStorageException: 파일 저장 관련 공통 예외 처리
  • 환경별 설정: S3 버킷 및 접근 권한 설정

서비스 레이어 구현

  • DdipService: 도메인 로직과 인프라스트럭처를 연결하는 애플리케이션 서비스
  • DTO 정의: 요청/응답을 위한 데이터 전송 객체들, Request 위주 추가

📸 스크린샷

image

💬 리뷰 요구사항

  • DDD를 최대한 적용해보기 위해 도메인단에 애그리거트 기반 비즈니스 로직을 넣을 수 있는 부분들을 최대한으로 넣어보았는데, 관련해서 수정사항이나 추가할만한 부분이 있는지 궁금합니다.
  • TODO 로 표시된 유저 기반 로직, 상호 평가 로직등은 현재 미구현 상태입니다.
  • 임시 유저 로그인 로직이나 프론트 연동 과정에서 사용할만한 위치 기반이 아닌 CRUD 로직이 필요할 것 같네요,,!

✏ Git Close

close #29

@GitJIHO GitJIHO requested a review from Dockerel September 8, 2025 10:58
@GitJIHO GitJIHO self-assigned this Sep 8, 2025
@GitJIHO GitJIHO added ✨ Feature 새로운 기능 추가 및 구현하는 경우 ✅ Test Code 테스트 관련 작업을 진행하는 경우 labels Sep 8, 2025
@GitJIHO GitJIHO linked an issue Sep 8, 2025 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Sep 8, 2025

📊 Code Coverage Report

Overall Project 76.08% -2.26% 🍏
Files changed 81.4% 🍏

File Coverage
S3Config.java 100% 🍏
FileStorageException.java 100% 🍏
DdipEventRepositoryImpl.java 100% 🍏
DdipMapper.java 99.07% -0.93% 🍏
DdipService.java 84.41% -15.59%
S3FileStorageService.java 84.1% -15.9% 🍏

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

Test Results

246 tests   246 ✅  8s ⏱️
 37 suites    0 💤
 37 files      0 ❌

Results for commit b798cf3.

Copy link
Contributor

@Dockerel Dockerel left a comment

Choose a reason for hiding this comment

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

빡센 구현하시느라 고생많으셨습니다. 저번부터 느꼈는데 구현력이 상당하시네요.

플로우도 제가 이해했던대로 잘 구현된 것 같습니다.

고생하셨습니다!


String fileUrl = String.format("https://%s.s3.amazonaws.com/%s", bucketName, key);

log.info("S3 파일 업로드 완료: {} -> {}", file.getOriginalFilename(), fileUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

로그는 나중에 프로덕션 환경에서 확인하기 위해 작성하신건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 맞습니다. 서드파티를 사용하기 때문에 로그 확인용으로 좀 두고 안정성이 확보되면 추후 제거할 예정입니다!

@Slf4j
@Service
@RequiredArgsConstructor
public class S3FileStorageService implements FileStorageService {
Copy link
Contributor

Choose a reason for hiding this comment

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

파일 저장 방식 변경을 염두에 두고 인터페이스 기반으로 개발하신것 좋네요 👍👍

}

@Override
public boolean exists(String fileUrl) {
Copy link
Contributor

Choose a reason for hiding this comment

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

이 exists 메서드는 용도가 뭔가요? 아직 사용하시진 않은 것으로 보이네요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

포트를 만들 때 단순 upload만 만드는 것이 아니라 delete와 exists도 함께 만들었습니다. 현재는 upload기능만 사용하지만, 추후 용량 관리 등을 위해 delete를 사용할 경우에 exists도 아마 사용하지 않을까 싶어 확장성으로 고려해 미리 만들어 두었습니다.
최종적으로 사용하지 않는 것으로 결정 날 경우에 제거할 예정입니다!

this.interactions.add(Interaction.builder()
.actorId(this.requesterId)
.actorRole(ActorRole.REQUESTER)
.actionType(ActionType.REQUEST_REVISION)
Copy link
Contributor

Choose a reason for hiding this comment

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

피드백에 대해 reject한 부분인 것으로 이해했는데 혹시 REQUEST_REVISION은 무슨 뜻인가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이 부분은 저도 노션에 정의된 상태별 설명을 참고하였는데, 제출된 결과물에 수정을 요청함 (거절) 이라고 하더라구요.
사진 하나당 거절을 총 2번 할 수 있는데, 최초의 거절은 사진에 대한 추가 질문을 요청하는 경우에 발생하는 Interaction의 status이고 REQUEST_REVISION은 추가 질문에 대한 응답을 확인한 후 다른 사진을 요청할 때의 Interaction의 status입니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

목과 스텁 테스트로 빡세게 검증하신것 대단합니다 👍👍

@Dockerel Dockerel self-requested a review September 8, 2025 12:25
@GitJIHO GitJIHO merged commit d75949a into main Sep 9, 2025
2 checks passed
@GitJIHO GitJIHO deleted the Feat/issue-#29 branch September 9, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능 추가 및 구현하는 경우 ✅ Test Code 테스트 관련 작업을 진행하는 경우

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: 띱 이벤트 관련 엔드포인트 추가

3 participants