-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat: 게시글 공동저자 설정 / 공개 범위 설정 / 소속 팀 설정 API 기능 구현 #299
Conversation
@PatchMapping("/coauthor/{postId}") | ||
@Operation(summary = "게시글 공동 저자 설정 API", description = "게시글의 공동 저자를 설정합니다.") | ||
public ApiResponse<PostResponseDTO.UpdatePostResultDTO> setPostCoauthor(@PathVariable Long postId, @RequestBody PostRequestDTO.UpdateCoauthorRequestDTO request) { | ||
Member member = memberCommandService.getRequester(); |
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.
멤버정보는 @AuthenticationPrincipal CustomMemberDetails customMemberDetails
사용하면 될 것 같습니다!
// 새로운 공동 저자 리스트 추가 | ||
Set<Author> coauthors = request.getMemberIds().stream() | ||
.map(newCoauthorId -> { | ||
Member newCoauthor = memberRepository.findById(newCoauthorId).orElseThrow(() -> new IllegalArgumentException("Member not found: " + newCoauthorId)); |
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.
예외처리 GeneralException 사용 안하신 이유가 있나요?
public Post setPostTeam(Long postId, Long teamId) { | ||
Post post = postRepository.findById(postId).orElseThrow(() -> new GeneralException(ErrorStatus.POST_NOT_FOUND)); | ||
|
||
Member authenticatedMember = getAuthenticatedMember(); |
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.
getAuthenticatedMember를 만드신 이유가 궁금합니다!
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.
현재 로그인한 사용자가 게시글을 작성한 저자와 일치하는지 확인하기 위해 썼습니다!
#️⃣연관된 이슈
📝작업 내용
🔎코드 설명 및 참고 사항
💬리뷰 요구사항