-
Notifications
You must be signed in to change notification settings - Fork 0
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
[FEATURE] reply 기능 구현 완료 #34
Conversation
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 ReplyService replyService; | ||
|
||
@PostMapping | ||
public void createReply(@RequestBody ReplyRequestDto requestDto) { | ||
replyService.createReply(requestDto); | ||
} | ||
|
||
@GetMapping("/{articleId}") | ||
public List<ReplyRequestDto> getReplyList(@PathVariable Long articleId, HttpServletRequest request) { | ||
return replyService.getReplyList(articleId, LanguageType.findTypeByRequest(request)); | ||
} | ||
|
||
@DeleteMapping("/{replyId}") | ||
public ResponseEntity<String> deleteReply(@PathVariable Long replyId) { | ||
replyService.deleteReply(replyId); | ||
return ResponseEntity.ok("삭제처리가 완료되었습니다."); | ||
} |
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.
수정은 없는게 의도가 된 부분일까요?
Controller Mapping은 잘했습니다. 👍
많이 좋아졌네요.
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.
수정은 일부러 안넣었습니다. 감사합니다 !
} | ||
|
||
@GetMapping("/{articleId}") | ||
public List<ReplyRequestDto> getReplyList(@PathVariable Long articleId, HttpServletRequest request) { |
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.
ReplyRequestDto가 클래스 명칭인데 Response를 해당 DTO로 하고있네요.
Naming은 좀 더 어울리게 수정이 필요할것 같네요.
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
private ReplyStatus isDeleted; |
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.
컬럼명칭이 replyStatus가 더 어울릴 것 같은 느낌이 드네요
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@OneToMany(mappedBy = "reply") |
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.
fetch타입은 명시해주시기 바랍니다.
@Builder | ||
public Reply(Long id, LanguageType orgReplyLanguage, ReplyStatus isDeleted, | ||
User createdUser, User updatedUser) { | ||
this.id = id; | ||
this.orgReplyLanguage = orgReplyLanguage; | ||
this.isDeleted = isDeleted; | ||
this.createdUser = createdUser; | ||
this.updatedUser = updatedUser; | ||
} |
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.
위에 @Builder
가 명시되어있는데, 또 명시한 이유가 있을까요?
둘중 하나는 날려버리는게 좋지 않을까 하네요.
// .title(translateService.naverPapagoTextTranslate(requestDto.getOrgArticleLanguage(), languageType.getLanguageCode(), requestDto.getTitle())) | ||
// .content(translateService.naverPapagoHtmlTranslate(requestDto.getOrgArticleLanguage(), languageType.getLanguageCode(), requestDto.getContent())) |
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.
주석처리한 이유가 있을까요?
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.
이부분은 댓글 로직과 관련이 없어서 일단 막아놨습니다.
지금 pr이 merge되면 Article쪽 service 메서드 합치면서 수정하겠습니다.
getTranslatePapagoTextArticleContent(requestDto.getOrgArticleLanguage().getLanguageCode(), languageType.getLanguageCode(), requestDto.getTitle()), | ||
getTranslatePapagoHTMLArticleContent(requestDto.getOrgArticleLanguage().getLanguageCode(), languageType.getLanguageCode(), requestDto.getContent())); |
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.
기능이...? 없는것같은데...
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.
다른 pr로 게시글 쪽 번역 부분 다시 수정하겠습니다!
@Transactional(readOnly = true) | ||
public List<ReplyRequestDto> getReplyList(Long articleId, LanguageType language) { | ||
Article article = articleRepository.findById(articleId).orElseThrow(() -> ArticleContentNotFoundException.EXCEPTION); | ||
List<Reply> replyList = replyRepository.findAllByArticleAndDeleted(article, false); |
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.
?
public interface ReplyRepository extends JpaRepository<Reply, Long> { | ||
List<Reply> findAllByArticleAndDeleted(Article article, boolean isDeleted); |
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.
아하
… into feat/28-reply branch merge 충돌 수정
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.
잘했어요, 이제 좋아요만 남았나요?
댓글 등록 / 조회 / 삭제 기능