-
Notifications
You must be signed in to change notification settings - Fork 3
워크스페이스 채널 목록 조회 API #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…into be-feat/ci
ki-met-hoon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생많으셨습니다 👍
리뷰 작성 완료했습니다!
| log.info("Getting channels for workspace with id: {}", workspaceId); | ||
|
|
||
| ChannelListDTO channelListDTO = workSpaceService.getChannels(userId, workspaceId); | ||
| return ResponseEntity.ok().body(channelListDTO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok method 매개변수로 body값을 넣을 수 있지 않나요?
| @Column(name = "name", length = 100, nullable = false) | ||
| private String name; | ||
|
|
||
| @CreationTimestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MappedSuperClass로 항상 사용되는 createdAt, updatedAt , id 변수를 통합시키는건 어떨까요?
| import java.util.Optional; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| public interface UserChannelRepository extends JpaRepository<UserChannel, Long> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChannelRepository는 @Repository 어노테이션이 있는데 얘는 없는 것 같아요!
|
|
||
| @Repository | ||
| public interface ChannelRepository extends JpaRepository<Channels, Long> { | ||
| List<Channels> findByWorkSpaceWorkspaceId(Long workspaceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
얘는 Optional을 사용하지 않은 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디폴트 채널이 무조건 있다고 가정했기 때문입니다!
| private final ChannelRepository channelRepository; | ||
| private final UserChannelRepository userChannelRepository; | ||
|
|
||
| public ChannelListDTO getChannels(Long userId, Long workspaceId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getChannels method가 많은 책임을 가지고 있는 것 같아요! 기능별로 method를 분리하는건 어떨까요?
Pull request
Related issue
#31
Motivation and context
워크스페이스 채널 목록 조회 api 구현
요청 @PathVariable Long workspaceId
응답
public class ChannelListDTO {
private List joinedChannels;
private List unjoinedChannels;
}
public class SimpleChannel {
private Long channelId;
private String channelName;
private LocalDateTime createdAt;
}
Solution
How has this been tested
Types of changes
Checklist