#16 board: swagger test
This commit is contained in:
@@ -36,7 +36,11 @@ dependencies {
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
|
||||
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-vault-config'
|
||||
// implementation 'org.springframework.cloud:spring-cloud-starter-vault-config'
|
||||
|
||||
implementation 'org.springdoc:springdoc-openapi-ui:1.6.12'
|
||||
implementation 'org.springdoc:springdoc-openapi-data-rest:1.6.12'
|
||||
implementation 'org.springdoc:springdoc-openapi-javadoc:1.6.12'
|
||||
|
||||
runtimeOnly 'com.h2database:h2'
|
||||
runtimeOnly 'mysql:mysql-connector-java'
|
||||
@@ -44,6 +48,7 @@ dependencies {
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
|
||||
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
package com.example.board.controller;
|
||||
|
||||
import com.example.board.dto.response.ArticleCommentResponse;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 메인 컨트롤러
|
||||
* </p>
|
||||
* 테스트 중
|
||||
*/
|
||||
@Controller
|
||||
public class MainController {
|
||||
|
||||
@@ -10,4 +20,23 @@ public class MainController {
|
||||
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@email.com",
|
||||
"bobby",
|
||||
"bobby"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user