Skip to content

Comments

[강지원] sprint3#54

Open
jikang24 wants to merge 17 commits intocodeit-bootcamp-spring:강지원from
jikang24:강지원-spring_misson_3

Hidden character warning

The head ref may contain hidden characters: "\uac15\uc9c0\uc6d0-spring_misson_3"
Open

[강지원] sprint3#54
jikang24 wants to merge 17 commits intocodeit-bootcamp-spring:강지원from
jikang24:강지원-spring_misson_3

Conversation

@jikang24
Copy link
Collaborator

@jikang24 jikang24 commented Feb 8, 2026

요구사항

기본

  • Spring 프로젝트 초기화
  • Bean 선언 및 테스트
  • Spring 핵심 개념 이해하기
  • Lombok 적용

추가 요구사항

  • 시간 타입 변경하기
  • 새로운 도메인 추가하기
  • DTO 활용하기
  • UserService 고도화
  • AuthService 구현
  • ChannelService 고도화
  • MessageService 고도화
  • ReadStatusService 구현
  • UserStatusService 고도화
  • BinaryContentService 구현
  • [] 새로운 도메인 Repository 구현체 구현
    : JCFRepository 구현체는 구현하지 못했습니다.

심화

  • 심화 항목

주요 변경사항

  • DTO가 Request가 아닌 다른 형태로 제작하였습니다.
  • main Application은 셋업한 테스트만을 시험해 구동되도록 제작하였습니다.

스크린샷

image

멘토에게

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

*Spring 핵심 개념 이해하기
기존 JavaApplication에서는
UserService userService = new UserService(...);
User user = setupUser(userService);

위와 같이 새롭게 생성자 메서드로 객체 생성도 내가 하고 정보전달도 내가 하고
생명주기까지 전부 내가 관리해야했다.

하지만 DiscodeitApplication에서는
Spring을 통해 IoC Container가 각 구현체로부터 Dependency Injection(DI)를 주입받고
Bean을 자동으로 생성, 등록, 소멸까지 라이프사이클을 관리하므로 초기화방식에서 차이가 난다.

@jikang24 jikang24 added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Feb 8, 2026
package com.sprint.mission.discodeit.DTO;


public class BinaryContentDTO {

Choose a reason for hiding this comment

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

record로만 선언해도 됩니다! class 불필요

import java.util.UUID;

@Getter
public class Channel implements Serializable {

Choose a reason for hiding this comment

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

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


return channels.stream()
.map(channel -> {
ReadStatus readStatus = readStatusRepository.findByUserIdAndChannelId(channel.getUserId(), channel.getChannelId())

Choose a reason for hiding this comment

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

조회 로직 바깥으로 변경 및 IN 절로 한번에 조회해와서 Map으로 조합해서 처리해보시죠

  1. 부수효과
  2. N+1 문제 발생

Comment on lines +36 to +41
.findFirst()
.map(user -> new UserServiceResponseDTO.FindUserId(
user.getId(),
user.isOnline(),
user.getUpdatedAt()

Choose a reason for hiding this comment

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

findFirst 가 맨 마지막으로 가야 할 것 같습니다

Comment on lines +1 to +3
spring:
application:
name: discodeit No newline at end of file

Choose a reason for hiding this comment

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

이거 @ConditionalOnProperty 설정이 빠져 있네요!

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

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants