[1주차] 임성현/[feat] 초기 프로젝트 설정#33
Hidden character warning
Conversation
| public class HealthController { | ||
|
|
||
| @GetMapping("/health") | ||
| public String health() { |
There was a problem hiding this comment.
클래스에 @RequestMapping("/api/health")이 있고, 메서드에 @GetMapping("/health")이 있어서 실제 호출 경로가 /api/health/health 가 될 것 같은데, 혹시 의도하신 건가요?
/api/health 로 호출하려는 거라면 @GetMapping 쪽 경로를 비워두시면 될 것 같습니다!
그리고 StringController는 /api/v1/strings 으로 버전이 들어가 있는데, HealthController는 버전 없이 /api/health 로 되어 있어서요. 헬스체크는 버전과 무관하게 가져가려는 의도라면 괜찮은데, 한번 확인해보시면 좋을 것 같아요.
| public class StringResponse { | ||
|
|
||
| private String string_one; | ||
| private String string_two; |
There was a problem hiding this comment.
Java에서는 보통 필드명을 camelCase(stringOne, stringTwo)로 작성하는데요, JSON 응답에서 snake_case를 쓰고 싶으시다면 필드는 camelCase로 두고 @JsonProperty("string_one") 어노테이션을 붙이는 방법도 있어서 참고해보시면 좋을 것 같습니다!
| @@ -0,0 +1,13 @@ | |||
| package com.example.demo; | |||
|
|
|||
There was a problem hiding this comment.
메인 코드는 com.example.blog7th 패키지인데, 테스트는 com.example.demo 패키지로 남아있는 것 같아요. 클래스명도 DemoApplicationTests로 되어 있어서, 초기 템플릿에서 변경이 안 된 것 같은데 맞춰주시면 좋을 것 같습니다!
| package com.example.blog7th.controller; | ||
|
|
||
| import org.jspecify.annotations.NonNull; | ||
| import org.springframework.http.ResponseEntity; |
There was a problem hiding this comment.
@NonNull이 import 되어 있는데 실제로 사용되는 곳이 없는 것 같아요. 사용하지 않는 import는 정리해주시면 좋겠습니다!
workspace.xml
Outdated
| @@ -0,0 +1,197 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project version="4"> | |||
There was a problem hiding this comment.
compiler.xml, gradle.xml, misc.xml, workspace.xml 같은 IDE 설정 파일들이 프로젝트 루트에 함께 커밋된 것 같아요. 특히 workspace.xml은 로컬 IDE 상태를 담고 있어서 공유 저장소에는 빼두는 게 좋을 것 같습니다. .gitignore에 추가하거나, 다음 커밋에서 제거해주시면 될 것 같아요!
| @@ -0,0 +1 @@ | |||
| spring.application.name=demo | |||
There was a problem hiding this comment.
spring.application.name이 demo로 되어 있는데, 프로젝트명에 맞게 변경해주시면 좋을 것 같아요.

1. 과제 요구사항 중 구현한 내용
GET /health)POST /string/repeat)2. 핵심 변경 사항
3. 실행 및 검증 결과
실행 결과:

GET /health 응답:

POST /string/repeat 요청/응답:

예외 처리 응답:


4. 완료 사항
5. 추가 사항
제출 체크리스트
{이름}/main브랜치다{이름}/{숫자}주차브랜치다