Skip to content

Comments

[이다솔] Sprint3#90

Open
LeeDyol wants to merge 168 commits intocodeit-bootcamp-spring:이다솔from
LeeDyol:sprint3
Open

[이다솔] Sprint3#90
LeeDyol wants to merge 168 commits intocodeit-bootcamp-spring:이다솔from
LeeDyol:sprint3

Conversation

@LeeDyol
Copy link
Collaborator

@LeeDyol LeeDyol commented Feb 4, 2026

요구사항

기본

  • Spring Boot 3.4.0 프로젝트 초기화 (Gradle, Java 17)
  • @ Bean 등록 및 Spring Context 기반 통합 테스트 전환
  • Lombok 적용 (@ Getter, @ RequiredArgsConstructor)

Spring 핵심 개념 이해하기

  • Bean: 기존의 Java Application 에서는 직접 new 키워드를 통해 서비스 및 레파지토리 객체를 생성했지만, 스프링 컨테이너가 관리하는 자바 객체인 빈을 통해 서비스 및 레파지토리 객체를 생성함으로써 재사용성 및 일관성을 확보하기 용이해졌다.
  • IoC Container: Java Application 에서와 달리 스프링 프레임워크가 객체의 생성과 의존성 주입을 관리함으로써, 코드 간의 결함도가 낮아졌다.
  • Dependency Injection: @ RequiredArgsConstructor와 final 필드를 통해 필요한 객체를 외부로부터 주입받아 사용함으로써, 서비스 로직이 인터페이스에 의존하는 유연한 확장이 가능해졌다.

추가

  • 시간 타입 Instant 통일 및 새로운 도메인 (ReadStatus, UserStatus, BinaryContent) 추가
  • DTO 기반 파라미터 그룹화 및 도메인 간 참조 무결성 보장
  • 연쇄 삭제(Cascade Delete) 및 도메인 간 참조 무결성 보장
  • AuthService 구현 및 권한별 채널 조회 / 수정 로직 강화

심화

  • @ ConditionalOnProperty 등을 활용한 YAML 기반 Repository Type 제어 (Jef | file)
  • YAML 설정을 통한 파일 저장 경로 동적 관리

주요 변경사항

  • 유저 상태 실시간 감지(5분 이내 접속 시 온라인) 및 프로필 / 첨부파일을 위한 바이너리 관리 도메인 구축
  • 불변 리스트(List.of) 수정 에러 방지를 위해 가변 리스트(ArrayList) 생성 로직 적용 및 ConcurrentModificationException 방지를 위한 삭제 로직 개선

스크린샷

image

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

LeeDyol added 30 commits January 9, 2026 11:11
@joonfluence
Copy link
Collaborator

커밋 메세지들이 아주 깔끔하네요 👍

.idea/.gitignore Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

.gitignore에 추가 해주시죠!

Copy link
Collaborator

Choose a reason for hiding this comment

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

DTO 같이 불변성이 보장되어야 하는 클래스의 경우 class -> record 로 선언해서 사용합니다!

Copy link
Collaborator

Choose a reason for hiding this comment

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

이 클래스 외에도 엔티티 계층 요소들은 ~ Entity로 명시해주는 편이 좋습니다~!

Comment on lines +52 to +53
binaryContentRepository.save(binaryContent);
return binaryContent.getId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

부수효과 없이 작성하기 위해 데이터 수정/생성 작업은 외부로 빼서 for-each 에서 최종적으로 수행하는 편이 좋습니다!

Comment on lines +70 to +73
// 사용자별 상태 조회
UserStatus userStatus = userStatusRepository.findByUserId(user.getId());
return toResponseDTO(user, userStatus);
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

조회도 마찬가지

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants