-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
photo-service/src/main/java/kr/mafoo/photo/config/SwaggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package kr.mafoo.photo.config; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Contact; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.info.License; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import io.swagger.v3.oas.models.servers.Server; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
@Bean | ||
public OpenAPI openAPI() { | ||
return new OpenAPI() | ||
.info(new Info() | ||
.title("๋งํธ ๋ฐฑ์๋ API ๋ช ์ธ - ์ฌ์ง/์จ๋ฒ ์๋น์ค") | ||
.version("v1") | ||
.description("์ฌ์ง/์จ๋ฒ ๊ด๋ จ API ๋ช ์ธ ๋ชฉ๋ก์ ๋๋ค.") | ||
.contact(new Contact() | ||
.name("๊นํ๋ธ ์ฃผ์") | ||
.url("https://github.com/YAPP-Github/mafoo-backend")) | ||
.license(new License() | ||
.name("MIT License") | ||
.url("https://opensource.org/licenses/MIT")) | ||
) | ||
.addServersItem(new Server() | ||
.url("https://gateway.mafoo.kr/photo/") | ||
.description("ํ๋ก๋์ ์๋ฒ ์ฌ์ง/์จ๋ฒ ์๋น์ค URL") | ||
) | ||
.addSecurityItem(new SecurityRequirement().addList("Authorization")) | ||
.components( | ||
new Components() | ||
.addSecuritySchemes("Authorization", | ||
new SecurityScheme() | ||
.type(SecurityScheme.Type.HTTP) | ||
.scheme("Bearer") | ||
.bearerFormat("JWT")) | ||
); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
user-service/src/main/java/kr/mafoo/user/config/SwaggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package kr.mafoo.user.config; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Contact; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.info.License; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import io.swagger.v3.oas.models.servers.Server; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
@Bean | ||
public OpenAPI openAPI() { | ||
return new OpenAPI() | ||
.info(new Info() | ||
.title("๋งํธ ๋ฐฑ์๋ API ๋ช ์ธ - ์ ์ ์๋น์ค") | ||
.version("v1") | ||
.description("์ฌ์ฉ์ ์ ๋ณด ๊ด๋ จ API ๋ช ์ธ ๋ชฉ๋ก์ ๋๋ค.") | ||
.contact(new Contact() | ||
.name("๊นํ๋ธ ์ฃผ์") | ||
.url("https://github.com/YAPP-Github/mafoo-backend")) | ||
.license(new License() | ||
.name("MIT License") | ||
.url("https://opensource.org/licenses/MIT")) | ||
) | ||
.addServersItem(new Server() | ||
.url("https://gateway.mafoo.kr/user/") | ||
.description("ํ๋ก๋์ ์๋ฒ ์ ์ ์๋น์ค URL") | ||
) | ||
.addSecurityItem(new SecurityRequirement().addList("Authorization")) | ||
.components( | ||
new Components() | ||
.addSecuritySchemes("Authorization", | ||
new SecurityScheme() | ||
.type(SecurityScheme.Type.HTTP) | ||
.scheme("Bearer") | ||
.bearerFormat("JWT")) | ||
); | ||
} | ||
} |