-
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 #104 from GGHDMS/feature/70-swagger-ui
[고도화] Swagger UI 로 API 문서화하기
- Loading branch information
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,20 @@ | ||
package com.study.projectboard.controller; | ||
|
||
import com.study.projectboard.dto.response.ArticleCommentResponse; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* <p> | ||
* 메인 컨트롤러 | ||
* | ||
* <p> | ||
* 테스트 중입니다. | ||
*/ | ||
@Controller | ||
public class MainController { | ||
|
||
|
@@ -11,4 +23,23 @@ public String root(){ | |
return "forward:/articles"; | ||
} | ||
|
||
/** | ||
* 댓글 정보를 열람한다 | ||
* | ||
* @param id 댓글 ID | ||
* @return 댓글 응답 | ||
*/ | ||
@ResponseBody | ||
@GetMapping("/test-rest") | ||
public ArticleCommentResponse test(Long id) { | ||
return ArticleCommentResponse.of( | ||
id, | ||
"content", | ||
LocalDateTime.now(), | ||
"[email protected]", | ||
"nickname", | ||
"hsm" | ||
); | ||
} | ||
|
||
} |