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

refactor: Add UserDto and Swagger OpenApiCustomizer #15

Merged
merged 10 commits into from
Jun 29, 2024

Conversation

210-reverof
Copy link
Member

@210-reverof 210-reverof commented Jun 26, 2024

๐Ÿ›  Changes

  • applicationService <-> domainService ํ†ต์‹ ์„ ์œ„ํ•œ dto ์ถ”๊ฐ€
  • Swagger OpenApiCustomizer ์„ค์ • ์ถ”๊ฐ€
  • Swagger ์‰ฌ์šด ์ž‘์—…์„ ์œ„ํ•ด ApiResponse -> PicApiResponse๋กœ ์ด๋ฆ„ ๋ณ€๊ฒฝ

๐Ÿงšโ€โ™€๏ธ To Reviewers

image
  • 400, 500๋Œ€์—์„œ๋Š” ๋”ฐ๋กœ Controller์— @ApiRespone ์ถ”๊ฐ€ ์•ˆํ•ด๋„ ์˜๋„ํ•œ๋Œ€๋กœ ์˜ˆ์‹œ ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋„๋ก OpenApiCustomizer๋ฅผ ์ถ”๊ฐ€ํ•˜์˜€์Šด๋‹น
  • ํ•˜์ง€๋งŒ ์•„์ง 200 Response์—์„œ errorReponse๋ฅผ null๋กœ ์ฃผ๋Š” ๋ฐฉ๋ฒ•์„ ๋ชป ์ฐพ์•˜์Šต๋‹ˆ๋‹ค..๐Ÿฅน
  • ๋ฌผ๋ก  ๋ชจ๋“  API์— ๋Œ€ํ•ด ์ง์ ‘ JSON String์„ ์ž‘์„ฑํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™๊ธฐ๋Š” ํ•œ๋ฐ, ์ดํ›„ ๊ฐœ๋ฐœ ๋ณด์ˆ˜๊ฐ€ ๋„ˆ๋ฌด ๋งŽ์ด ๋“ค ๊ฒƒ ๊ฐ™์•„์„œ ์กฐ์–ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค ๐Ÿ™

๐ŸŽ’ Related Issues (optional)

๐Ÿ‘” Check List

  • PR ์ด๋ฆ„์ด ๋งž๊ฒŒ ์ž‘์„ฑ๋˜์—ˆ๋Š”๊ฐ€? (ex. feat: User login ~)
  • Test๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ ์‹คํ–‰๋˜๋Š”๊ฐ€?

@bbeomgeun
Copy link
Collaborator

์›์˜์”จ~~ ์ด๊ฑฐ ์ถ”๊ฐ€ํ•ด์ฃผ์‹œ๋ฉด ์Šค์›จ๊ฑฐ ์ข€ ๋” ํŽธํ•˜๊ฒŒ ์“ธ ๊ฒƒ ๊ฐ™์•„์š”

swaggerConfig์— ์ถ”๊ฐ€

@Bean
    fun modelResolver(objectMapper: ObjectMapper): ModelResolver {
        return ModelResolver(objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE))
    }

์ด๊ฑฐ ์›๋ž˜ objectMapper๋งŒ ๋„ฃ์–ด๋„ ์Šค๋„ค์ดํฌ ์ผ€์ด์Šค๋กœ ๋ณ€๊ฒฝ๋˜๋Š”๋ฐ, ์ง€๊ธˆ ์ €ํฌ jacksonConfig์— strategy๊ฐ€ ์ ์šฉ์•ˆ๋˜์–ด์žˆ๋„ค์š”

before
image

after
image

@210-reverof 210-reverof merged commit c62a70f into develop Jun 29, 2024
2 checks passed
@210-reverof 210-reverof deleted the refactor/dto branch June 29, 2024 04:58
210-reverof added a commit that referenced this pull request Jun 29, 2024
refactor: Add UserDto and Swagger OpenApiCustomizer
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.

3 participants