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

[BG-163]: swagger 세팅 (2.5h / 4h) #13

Merged
merged 8 commits into from
Jul 1, 2024
Merged

Conversation

GGHDMS
Copy link
Member

@GGHDMS GGHDMS commented Jul 1, 2024

Why

swagger 설정을 추가함

How

swagger 설정을 비즈니스 로직에서 안들어내기 위해
Interface 및 Request, Response를 활용함

Result

image

테스트 변경 사항 없음

Link

BG-163

@GGHDMS GGHDMS requested a review from Dltmd202 July 1, 2024 08:29
@GGHDMS GGHDMS self-assigned this Jul 1, 2024
Copy link
Member

@Dltmd202 Dltmd202 left a comment

Choose a reason for hiding this comment

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

dto를 data class로 변환하는 것도 대부분 된 것 같넹!
이거 merge 할 때 그 카드도 같이 옮겨도 되겠당!

고생했엉 👍🏼

import io.swagger.v3.oas.annotations.media.Schema

data class JwtTokenResponse(
@Schema(
Copy link
Member

@Dltmd202 Dltmd202 Jul 1, 2024

Choose a reason for hiding this comment

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

dto도 swagger 관련된 부분 interface로 뺄 수 없을까??

Copy link
Member Author

Choose a reason for hiding this comment

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

Response로 되어 있는 부분은 전부 controller 영역에서만 호출하게 해놔서
Interface로 빼게 되면 너무 과하지 않을까 싶은데..
어떻게 생각해?

Copy link
Member

Choose a reason for hiding this comment

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

아하!ㅎㅎ
굳이긴 해!

.description("Api Documentation")

return OpenAPI()
.addServersItem(Server().url("http://localhost:8080").description("Local Server"))
Copy link
Member

@Dltmd202 Dltmd202 Jul 1, 2024

Choose a reason for hiding this comment

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

요런 주소는 밖에서 주입해주는게 어떨까 싶은뎅!

Copy link
Member Author

Choose a reason for hiding this comment

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

좋아~ 👍

ServletUriComponentsBuilder
.fromCurrentRequest()
.path("/{id}")
.buildAndExpand(workspaceFacadeService.createWorkspace(token.id, request.toDto()))
Copy link
Member

Choose a reason for hiding this comment

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

이게 Location 헤더에 해당 URI 넣어주려고 하는거지??

근데 workspaceFacadeService.createWorkspace(token.id, request.toDto()) 이 결과가 Long 으로 반환되고 있지 않은 것 같아!

Copy link
Member Author

Choose a reason for hiding this comment

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

그렇네 pr pull 하는 과정에서 바뀌었넹
👍 좋아용~

Copy link
Member

@Dltmd202 Dltmd202 left a comment

Choose a reason for hiding this comment

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

아주 좋아용~

@GGHDMS GGHDMS merged commit 93e8793 into develop Jul 1, 2024
1 check passed
@GGHDMS GGHDMS deleted the feature/BG-163-swagger branch July 1, 2024 13:26
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.

2 participants