Skip to content

Commit

Permalink
Merge pull request #1554 from woowacourse/feature/1541_roadmap_document
Browse files Browse the repository at this point in the history
Roadmap endpoint 에 대한 문서화 추가
  • Loading branch information
BGuga authored Oct 4, 2023
2 parents 62fba17 + 123e933 commit b0f6256
Show file tree
Hide file tree
Showing 17 changed files with 597 additions and 4,958 deletions.
42 changes: 42 additions & 0 deletions backend/src/documentation/adoc/curriculum.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[[Curriculum]]
== 커리큘럼

=== 커리큘럼 생성

==== Request

include::{snippets}/curriculums/create/http-request.adoc[]

==== Response

include::{snippets}/curriculums/create/http-response.adoc[]

=== 커리큘럼 조회

==== Request

include::{snippets}/curriculums/find/http-request.adoc[]

==== Response

include::{snippets}/curriculums/find/http-response.adoc[]

=== 커리큘럼 수정

==== Request

include::{snippets}/curriculums/update/http-request.adoc[]

==== Response

include::{snippets}/curriculums/update/http-response.adoc[]

=== 커리큘럼 삭제

==== Request

include::{snippets}/curriculums/delete/http-request.adoc[]

==== Response

include::{snippets}/curriculums/delete/http-response.adoc[]
62 changes: 62 additions & 0 deletions backend/src/documentation/adoc/essayAnswer.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[[EssayAnswer]]
== 퀴즈 답변

=== 퀴즈 답변 생성

==== Request

include::{snippets}/essay-answer/create/http-request.adoc[]

==== Response

include::{snippets}/essay-answer/create/http-response.adoc[]

=== 퀴즈 답변 단일 조회

==== Request

include::{snippets}/essay-answer/search/http-request.adoc[]

==== Response

include::{snippets}/essay-answer/search/http-response.adoc[]

=== 퀴즈 답변 목록 조회

==== Request

include::{snippets}/essay-answer/search-list/http-request.adoc[]

==== Response

include::{snippets}/essay-answer/search-list/http-response.adoc[]

=== 퀴즈 답변 업데이트

==== Request

include::{snippets}/essay-answer/update/http-request.adoc[]

==== Response

include::{snippets}/essay-answer/update/http-response.adoc[]

=== 퀴즈 답변 삭제

==== Request

include::{snippets}/essay-answer/delete/http-request.adoc[]

==== Response

include::{snippets}/essay-answer/delete/http-response.adoc[]

=== 퀴즈에 대한 답변 목록 조회

==== Request

include::{snippets}/essay-answer/quiz/essay-answer/http-request.adoc[]

==== Response

include::{snippets}/essay-answer/quiz/essay-answer/http-response.adoc[]
6 changes: 6 additions & 0 deletions backend/src/documentation/adoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ include::tag.adoc[]
include::filter.adoc[]
include::studylogOverview.adoc[]
include::reaction.adoc[]
include::essayAnswer.adoc[]
include::curriculum.adoc[]
include::keyword.adoc[]
include::quiz.adoc[]
include::recommend.adoc[]
include::roadmap.adoc[]
62 changes: 62 additions & 0 deletions backend/src/documentation/adoc/keyword.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[[Keyword]]
== 키워드

=== 키워드 생성

==== Request

include::{snippets}/keywords/create/http-request.adoc[]

==== Response

include::{snippets}/keywords/create/http-response.adoc[]

=== 키워드 조회

==== Request

include::{snippets}/keywords/find/http-request.adoc[]

==== Response

include::{snippets}/keywords/find/http-response.adoc[]

=== 키워드 수정

==== Request

include::{snippets}/keywords/update/http-request.adoc[]

==== Response

include::{snippets}/keywords/update/http-response.adoc[]

=== 키워드 삭제

==== Request

include::{snippets}/keywords/delete/http-request.adoc[]

==== Response

include::{snippets}/keywords/delete/http-response.adoc[]

=== 세션별 키워드 목록 조회

==== Request

include::{snippets}/keywords/find-childAll/http-request.adoc[]

==== Response

include::{snippets}/keywords/find-childAll/http-response.adoc[]

=== 세션별 키워드의 자식 목록 조회

==== Request

include::{snippets}/keywords/find-with-childAll/http-request.adoc[]

==== Response

include::{snippets}/keywords/find-with-childAll/http-response.adoc[]
42 changes: 42 additions & 0 deletions backend/src/documentation/adoc/quiz.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[[Quiz]]
== 퀴즈

=== 퀴즈 생성

==== Request

include::{snippets}/quiz/create/http-request.adoc[]

==== Response

include::{snippets}/quiz/create/http-response.adoc[]

=== 퀴즈 상세 조회

==== Request

include::{snippets}/quiz/detail/http-request.adoc[]

==== Response

include::{snippets}/quiz/detail/http-response.adoc[]

=== 키워드별 퀴즈 목록 조회

==== Request

include::{snippets}/quiz/list/http-request.adoc[]

==== Response

include::{snippets}/quiz/list/http-response.adoc[]

=== 퀴즈 삭제

==== Request

include::{snippets}/quiz/delete/http-request.adoc[]

==== Response

include::{snippets}/quiz/delete/http-response.adoc[]
32 changes: 32 additions & 0 deletions backend/src/documentation/adoc/recommend.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[[Recommend]]
== 추천 포스트

=== 추천 포스트 생성

==== Request

include::{snippets}/recommend/create/http-request.adoc[]

==== Response

include::{snippets}/recommend/create/http-response.adoc[]

=== 추천 포스트 수정

==== Request

include::{snippets}/recommend/update/http-request.adoc[]

==== Response

include::{snippets}/recommend/update/http-response.adoc[]

=== 추천 포스트 삭제

==== Request

include::{snippets}/recommend/delete/http-request.adoc[]

==== Response

include::{snippets}/recommend/delete/http-response.adoc[]
12 changes: 12 additions & 0 deletions backend/src/documentation/adoc/roadmap.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[Roadmap]]
== 로드맵

=== 로드맵 검색

==== Request

include::{snippets}/roadmap/find/http-request.adoc[]

==== Response

include::{snippets}/roadmap/find/http-response.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.filter.CharacterEncodingFilter;

@ActiveProfiles("docu")
@ExtendWith({RestDocumentationExtension.class})
Expand All @@ -27,6 +28,7 @@ public void setUp(WebApplicationContext webApplicationContext,
RestDocumentationContextProvider restDocumentation) {
given = RestAssuredMockMvc.given()
.mockMvc(MockMvcBuilders.webAppContextSetup(webApplicationContext)
.addFilter(new CharacterEncodingFilter("UTF-8", true))
.apply(documentationConfiguration(restDocumentation).operationPreprocessors()
.withRequestDefaults(prettyPrint())
.withResponseDefaults(prettyPrint()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import wooteco.prolog.NewDocumentation;
import wooteco.prolog.roadmap.application.CurriculumService;
import wooteco.prolog.roadmap.application.dto.CurriculumRequest;
Expand All @@ -22,6 +21,8 @@
@WebMvcTest(controllers = CurriculumController.class)
public class CurriculumDocumentation extends NewDocumentation {

private static final String UTF8_JSON_TYPE = "application/json;charset=UTF-8";

@MockBean
CurriculumService curriculumService;

Expand All @@ -30,7 +31,7 @@ public class CurriculumDocumentation extends NewDocumentation {
given(curriculumService.create(any())).willReturn(1L);

given
.contentType(MediaType.APPLICATION_JSON_VALUE)
.contentType(UTF8_JSON_TYPE)
.body(CURRICULUM_REQUEST)
.when().post("/curriculums")
.then().log().all().apply(document("curriculums/create"))
Expand All @@ -42,7 +43,7 @@ public class CurriculumDocumentation extends NewDocumentation {
given(curriculumService.findCurriculums()).willReturn(CURRICULUMS_RESPONSE);

given
.contentType(MediaType.APPLICATION_JSON_VALUE)
.contentType(UTF8_JSON_TYPE)
.body(CURRICULUM_REQUEST)
.when().get("/curriculums")
.then().log().all().apply(document("curriculums/find"))
Expand All @@ -54,7 +55,7 @@ public class CurriculumDocumentation extends NewDocumentation {
doNothing().when(curriculumService).update(any(), any());

given
.contentType(MediaType.APPLICATION_JSON_VALUE)
.contentType(UTF8_JSON_TYPE)
.body(CURRICULUM_EDIT_REQUEST)
.when().put("/curriculums/{curriculumId}", 1)
.then().log().all().apply(document("curriculums/update"))
Expand All @@ -66,7 +67,7 @@ public class CurriculumDocumentation extends NewDocumentation {
doNothing().when(curriculumService).delete(any());

given
.contentType(MediaType.APPLICATION_JSON_VALUE)
.contentType(UTF8_JSON_TYPE)
.when().delete("/curriculums/{curriculumId}", 1)
.then().log().all().apply(document("curriculums/delete"))
.statusCode(HttpStatus.NO_CONTENT.value());
Expand Down
Loading

0 comments on commit b0f6256

Please sign in to comment.