Skip to content

Conversation

@mirlee0304
Copy link
Member

@mirlee0304 mirlee0304 commented Jan 24, 2025

Pull request

Related issue

#33

Motivation and context

워크스페이스 내 채널 가입 api 구현
요청 @PathVariable Long workspaceId, @PathVariable Long channelId
응답
success

Solution

  • 유저가 해당 채널을 생성한 경우 자동 가입되는 로직도 추가하였습니다!

How has this been tested

스크린샷 2025-01-24 오후 11 59 17

가입 성공의 경우 success 응답
이미 가입한 경우 위의 사진과 같이 응답

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the docs/CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mirlee0304 mirlee0304 self-assigned this Jan 24, 2025
@mirlee0304 mirlee0304 added ✨ Feature 기능 추가 🎮 BE 백엔드 무조건 스프린트내에 해야하는 것들 labels Jan 24, 2025
Copy link
Collaborator

@ki-met-hoon ki-met-hoon left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!! 작업 속도가 너무 빨라서 자극을 받고 있습니다👍

WorkSpace workSpace = fetchWorkSpace(workspaceId);

// 워크스페이스에 채널 있는지
if (!IsChannelInWorkSpace(workspaceId, channelId)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

해당 if문을 method화 하면 책임 분리가 더 뚜렷해질 것 같아요..!

Channels channel = fetchChannel(channelId);
Users user = fetchUser(userId);

UserChannel userChannel = UserChannel.builder()
Copy link
Collaborator

Choose a reason for hiding this comment

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

큰 것도 잘못된 것도 아니지만, 저는 Entity나 DTO를 만들때 해당 class의 변수들의 노출을 막고 싶어 정적 팩토리 메서드를 즐겨 사용합니다! 이건 고쳤으면 좋겠다가 아니라 저는 이렇게 즐겨 한다~ 입니다!!

https://tecoble.techcourse.co.kr/post/2020-05-26-static-factory-method/

@mirlee0304 mirlee0304 merged commit f7eee18 into dev Jan 25, 2025
1 check failed
@mirlee0304 mirlee0304 deleted the be-feat/workspace-joinCH branch February 25, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 추가 무조건 스프린트내에 해야하는 것들 🎮 BE 백엔드

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants