-
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.
Merge pull request #36 from Tico-Corp/fix-be/TICO-215-resolve-swagger…
…-ui-error [FIX] "/api" 접두사를 사용한 REST API 엔드포인트 구현 (TICO-215)
- Loading branch information
Showing
7 changed files
with
56 additions
and
6 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
14 changes: 14 additions & 0 deletions
14
backend/pomoro-do/src/main/java/com/tico/pomoro_do/global/base/AppInfoDTO.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,14 @@ | ||
package com.tico.pomoro_do.global.base; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class AppInfoDTO { | ||
private String application; | ||
private String version; | ||
private String description; | ||
private String message; | ||
private String swaggerUrl; | ||
} |
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
32 changes: 32 additions & 0 deletions
32
backend/pomoro-do/src/main/java/com/tico/pomoro_do/global/controller/RootController.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,32 @@ | ||
package com.tico.pomoro_do.global.controller; | ||
|
||
import com.tico.pomoro_do.global.base.AppInfoDTO; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
|
||
@Tag(name = "root", description = "애플리케이션 기본 정보 API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/") | ||
public class RootController { | ||
|
||
@Operation(summary = "애플리케이션 기본 정보", description = "애플리케이션의 기본 정보를 제공합니다.") | ||
@GetMapping | ||
public ResponseEntity<AppInfoDTO> getInfo() { | ||
AppInfoDTO response = new AppInfoDTO( | ||
"Pomoro-Do!", | ||
"1.0.0", | ||
"Pomoro-Do! 서비스에 오신 것을 환영합니다.", | ||
"서비스가 정상적으로 실행 중입니다.", | ||
"/swagger-ui.html" | ||
); | ||
return new ResponseEntity<>(response, HttpStatus.OK); | ||
} | ||
} |
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