Skip to content
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
merged 22 commits into from Apr 12, 2022

Conversation

donggi-lee-bit
Copy link
Member

@donggi-lee-bit donggi-lee-bit commented Apr 12, 2022

안녕하세요 Dan 쿠킴동기 입니다. 리뷰해주신 내용 코드에 반영하였고, 전체 Todo 조회, 전체 History 조회 기능 구현하여 리뷰 요청드립니다!! 항상 감사합니다 😆

📝 Description

요청 기능 상태코드
GET /api/todos 모든 Todo를 List 형태로 보낸다. 200
GET /api/histories 모든 히스토리를 보내준다. 200

🖼 결과

test

donggi-lee-bit and others added 11 commits April 11, 2022 11:56
- 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
- 전체 Todo 요청 시 데이터가 없으면 NoSuchElementException 을 반환
- assertThat() 의 contains() 와 hasSize() 를 이용해 테스트 코드의 중복 코드 제거
[BE] API Server - 전체 Todo 조회 요청 기능 구현
[BE] API Server - 전체 History를 조회하도록 기능 구현
@donggi-lee-bit donggi-lee-bit added the review-BE Improvements or additions to documentation label Apr 12, 2022
Copy link

@Hyune-c Hyune-c left a comment

Choose a reason for hiding this comment

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

전체적으로 구분이 잘되있고 깔끔한 코드입니다. 👍

ku-kim and others added 11 commits April 12, 2022 16:22
…") -> "/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 Hyune-c self-requested a review April 12, 2022 09:35
@ku-kim ku-kim merged commit 555c0fd into codesquad-members-2022:team-01 Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-BE Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants