forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #73 from kookmin-sw/backend/develop/v3
Backend/develop/v3
- Loading branch information
Showing
28 changed files
with
4,604 additions
and
26 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.
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/moment/moment-server/auth/src/docs/asciidoc/Auth.adoc
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 @@ | ||
== Auth | ||
:doctype: book | ||
:source-highlighter: highlightjs | ||
:sectlinks: | ||
:toc: left | ||
:toclevels: 3 | ||
=== 로그인 | ||
operation::auth/login[snippets="http-request,request-body,request-fields,http-response,response-fields"] | ||
=== 비밀번호 변경 | ||
operation::auth/changePassword[snippets="http-request,request-headers,request-body,request-fields,http-response,response-fields"] | ||
=== 인증코드 요청 | ||
operation::auth/sendCode[snippets="http-request,request-body,request-fields,http-response,response-fields"] | ||
=== 인증코드 확인 | ||
operation::auth/verifyCode[snippets="http-request,request-headers,request-body,request-fields,http-response,response-fields"] |
10 changes: 10 additions & 0 deletions
10
backend/moment/moment-server/auth/src/docs/asciidoc/index.adoc
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,10 @@ | ||
// index.adoc | ||
= Moment Application API Document | ||
:doctype: book | ||
:source-highlighter: highlightjs | ||
:sectlinks: | ||
:toc: left | ||
:toclevels: 3 | ||
|
||
include::Auth.adoc[] | ||
|
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
20 changes: 20 additions & 0 deletions
20
...ment/moment-server/auth/src/test/java/com/moment/auth/config/DocumentFormatGenerator.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,20 @@ | ||
package com.moment.auth.config; | ||
|
||
import org.springframework.restdocs.snippet.Attributes; | ||
|
||
import static org.springframework.restdocs.snippet.Attributes.key; | ||
|
||
public interface DocumentFormatGenerator { | ||
|
||
static Attributes.Attribute getDateFormat() { // (2) | ||
return key("format").value("yyyy-MM-dd"); | ||
} | ||
|
||
static Attributes.Attribute getDateTimeFormat() { // (2) | ||
return key("format").value("yyyy-MM-dd'T'HH:mm:ss"); | ||
} | ||
|
||
static Attributes.Attribute getBooleanFormat() { // (3) | ||
return key("format").value("true or false"); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
backend/moment/moment-server/auth/src/test/java/com/moment/auth/config/RestDocsBasic.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,47 @@ | ||
package com.moment.auth.config; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.restdocs.RestDocumentationContextProvider; | ||
import org.springframework.restdocs.RestDocumentationExtension; | ||
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation; | ||
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler; | ||
import org.springframework.test.web.servlet.MockMvc; | ||
import org.springframework.test.web.servlet.result.MockMvcResultHandlers; | ||
import org.springframework.test.web.servlet.setup.MockMvcBuilders; | ||
import org.springframework.web.context.WebApplicationContext; | ||
import org.springframework.web.filter.CharacterEncodingFilter; | ||
|
||
@Import(RestDocsConfiguration.class) | ||
@ExtendWith(RestDocumentationExtension.class) | ||
//@WebMvcTest(MemberController.class) | ||
public class RestDocsBasic { | ||
|
||
@Autowired | ||
MockMvc mvc; | ||
|
||
@Autowired | ||
RestDocumentationResultHandler restDocs; | ||
|
||
@Autowired | ||
ObjectMapper mapper; | ||
|
||
@BeforeEach | ||
void setUp(WebApplicationContext context, RestDocumentationContextProvider provider){ | ||
this.mvc= MockMvcBuilders.webAppContextSetup(context) | ||
.apply(MockMvcRestDocumentation.documentationConfiguration(provider)) | ||
.alwaysDo(MockMvcResultHandlers.print()) | ||
.alwaysDo(restDocs) | ||
.addFilters(new CharacterEncodingFilter("UTF-8",true)) | ||
.build(); | ||
} | ||
|
||
protected String createStringJson(Object dto) throws JsonProcessingException { | ||
return mapper.writeValueAsString(dto); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...moment/moment-server/auth/src/test/java/com/moment/auth/config/RestDocsConfiguration.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,17 @@ | ||
package com.moment.auth.config; | ||
|
||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation; | ||
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler; | ||
import org.springframework.restdocs.operation.preprocess.Preprocessors; | ||
|
||
@TestConfiguration | ||
public class RestDocsConfiguration { | ||
@Bean | ||
public RestDocumentationResultHandler write() { | ||
return MockMvcRestDocumentation.document("{class-name}/{method-name}", | ||
Preprocessors.preprocessRequest(Preprocessors.prettyPrint()), | ||
Preprocessors.preprocessResponse(Preprocessors.prettyPrint())); | ||
} | ||
} |
Oops, something went wrong.