Skip to content

Comments

최건위 sprint3#62

Open
geoni-98 wants to merge 2 commits intocodeit-bootcamp-spring:최건위from
geoni-98:최건위-sprint3

Hidden character warning

The head ref may contain hidden characters: "\ucd5c\uac74\uc704-sprint3"
Open

최건위 sprint3#62
geoni-98 wants to merge 2 commits intocodeit-bootcamp-spring:최건위from
geoni-98:최건위-sprint3

Conversation

@geoni-98
Copy link
Collaborator

@geoni-98 geoni-98 commented Feb 8, 2026

요구사항

기본

  • 기본 항목 1
  • 기본 항목 2

심화

  • 심화 항목 1
  • 심화 항목 2

주요 변경사항

스크린샷

image

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.
  • 아직 많이 완성률이 저조한데 최대한 더 기본을 끝내는 느낌으로 가보겠습니다!
  • 아직 오류나는 코드들도 많아서 그것도 해결해보겠습니다

@geoni-98 geoni-98 requested a review from hagyutae February 8, 2026 14:42
@hagyutae hagyutae changed the base branch from main to 최건위 February 11, 2026 04:11
@hagyutae
Copy link
Collaborator

.idea, file-data-map, .DS_Store 에 대해서 git ignore 처리 확실하게 해주세요!

Copy link
Collaborator

@hagyutae hagyutae left a comment

Choose a reason for hiding this comment

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

미구현 내용이 있는건 괜찮은데, 컴파일은 가능한 상태로 올려주셔야 리뷰가 가능해요.
우선, 컴파일 오류 나는 부분에 대해서는 IDE에서 바로 확인할 수 있으니 특별히 더 코멘트 하지 않았습니다.
작업 마무리해주세요~!

public class BasicUserService implements UserService {
private final UserRepository userRepository;
private final UserStatusRepository userStatusRepository;
private final BinaryContentRepository binaryContentRepository;
Copy link
Collaborator

Choose a reason for hiding this comment

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

해당 인터페이스가 diff에 존재하지 않습니다. 컴파일 오류가 발생합니다.

private Instant lastReadAt;

public ReadStatus(UUID id, UUID userId, UUID channelId) {
this.id = UUID.randomUUID();
Copy link
Collaborator

Choose a reason for hiding this comment

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

전달받은 UUID를 사용하지 않으면, 생성자 인자로 전달받는 의미가 없어요.
그리고 맥락상, ReadStatus ID는 생성자 내부에서 새로 생성하는게 맞는데, 나머지는 전달 받은 값들을 할당해야 합니다.

if (id == null) throw new IllegalArgumentException("id must not be null");
if (bytes == null) throw new IllegalArgumentException("bytes must not be null");

this.id = UUID.randomUUID();
Copy link
Collaborator

Choose a reason for hiding this comment

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

검증 후 덮어쓰기라는 로직이 일단 논리적이지 않구요,
여기서도 id 값은 외부에서 전달받기보다 직접 생성해서 할당하는게 맞습니다!

@@ -0,0 +1,55 @@
//package com.sprint.mission.discodeit;
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 파일은 이제 삭제하시면 됩니다.

ChannelRepository channelRepository = context.getBean(ChannelRepository.class);
MessageRepository messageRepository = context.getBean(MessageRepository.class);

User user = setupUser(userRepository);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Repository는 App에서 직접 사용하시면 안돼요.
우리는 앞으로 Service 통해서 작업을 수행할거고, 그 과정에서 필요하다면 Service가 Repository를 활용하는 형태가 되어야 합니다!


System.out.println("채널 전체조회: " + channelRepository.findAll().size());

Channel updated = new Channel(null,"공지사항","공지사항입니다.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

이건 updated가 아니라 create를 하고있는건데, 엔티티는 Service한테 생성을 위임해야지, 이렇게 직접적으로 객체화 시키면 안돼요.

import org.springframework.context.annotation.Configuration;

@Configuration
public class ServiceConfig {
Copy link
Collaborator

Choose a reason for hiding this comment

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

요구사항은 @Service, @Repository를 각 계층에 맞게 사용하라고 되어 있으나, @Configuration + @Bean 방식을 사용하고 있습니다. BasicMessageService@Service가 붙어있고 나머지는 @Configuration에서 @Bean으로 등록합니다. 일관성이 없습니다.

  • 의견: 두 방식 모두 유효하지만, 요구사항의 의도는 @Service, @Repository 어노테이션을 사용하는 것입니다. @Configuration + @Bean은 심화 요구사항의 @ConditionalOnProperty와 함께 사용하는 것이 더 적합합니다.

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