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

[1주차] 기본 과제 & 심화 과제 #2

Merged
merged 5 commits into from
Oct 26, 2023
Merged

[1주차] 기본 과제 & 심화 과제 #2

merged 5 commits into from
Oct 26, 2023

Conversation

SunwoongH
Copy link
Member

Related Issue ☃️

close #1

Description ✔️

  • 1주차 세미나 이론 및 코드 복습을 완료했습니다.
  • ResponseEntity 응답 대신 제네릭을 활용한 ApiResponse 클래스를 응답으로 ~/v6 health check API를 구현하였습니다.

@SunwoongH SunwoongH added the feat label Oct 11, 2023
@SunwoongH SunwoongH self-assigned this Oct 11, 2023
Copy link
Member

@kseysh kseysh left a comment

Choose a reason for hiding this comment

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

헉 아직 잘 모르는 제가 보기에도 너무 깔끔한 코드인 것 같아요!
아직 깔끔한 코드에 대해 잘 몰라서 gpt에다가도 개선점이 있을까 한 번 물어봤는데도 그렇다 할 개선점이 제가 보기에는 없는 것 같아요 너무 고생하셨습니다!

Copy link

@csb9427 csb9427 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
Member

@unanchoi unanchoi left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

Comment on lines 11 to 36
@Builder(access = PRIVATE)
@Getter
public class ApiResponse<T> {
private final int code;
private final String status;
private final boolean success;
@JsonInclude(NON_NULL)
private final T data;

public static <T> ApiResponse<?> of(final HttpStatus httpStatus, final boolean isSuccess) {
return ApiResponse.builder()
.code(httpStatus.value())
.status(httpStatus.name())
.success(isSuccess)
.build();
}

public static <T> ApiResponse<?> of(final HttpStatus httpStatus, final boolean isSuccess, final T data) {
return ApiResponse.builder()
.code(httpStatus.value())
.status(httpStatus.name())
.success(isSuccess)
.data(data)
.build();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

깔끔하네요~

Copy link
Member

Choose a reason for hiding this comment

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

코드 너무 깔끔하고 보기 좋은 거 같아요!
저도 많이 배워갑니다,,, 고생하셨어요!

@SunwoongH SunwoongH merged commit 105724d into develop Oct 26, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1주차] 기본 과제 & 심화 과제
5 participants