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
[team-01][BE] API - 전체 Todo 조회 요청 / 전체 History 조회 요청 #127
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- createdTime, updatedTime 네이밍 수정 - userId -> user 로 수정 - 생성자가 하나인 클래스 @Autowired 명시하지 않도록 수정 - 테스트 코드 중 여러 개의 assertThat() 을 사용하는 테스트에서 assertAll() 을 사용하도록 수정 - @ParameterizedTest 를 이용해 테스트할 valuesource 를 중복 작성하지 않게하고, 테스트의 예상 값이 변경되어도 actual 값을 따로 변경해주지 않도록 수정 - 테스트 할 때 sql 파일이 초기화되도록 @Sql 사용
- GET api/todos path 로 요청이 오면 전체 todo 를 전달하도록 controller 구현 - service 계층에서 해당 요청을 repository 계층에 요청하도록 구현 - repository 게층에서 연결된 db 에서 sql 문을 통해 데이터를 가져와 List 에 담아서 데이터를 반환하도록 구현 Closes: #20
- GET /api/histories
- 전체 Todo 요청 시 데이터가 없으면 NoSuchElementException 을 반환
- assertThat() 의 contains() 와 hasSize() 를 이용해 테스트 코드의 중복 코드 제거
[BE] API Server - 전체 Todo 조회 요청 기능 구현
[BE] API Server - 전체 History를 조회하도록 기능 구현
Hyune-c
requested changes
Apr 12, 2022
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.
전체적으로 구분이 잘되있고 깔끔한 코드입니다. 👍
BE/src/main/java/codesquad/be/todoserver/controller/HistoryController.java
Outdated
Show resolved
Hide resolved
BE/src/main/java/codesquad/be/todoserver/controller/HistoryController.java
Outdated
Show resolved
Hide resolved
BE/src/test/java/codesquad/be/todoserver/controller/TodoControllerTest.java
Outdated
Show resolved
Hide resolved
BE/src/test/java/codesquad/be/todoserver/repository/TodoRepositoryTest.java
Outdated
Show resolved
Hide resolved
BE/src/test/java/codesquad/be/todoserver/HistoriesApiAcceptanceTest.java
Show resolved
Hide resolved
…") -> "/api" 변경 - TodoController의 TodoService final 추가
- 기존 main, test 분리되지 않은 문제가 있었음 - test 폴더 밑의 resources를 만들어 독립적인 환경으로 관리
- finAll() 메서드로 history 와 todo 의 데이터를 찾을 때 아무것도 없다면 NoSuchElementException 을 던져주도록 변경
- WebMvcConfigurer.configurePathMatch 사용하여 "/api" Prefix를 codesquad.be.todoserver.controller 패키지 이하 컨트롤러에 매핑하도록 사용
- 데이터를 하나하나 비교하는 방법에서 contentType 를 비교하는 테스트로 변경
- 조건문과 return 문에 있던 중복 코드를 변수로 추출 - Exception 메시지 추가
Hyune-c
approved these changes
Apr 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
안녕하세요
Dan
쿠킴
과동기
입니다. 리뷰해주신 내용 코드에 반영하였고, 전체 Todo 조회, 전체 History 조회 기능 구현하여 리뷰 요청드립니다!! 항상 감사합니다 😆📝 Description
GET /api/todos
GET /api/histories
🖼 결과