Skip to content

Commit

Permalink
refactor: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake committed Jun 23, 2024
1 parent b4c5808 commit 566e787
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RestController
class AuthController(
private val authApplicationService: AuthApplicationService,
) {

@Operation(summary = "로그인")
@PostMapping("/login")
fun login(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SecurityConfig(
"/api/v1/auth/token",
"/health",
"/swagger-ui/**",
"/v3/api-docs/**"
)
"/v3/api-docs/**",
)
}
}
40 changes: 21 additions & 19 deletions pic-api/src/main/kotlin/com/mashup/pic/config/SwaggerConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,34 @@ import org.springframework.context.annotation.Configuration

@Configuration
@OpenAPIDefinition(
info = Info(
title = "pic API",
description = "pic API api documents",
version = "v0"
)
info =
Info(
title = "pic API",
description = "pic API api documents",
version = "v0",
),
)
class SwaggerConfig(
@Value("\${swagger.host.url:http://localhost:8080}")
val serverHostUrl: String
val serverHostUrl: String,
) {

@Bean
fun openApi(): OpenAPI {
val schemeName = "Authorization"
val securityRequirement = SecurityRequirement()
.addList(schemeName)
val components = Components()
.addSecuritySchemes(
schemeName,
SecurityScheme()
.name(schemeName)
.type(SecurityScheme.Type.HTTP)
.`in`(SecurityScheme.In.HEADER)
.scheme("bearer")
.bearerFormat("JWT")
)
val securityRequirement =
SecurityRequirement()
.addList(schemeName)
val components =
Components()
.addSecuritySchemes(
schemeName,
SecurityScheme()
.name(schemeName)
.type(SecurityScheme.Type.HTTP)
.`in`(SecurityScheme.In.HEADER)
.scheme("bearer")
.bearerFormat("JWT"),
)

return OpenAPI()
.addServersItem(Server().url(serverHostUrl))
Expand Down

0 comments on commit 566e787

Please sign in to comment.