Skip to content

Commit

Permalink
Merge pull request #36 from f-lab-edu/feature/35
Browse files Browse the repository at this point in the history
[#35] restdocs도입
  • Loading branch information
f-lab-moony authored Feb 11, 2024
2 parents b2353e7 + ee1b497 commit fc83b72
Show file tree
Hide file tree
Showing 55 changed files with 14,848 additions and 0 deletions.
44 changes: 44 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ plugins {
id 'groovy'
id 'org.springframework.boot' version '3.2.1'
id 'io.spring.dependency-management' version '1.1.4'
id "org.asciidoctor.jvm.convert" version "3.3.2"
}

configurations {
asciidoctorExt
}

group = 'com'
Expand Down Expand Up @@ -38,6 +43,8 @@ dependencies {
testImplementation 'org.springframework.security:spring-security-test'
implementation 'org.springframework.session:spring-session-data-redis'
testImplementation 'org.springframework.batch:spring-batch-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'

// 구글 지오코딩 api
implementation 'com.google.maps:google-maps-services:2.2.0'
Expand All @@ -52,6 +59,43 @@ dependencies {
testAnnotationProcessor 'org.projectlombok:lombok'
}

ext {
snippetsDir = file('build/generated-snippets')
}

test {
outputs.dir snippetsDir
}

bootJar {
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}

tasks.named('test') {
useJUnitPlatform()
}


asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
dependsOn test
baseDirFollowsSourceFile()
}

asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}

task copyDocument(type: Copy) {
dependsOn asciidoctor
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}

build {
dependsOn copyDocument
}
2 changes: 2 additions & 0 deletions src/docs/asciidoc/CancelLike.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Like a feed
operation::like-controller-test/Cancel like[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/CreateADiary.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Create a diary
operation::diary-controller-test/Create a diary[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/CreateChildComment.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Create a nested comment
operation::comment-controller-test/Create child comment[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/CreateComment.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Create a comment
operation::comment-controller-test/Create comment[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/CreateFeed.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Create a feed
operation::feed-controller-test/Create Feed[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/DeleteADiary.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Delete a diary
operation::diary-controller-test/Delete a diary[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/DeleteAFeed.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get a feed
operation::feed-controller-test/Delete a feed[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/DeleteComments.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Delete a comment
operation::comment-controller-test/Delete a comment[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetAFeed.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get a feed
operation::feed-controller-test/Get a feed[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetChildComments.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get child comments
operation::comment-controller-test/Get child comments[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetComments.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get comments
operation::comment-controller-test/Get comments[snippets="http-request,http-response,path-parameters,query-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetDailyHotFeeds.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get daily hot feeds
operation::ranking-controller-test/get daily-hot-feeds[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetDiariesOfAMember.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get diaries of a member
operation::diary-controller-test/Get diaries of a member[snippets="http-request,http-response,path-parameters,query-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetFeedsByTag.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get feeds by tag
operation::feed-controller-test/Get feeds by tag[snippets="http-request,http-response,path-parameters,query-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetFeedsOfMember.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get feeds of member
operation::feed-controller-test/Get feeds of member[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetMonthlyHotFeeds.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get monthly hot feeds
operation::ranking-controller-test/get monthly-hot-feeds[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetPopularAbroadSpots.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get popular abroad spots
operation::ranking-controller-test/Get popular abroad spots[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetPopularDomesticSpots.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get popular domestic spots
operation::ranking-controller-test/Get popular domestic spots[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/GetWeeklyHotFeeds.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get weekly hot feeds
operation::ranking-controller-test/get weekly-hot-feeds[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/JoinMember.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== JoinMember
operation::member-controller-test/JoinMember[snippets="http-request,http-response"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/LikeAFeed.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Like a feed
operation::like-controller-test/Like a feed[snippets="http-request,http-response,path-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/UpdateAFeed.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Get a feed
operation::feed-controller-test/Update a feed[snippets="http-request,http-response,path-parameters"]
30 changes: 30 additions & 0 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
= Stoury API docs
:doctype: book
:source-highlighter: highlightjs
:toc: left
:toclevels: 2
:seclinks:

include::JoinMember.adoc[]
include::CreateFeed.adoc[]
include::GetAFeed.adoc[]
include::GetFeedsByTag.adoc[]
include::GetFeedsOfMember.adoc[]
include::UpdateAFeed.adoc[]
include::DeleteAFeed.adoc[]
include::LikeAFeed.adoc[]
include::CancelLike.adoc[]
include::CreateComment.adoc[]
include::CreateChildComment.adoc[]
include::GetComments.adoc[]
include::GetChildComments.adoc[]
include::DeleteComments.adoc[]
include::CreateADiary.adoc[]
include::GetDiariesOfAMember.adoc[]
include::DeleteADiary.adoc[]
include::GetPopularDomesticSpots.adoc[]
include::GetPopularAbroadSpots.adoc[]
include::GetDailyHotFeeds.adoc[]
include::GetWeeklyHotFeeds.adoc[]
include::GetMonthlyHotFeeds.adoc[]

Loading

0 comments on commit fc83b72

Please sign in to comment.