Open
Conversation
test: userInfo 수정 로직 테스트 케이스 추가
-서비스 저장소 Map 구조 변경 및 Optional 도입 -테스트 코드 추가
refactor: findById 메서드 반환 타입 변경 (Optional -> Object) 및 예외 처리 로직 내부화 - 채널 참가자 조회(findParticipants) 로직 이관 (ChannelService -> UserService) - 유저 정보 수정(updateUserInfo) 로직 개선 (if문 -> Optional 체이닝) - 특정 유저의 참여 채널 목록 조회 기능 구현
joonfluence
reviewed
Feb 7, 2026
joonfluence
reviewed
Feb 7, 2026
Collaborator
There was a problem hiding this comment.
이 클래스 외에도 엔티티 계층 요소들은 ~ Entity로 명시해주는 편이 좋습니다~!
joonfluence
reviewed
Feb 7, 2026
| FileInputStream fis = new FileInputStream(path.toFile()); | ||
| ObjectInputStream ois = new ObjectInputStream(fis) | ||
| ) { | ||
| return (BinaryContent) ois.readObject(); |
Collaborator
There was a problem hiding this comment.
I/O 작업은 map 바깥에서 처리해주는 것이 좋습니다! 부수효과가 발생하게 됩니다.
joonfluence
reviewed
Feb 7, 2026
| dto.fileType(), | ||
| dto.fileName() | ||
| ); | ||
| return binaryContentRepository.save(content).getId(); |
Collaborator
There was a problem hiding this comment.
222 부수효과 발생되므로 별도로 메서드에서 for-each로 최종적으로 처리해주시는게 좋습니다.
joonfluence
reviewed
Feb 7, 2026
Comment on lines
+84
to
+86
| boolean isOnline = userStatusRepository.findByUserId(user.getId()) | ||
| .map(UserStatus::isOnline) | ||
| .orElse(false); |
Collaborator
There was a problem hiding this comment.
222 여기도 마찬가지
추가로 N+1 문제도 발생하게 됩니다.
joonfluence
reviewed
Feb 7, 2026
| FileInputStream fis = new FileInputStream(path.toFile()); | ||
| ObjectInputStream ois = new ObjectInputStream(fis) | ||
| ) { | ||
| return (BinaryContent) ois.readObject(); |
joonfluence
reviewed
Feb 7, 2026
| fileRequest.fileType(), | ||
| fileRequest.fileName() | ||
| ); | ||
| return binaryContentRepository.save(content).getId(); |
joonfluence
reviewed
Feb 7, 2026
| dto.fileType(), | ||
| dto.fileName() | ||
| ); | ||
| return binaryContentRepository.save(content).getId(); |
joonfluence
reviewed
Feb 7, 2026
Comment on lines
+84
to
+86
| boolean isOnline = userStatusRepository.findByUserId(user.getId()) | ||
| .map(UserStatus::isOnline) | ||
| .orElse(false); |
joonfluence
approved these changes
Feb 7, 2026
Collaborator
joonfluence
left a comment
There was a problem hiding this comment.
제가 지난번 멘토링에 강의안으로 올려드렸던 강의 자료 참고하여 함수형 프로그래밍 할 때 부수 효과 없는 순수함수로 작성해야 하는 이유에 대해서 한번 공부해보시면 좋을 것 같습니다!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본 요구사항
Spring 프로젝트 초기화
3.4.0입니다.com.sprint.mission입니다.discodeit입니다.Jar입니다application.properties파일을yaml형식으로 변경하세요.DiscodeitApplication의 main 메서드를 실행하고 로그를 확인해보세요.Bean 선언 및 테스트
JavaApplication에서 테스트했던 코드를DiscodeitApplication에서 테스트해보세요.JavaApplication의 main 메소드를 제외한 모든 메소드를DiscodeitApplication클래스로 복사하세요.JavaApplication의 main 메소드에서 Service를 초기화하는 코드를 Spring Context를 활용하여 대체하세요.JavaApplication의 main 메소드의 셋업, 테스트 부분의 코드를DiscodeitApplication클래스로 복사하세요.Spring 핵심 개념 이해하기
JavaApplication과DiscodeitApplication에서 Service를 초기화하는 방식의 차이에 대해 다음의 키워드를 중심으로 정리해보세요.이 내용은 PR에 첨부해주세요.
Lombok 적용
@Getter로 대체해보세요.Basic*Service의 생성자를@RequiredArgsConstructor로 대체해보세요.비즈니스 로직 고도화
→ 추가 기능 요구사항
추가 기능 요구사항
시간 타입 변경하기
Instant로 통일합니다.새로운 도메인 추가하기
id,createdAt,updatedAt)를 포함합니다.ReadStatusUserStatusBinaryContentupdatedAt필드는 정의하지 않습니다.User,Message도메인 모델과의 의존 관계 방향성을 잘 고려하여id참조 필드를 추가하세요.UserService 고도화
createusername과email은 다른 유저와 같으면 안됩니다.UserStatus를 같이 생성합니다.find,findAllupdatedeleteBinaryContent(프로필),UserStatusAuthService 구현
loginusername,password과 일치하는 유저가 있는지 확인합니다.ChannelService 고
Status정보를 생성합니다.name과description속성은 생략합니다.findUser의id정보를 포함합니다.findAllUser의id정보를 포함합니다.User가 볼 수 있는 Channel 목록을 조회하도록 조회 조건을 추가하고, 메소드 명을 변경합니다.findAllByUserIdUser가 참여한 채널만 조회합니다.updatedeleteMessage,ReadStatusMessageService 고도화
createfindAllChannel의 Message 목록을 조회하도록 조회 조건을 추가하고, 메소드 명을 변경합니다.findallByChannelIdupdatedeleteBinaryContent)ReadStatusService 구현
createChannel이나User가 존재하지 않으면 예외를 발생시킵니다.Channel과User와 관련된 객체가 이미 존재하면 예외를 발생시킵니다.findid로 조회합니다.findAllByUserIduserId를 조건으로 조회합니다.updateid파라미터, 수정할 값 파라미터deleteid로 삭제합니다.UserStatusService 고도화
createUser가 존재하지 않으면 예외를 발생시킵니다.User와 관련된 객체가 이미 존재하면 예외를 발생시킵니다.findid로 조회합니다.findAllupdateid파라미터, 수정할 값 파라미터updateByUserIduserId로 특정User의 객체를 업데이트합니다.deleteid로 삭제합니다.BinaryContentService 구현
createfindid로 조회합니다.findAllByIdInid목록으로 조회합니다.deleteid로 삭제합니다.새로운 도메인 Repository 구현체 구현
심화 요구사항
Bean 다루기
Repository 구현체 중에 어떤 구현체를 Bean으로 등록할지 Java 코드의 변경 없이 application.yaml 설정 값을 통해 제어해보세요.
discodeit.repository.type설정값에 따라 Repository 구현체가 정해집니다.jcf이거나 없으면 JCF*Repository 구현체가 Bean으로 등록되어야 합니다.file이면 File*Repository 구현체가 Bean으로 등록되어야 합니다.File*Repository 구현체의 파일을 저장할 디렉토리 경로를 application.yaml 설정 값을 통해 제어해보세요.
스크린샷
멘토에게