Skip to content

[1주차] 한하람/[feat] 프로젝트 초기 설정 및 기초 API 구현#11

Merged
Hanharam merged 14 commits intoLeets-Official:한하람/mainfrom
Hanharam:한하람/1주차
Mar 27, 2026

Hidden character warning

The head ref may contain hidden characters: "\ud55c\ud558\ub78c/1\uc8fc\ucc28"
Merged

[1주차] 한하람/[feat] 프로젝트 초기 설정 및 기초 API 구현#11
Hanharam merged 14 commits intoLeets-Official:한하람/mainfrom
Hanharam:한하람/1주차

Conversation

@Hanharam
Copy link

@Hanharam Hanharam commented Mar 22, 2026

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

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

2. 핵심 변경 사항

공통 응답 래핑

  • ApiResponse 클래스 생성하여 {success, code, message, result} Api 응답 규격 설정
  • ResponseBodyAdvice를 구현한 GlobalResponseWrapper 를 통해 컨트롤러의 반환값을 자동으로 ApiResponse를 반환하도록 자동화

전역 예외 처리

  • GlobalExceptionHandler 를 구현하여 전역에서 발생하는 예외를 한 곳에서 처리
  • BusinessException 기반의 예외 구조 설계 및 CommonErrorCode 세팅

repeat, test구현

  • service, controller, dto, exception 분리
  • RepeatRequest DTO에 record & @Valid 어노테이션 사용
  • RepeatResponse 정적 팩토리 메서드 사용
  • 받은 입력값을 두 번 반환하는 repeat API 구현
  • RepeatErrorCode 와 RepeatDomainException 을 생성 도메인 비즈니스 로직에 특화된 에러 핸들링 구조 적용

3. 실행 및 검증 결과

  • 실행 결과:
  • GET /health 응답:
image
  • POST /string/repeat 요청/응답:

성공
image
image
예외
image
image

4. 완료 사항

  1. 프로젝트 초기 세팅
  2. health check, repeat API 구현
  3. 공통 응답 및 전역 예외 핸들러 구축

5. 추가 사항

제출 체크리스트

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

Reviewer 참고

@Hanharam Hanharam self-assigned this Mar 22, 2026
@Hanharam Hanharam linked an issue Mar 22, 2026 that may be closed by this pull request
8 tasks
@Hanharam Hanharam added the enhancement New feature or request label Mar 22, 2026
Comment on lines +25 to +26
INVALID_ENV(HttpStatus.BAD_REQUEST, "ENV-001", "현재 실행 환경에서는 사용할 수 없는 기능입니다.")
;

Choose a reason for hiding this comment

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

오 이런 상태코드는 모르고 있었는데 좋습니다~!

Comment on lines +7 to +8
@Service
@RequiredArgsConstructor

Choose a reason for hiding this comment

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

지금은 Test단계라 괜찮지만 추후에 CommandService(생성,수정,삭제) 는 트랜잭션을 추가하는게 좋아보입니다!
QueryService(조회) 일때는 트랙잭션(readOnly) 로 추가하는것도 동시성 문제에 도움이 될 것 같습니다!

Copy link
Author

Choose a reason for hiding this comment

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

좋습니다! 다음 미션 때 적용해보겠습니다!

Comment on lines +36 to +40
log.trace("TRACE");
log.debug("DEBUG");
log.info("INFO");
log.warn("WARN");
log.error("ERROR");

Choose a reason for hiding this comment

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

로그 체킹 좋은 것 같아요~~! 👍

Copy link

@jihoonkim501 jihoonkim501 left a comment

Choose a reason for hiding this comment

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

하람님 도메인별로 상태코드, 예외처리 세부적으로 잘 나누신 것 같습니다! 수고 많으셨습니다! 제가 남긴 코멘트 몇개만 참고해주시면 좋을 것 같습니다!

Copy link

@N-yujeong N-yujeong left a comment

Choose a reason for hiding this comment

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

👍 전체적으로 과제 요구사항을 잘 반영하여 구현하신 것 같습니다.
추가적으로 validation과 공통 응답 구조까지 함께 구현하신 점도 좋았습니다!

@Hanharam Hanharam merged commit 262c2e3 into Leets-Official:한하람/main Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1주차] 한하람/[feat] 프로젝트 기본세팅 및 기초 API 구성

5 participants