Skip to content

[1주차] 나명준/[feat] 초기 프로젝트 설정#5

Merged
Nanajun22 merged 5 commits intoLeets-Official:나명준/mainfrom
Nanajun22:나명준/1주차
Mar 25, 2026

Hidden character warning

The head ref may contain hidden characters: "\ub098\uba85\uc900/1\uc8fc\ucc28"
Merged

[1주차] 나명준/[feat] 초기 프로젝트 설정#5
Nanajun22 merged 5 commits intoLeets-Official:나명준/mainfrom
Nanajun22:나명준/1주차

Conversation

@Nanajun22
Copy link

@Nanajun22 Nanajun22 commented Mar 21, 2026

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

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

2. 핵심 변경 사항

-헬스 체크/문자열 2개 반환 API 구현
-Validation 로직 구현
-요청/응답 DTO 구현

3. 실행 및 검증 결과

image image image
  • 실행 결과:

  • GET /health 응답:
    status: 204 No Content

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

{
    "value": "Hello World"
}
{
    "value": ""
}

응답

{
    "string_one": "Hello World",
    "string_two": "Hello World"
}
{
  "status": 400,
  "message": "Validation",
  "validation": [
    {
      "field": "value",
      "message": "내용을 입력해주세요."
    }
  ]
}

4. 완료 사항

1.API 구현
2.요청/응답 DTO 분리하기
3.Validation 로직 작성

5. 추가 사항

제출 체크리스트

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

Reviewer 참고

@Nanajun22 Nanajun22 requested a review from kangyeson March 21, 2026 08:23
@Nanajun22 Nanajun22 self-assigned this Mar 21, 2026
@Nanajun22 Nanajun22 requested review from a team and KunHeeLee7 March 22, 2026 05:40
@Nanajun22 Nanajun22 linked an issue Mar 24, 2026 that may be closed by this pull request
8 tasks
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter

Choose a reason for hiding this comment

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

DTO를 생성할 때, 최신 SpringBoot 환경에서는 @Getter, @Setter보다 record 타입을 사용하는 것도 추천드립니다.
불변성을 보장해주고, 여러 번거로운 메서드를 자동으로 생성해주어서 꽤 유용합니다.

Copy link
Author

Choose a reason for hiding this comment

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

수정사항 반영해서 리팩터링 했습니다!


@GetMapping("/health")
public ResponseEntity<Void> test() {
return ResponseEntity.noContent().build();

Choose a reason for hiding this comment

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

헬스체크 API에서 단순 'OK'가 아니라 이렇게 HTTP 상태?를 반환하는건 처음 봤네요! 특별히 어떤 이점이 있는 걸까요?? 저에게는 생소한 코드라 궁금합니당

Copy link
Author

Choose a reason for hiding this comment

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

204는 200에 비해 바디가 없어 200보다 미세하게 트래픽 절약이 가능한 걸로 알고있습니다. 극단적으로 트래픽을 아껴야하는 상황에 사용하면 좋을 것 같습니다!

@Nanajun22 Nanajun22 requested review from a team and kangyeson March 24, 2026 11:13



public record RepeatRequestDto (@NotBlank(message = "내용을 입력해주세요.") String value){ }

Choose a reason for hiding this comment

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

👍record 클래스로 코드가 간결해지고, @notblank로 유효성 검사까지 처리하신 점이 인상 깊습니다. 덕분에 새로운 클래스 활용법을 배워갑니다!

@Nanajun22 Nanajun22 merged commit 7961caf into Leets-Official:나명준/main Mar 25, 2026
Copy link

@vyfhfhd vyfhfhd left a comment

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.

[1주차] 나명준/[feat] 프로젝트 기본세팅 및 기초 API 구성

4 participants