-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEAT] Swagger setting
- Loading branch information
Showing
7 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
|
@@ -36,5 +36,4 @@ out/ | |
### VS Code ### | ||
.vscode/ | ||
|
||
.env | ||
application.yml |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM openjdk:17 | ||
ARG JAR_FILE=build/libs/*.jar | ||
COPY ${JAR_FILE} flory.jar | ||
ENTRYPOINT ["java","-jar","/flory.jar"] | ||
COPY ${JAR_FILE} umcservice.jar | ||
ENTRYPOINT ["java","-jar","/umcservice.jar"] |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/umc/networkingService/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,24 @@ | ||
package com.umc.networkingService.config; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
@Bean | ||
public OpenAPI openAPI() { | ||
return new OpenAPI() | ||
.components(new Components()) | ||
.info(apiInfo()); | ||
} | ||
|
||
private Info apiInfo() { | ||
return new Info() | ||
.title("UMC ๋คํธ์ํน ์๋น์ค API ๋ช ์ธ์") | ||
.description("Swagger UI for UMC ๋คํธ์ํน ์๋น์ค") | ||
.version("1.0.0"); | ||
} | ||
} |
26 changes: 22 additions & 4 deletions
26
src/main/java/com/umc/networkingService/domain/test/controller/TestController.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 |
---|---|---|
@@ -1,17 +1,35 @@ | ||
package com.umc.networkingService.domain.test.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Hidden; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "์์ API", description = "Swagger ํ ์คํธ์ฉ API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/test") | ||
public class TestController { | ||
@Operation(summary = "๋ฌธ์์ด ๋ฐ๋ณต", description = "ํ๋ผ๋ฏธํฐ๋ก ๋ฐ์ ๋ฌธ์์ด์ 2๋ฒ ๋ฐ๋ณตํฉ๋๋ค.") | ||
@Parameter(name = "str", description = "2๋ฒ ๋ฐ๋ณตํ ๋ฌธ์์ด") | ||
@GetMapping("/returnStr") | ||
public String returnStr(@RequestParam String str) { | ||
return str + "\n" + str; | ||
} | ||
|
||
@GetMapping("/example") | ||
public String example() { | ||
return "์์ API"; | ||
} | ||
|
||
@GetMapping | ||
public String getTest() { | ||
return "kimjunseok"; | ||
@Hidden | ||
@GetMapping("/ignore") | ||
public String ignore() { | ||
return "๋ฌด์๋๋ API"; | ||
} | ||
} | ||
} |