Skip to content

[SO-148] feat: API 공통 응답 포맷 생성#52

Merged
nitronium102 merged 12 commits intodevelopfrom
feature/SO-148-common-status-response
Aug 8, 2023
Merged

[SO-148] feat: API 공통 응답 포맷 생성#52
nitronium102 merged 12 commits intodevelopfrom
feature/SO-148-common-status-response

Conversation

@nitronium102
Copy link
Copy Markdown
Contributor

작업 개요

  • 프론트와의 원활한 API 통신을 위해 JSend 기반 API 공통 응답 포맷 생성

작업 분류

  • 버그 수정
  • 신규 기능
  • 프로젝트 구조 변경

작업 상세 내용

  • 성공 시 status (SUCCESS) , data 형식을 리턴
    image

  • 실패 시 status (FAIL), data 형식을 리턴
    image

  • ErrorResponse도 API 응답 포맷대로 리턴하도록 GlobalExceptionHandler에서 처리했습니다.

  • 현재 생성된 API에는 모두 공통 응답 포맷을 적용하였습니다.

생각해볼 문제

@nitronium102 nitronium102 requested a review from lina1919 August 8, 2023 03:02
@nitronium102 nitronium102 self-assigned this Aug 8, 2023
@nitronium102 nitronium102 added 🐇Simple 간단한 PR인 경우 해당 라벨을 붙이면 빠르게 리뷰할 수 있습니다 👀리뷰필요 리뷰가 필요한 경우 labels Aug 8, 2023
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Aug 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Comment on lines +42 to +51
public ResponseEntity<ApiResponse<Object>> signOut(@RequestBody AccessTokenDto requestDto) {
AccessTokenDto resDto = authService.signOut(requestDto);
ResponseCookie responseCookie = removeRefreshTokenCookie();

return ResponseEntity.ok()
.header(SET_COOKIE, responseCookie.toString())
.body(resDto);
.body(ApiResponse.builder()
.status(ApiResponseStatus.SUCCESS)
.data(resDto)
.build());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

그때 이야기 했듯이 이 부분은 프론트 측에 슬랙으로 알려주면 좋을 것 같아요!

Copy link
Copy Markdown
Contributor

@lina1919 lina1919 left a comment

Choose a reason for hiding this comment

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

LGTM! 수고많으셨습니다 merge 하시죠

@nitronium102 nitronium102 removed the 👀리뷰필요 리뷰가 필요한 경우 label Aug 8, 2023
@nitronium102 nitronium102 merged commit 0c22986 into develop Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐇Simple 간단한 PR인 경우 해당 라벨을 붙이면 빠르게 리뷰할 수 있습니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants