Skip to content

[1주차] 임성현/[feat] 초기 프로젝트 설정#33

Closed
sky-0131 wants to merge 14 commits intoLeets-Official:mainfrom
sky-0131:임성현/1주차

Hidden character warning

The head ref may contain hidden characters: "\uc784\uc131\ud604/1\uc8fc\ucc28"
Closed

[1주차] 임성현/[feat] 초기 프로젝트 설정#33
sky-0131 wants to merge 14 commits intoLeets-Official:mainfrom
sky-0131:임성현/1주차

Conversation

@sky-0131
Copy link

@sky-0131 sky-0131 commented Mar 24, 2026

1. 과제 요구사항 중 구현한 내용

  • 프로젝트 구조 구성 (Controller/Service 레이어 분리)
  • 헬스체크 API 구현 (GET /health)
  • 문자열 2개 반환 API 구현 (POST /string/repeat)
  • 권장 추가 구현 반영 (선택)

2. 핵심 변경 사항

  • HealthController.java: 헬스 체크 api
  • StringController.java, StringService.java: 문자열 반복 api
  • StringRequest.java, StringResponse.java: 요청 / 응답 DTO 분리
  • ApiExceptionHandler: 응답 예외 처리
  • Swagger 의존성 주입

3. 실행 및 검증 결과

  • 실행 결과:
    image

  • GET /health 응답:
    image

  • POST /string/repeat 요청/응답:
    image

    image

  • 예외 처리 응답:
    image

    image

4. 완료 사항

  1. 프로젝트 기본 세팅, 레이어 구조 설계
  2. 헬스체크 api, 문자열 반복 api
  3. 입력값 유효성 확인 (응답 내용 변경, 예외처리)

5. 추가 사항

  • 관련 이슈:

제출 체크리스트

  • PR 제목이 규칙에 맞다
  • base가 {이름}/main 브랜치다
  • compare가 {이름}/{숫자}주차 브랜치다
  • 프로젝트가 정상 실행된다
  • 본인을 Assignee로 지정했다
  • 파트 담당 Reviewer를 지정했다
  • 리뷰 피드백을 반영한 뒤 머지/PR close를 진행한다

@sky-0131 sky-0131 requested review from a team and eun-seoo March 24, 2026 07:26
@sky-0131 sky-0131 self-assigned this Mar 24, 2026
@sky-0131 sky-0131 removed the request for review from eun-seoo March 24, 2026 07:27
Copy link
Member

@theSnackOverflow theSnackOverflow left a comment

Choose a reason for hiding this comment

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

전체적으로 레이어 분리, DTO 구성, 유효성 검사, 예외 처리까지 깔끔하게 잘 구현해주셨네요. Swagger까지 붙여서 확인할 수 있게 해주신 것도 좋았습니다.

몇 가지 확인해보시면 좋을 것 같은 부분 남겨봅니다!

theSnackOverflow

This comment was marked as resolved.

theSnackOverflow

This comment was marked as resolved.

theSnackOverflow

This comment was marked as resolved.

public class HealthController {

@GetMapping("/health")
public String health() {
Copy link
Member

Choose a reason for hiding this comment

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

클래스에 @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;
Copy link
Member

Choose a reason for hiding this comment

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

Java에서는 보통 필드명을 camelCase(stringOne, stringTwo)로 작성하는데요, JSON 응답에서 snake_case를 쓰고 싶으시다면 필드는 camelCase로 두고 @JsonProperty("string_one") 어노테이션을 붙이는 방법도 있어서 참고해보시면 좋을 것 같습니다!

@@ -0,0 +1,13 @@
package com.example.demo;

Copy link
Member

Choose a reason for hiding this comment

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

메인 코드는 com.example.blog7th 패키지인데, 테스트는 com.example.demo 패키지로 남아있는 것 같아요. 클래스명도 DemoApplicationTests로 되어 있어서, 초기 템플릿에서 변경이 안 된 것 같은데 맞춰주시면 좋을 것 같습니다!

package com.example.blog7th.controller;

import org.jspecify.annotations.NonNull;
import org.springframework.http.ResponseEntity;
Copy link
Member

Choose a reason for hiding this comment

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

@NonNull이 import 되어 있는데 실제로 사용되는 곳이 없는 것 같아요. 사용하지 않는 import는 정리해주시면 좋겠습니다!

workspace.xml Outdated
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
Copy link
Member

Choose a reason for hiding this comment

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

compiler.xml, gradle.xml, misc.xml, workspace.xml 같은 IDE 설정 파일들이 프로젝트 루트에 함께 커밋된 것 같아요. 특히 workspace.xml은 로컬 IDE 상태를 담고 있어서 공유 저장소에는 빼두는 게 좋을 것 같습니다. .gitignore에 추가하거나, 다음 커밋에서 제거해주시면 될 것 같아요!

@@ -0,0 +1 @@
spring.application.name=demo
Copy link
Member

Choose a reason for hiding this comment

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

spring.application.namedemo로 되어 있는데, 프로젝트명에 맞게 변경해주시면 좋을 것 같아요.

@theSnackOverflow theSnackOverflow requested a review from a team March 24, 2026 09:00
@eun-seoo
Copy link
Member

image

안녕하세요, 성현님 ☺️
현재 base branch가 main 브랜치로 설정되어 있어, 임성현/main 브랜치로 변경 부탁드립니다!

@sky-0131 sky-0131 closed this Mar 25, 2026
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.

3 participants