Skip to content

Feat/week 3#26

Open
scholar-star wants to merge 20 commits intoApptiveDev:mainfrom
scholar-star:feat/week-3
Open

Feat/week 3#26
scholar-star wants to merge 20 commits intoApptiveDev:mainfrom
scholar-star:feat/week-3

Conversation

@scholar-star
Copy link

변경점 👍

Member Entity를 User로 구현했고, Post에 검색 기능을 추가해 Post의 내용에 포함된 단어를 검색 시 해당 Post가 나오도록 하였고, 좋아요 기능도 Post에 추가하였습니다.

버그 해결 💊

Test Code를 진행할 때 Setup 과정에서 Test Entity들을 등록할 때, ID 설정 방식 불일치, 참조되는 키가 있는 Table의 내용 삭제 불가 등 DB와 관련한 오류를 해결하였습니다.

테스트 💻

Test Code로 좋아요 Test인 likeTest, 검색 결과 Test인 searchTest를 구현해 진행하였습니다.

스크린샷 🖼

검색 기능 post 좋아요

비고 ✏

여러 가지 사항을 한번에 고려하지 못해서, 엉성한 데가 많습니다. 현재 만든 기능에서 허점이 보이면 언제든지 알려주시고, 미처 지난 주 내용을 수정하지 못한 부분이 있다면 다시 한번 알려주세요!

Copy link

@Martinel2 Martinel2 left a comment

Choose a reason for hiding this comment

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

3주차도 수고하셨습니당 코드를 너무 잘 작성하셔서 리뷰드릴게 따로 없을정도네요!! 메소드명 혹은 리팩토링할 수 있는 부분들을 쪼개는 연습만 하시면 저보다 더 잘하실거 같네요..

}

@GetMapping("/show/{content}")
public ResponseEntity<List<PostResponse>> showPost(@PathVariable String content) {

Choose a reason for hiding this comment

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

메소드의 이름을 searchPostByKeyword 와같이 명확하게 한다면, 추후에 코드를 수정해야하는 경우에 메소드명만 보고도 기능을 유추할 수 있어 더 좋을 것 같아요! (service쪽도 마찬가지!!)

@RestController
@RequestMapping("/sns/reply")
@RequiredArgsConstructor
public class ReplyController {

Choose a reason for hiding this comment

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

reply라면 답글을 의미하는 것 같다고 생각했는데, 그렇다면 댓글과 답글을 따로 관리하는 방식인가요?

private long postId;
private long replyId;

@BeforeEach

Choose a reason for hiding this comment

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

@beforeeach와 @BeforeAll의 차이가 무엇일까요?

return repliesResponse;
}

@Transactional

Choose a reason for hiding this comment

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

@transactional을 Service 클래스자체에 할당하면 @transactional을 모든 메소드가 가진 것과 같은 효과를 가집니다!

import javax.naming.AuthenticationException;

@RestControllerAdvice
public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {

Choose a reason for hiding this comment

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

이미 예외 핸들러를 잘 사용하고계시군요!

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