-
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
3 changed files
with
40 additions
and
0 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
18 changes: 18 additions & 0 deletions
18
src/main/java/HeyPorori/transaction/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,18 @@ | ||
package HeyPorori.transaction.config; | ||
|
||
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 customOpenAPI() { | ||
return new OpenAPI() | ||
.info(new Info() | ||
.title("중고거래 서비스 API") | ||
.version("1.7.0") | ||
.description("[한이음 ICT 멘토링 공모전 프로젝트] 클라우드를 활용한 지역 기반 거래 플랫폼 - 중고거래 서비스")); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/HeyPorori/transaction/controller/TransactionController.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,9 +1,30 @@ | ||
package HeyPorori.transaction.controller; | ||
|
||
import HeyPorori.transaction.config.BaseException; | ||
import HeyPorori.transaction.config.BaseResponse; | ||
import HeyPorori.transaction.service.TransactionService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
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.RestController; | ||
|
||
@RequiredArgsConstructor | ||
@Tag(name = "중고거래", description = "중고거래 관련 API 입니다.") | ||
@RestController | ||
@RequestMapping("/api/transactions") | ||
public class TransactionController { | ||
private final TransactionService transactionService; | ||
|
||
@Operation(summary = "Swagger UI 테스트용 메서드", description = "프로젝트 초기 Swagger UI 정상작동을 확인하기 위한 메서드입니다.") | ||
@ApiResponse(responseCode = "200", description = "요청 성공", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BaseResponse.class))) | ||
@GetMapping("/test") | ||
public BaseResponse<String> testSwagger() { | ||
return new BaseResponse<>("테스트 성공"); | ||
} | ||
} |