Skip to content

Commit

Permalink
feat : 초기 사용자 등록 API 문서화
Browse files Browse the repository at this point in the history
  • Loading branch information
java-saeng committed Jul 20, 2023
1 parent 2f75d32 commit 4738ad9
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
13 changes: 13 additions & 0 deletions backend/emm-sale/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,16 @@ include::{snippets}/findAll-career/http-response.adoc[]

.HTTP response 설명
include::{snippets}/findAll-career/response-fields.adoc[]

== Member

=== `POST`: 초기 사용자 등록

.HTTP request 설명
include::{snippets}/initial-register-member/request-fields.adoc[]

.HTTP request
include::{snippets}/initial-register-member/http-request.adoc[]

.HTTP response
include::{snippets}/initial-register-member/http-response.adoc[]
62 changes: 61 additions & 1 deletion backend/emm-sale/src/main/resources/static/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ <h1>EMM-SALE API Docs</h1>
<li><a href="#_get_존재하는_커리어_전체_조회"><code>GET</code>: 존재하는 커리어 전체 조회</a></li>
</ul>
</li>
<li><a href="#_member">Member</a>
<ul class="sectlevel2">
<li><a href="#_post_초기_사용자_등록"><code>POST</code>: 초기 사용자 등록</a></li>
</ul>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -1398,11 +1403,66 @@ <h3 id="_get_존재하는_커리어_전체_조회"><a class="link" href="#_get_
</div>
</div>
</div>
<div class="sect1">
<h2 id="_member"><a class="link" href="#_member">Member</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_post_초기_사용자_등록"><a class="link" href="#_post_초기_사용자_등록"><code>POST</code>: 초기 사용자 등록</a></h3>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 20. HTTP request 설명</caption>
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Path</th>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>careerIds</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Array</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">활동 id들</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">사용자 이름</p></td>
</tr>
</tbody>
</table>
<div class="listingblock">
<div class="title">HTTP request</div>
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="http" class="language-http hljs">POST /members HTTP/1.1
Content-Type: application/json
Content-Length: 49
Host: localhost:8080

{
"name" : "우르",
"careerIds" : [ 1, 2 ]
}</code></pre>
</div>
</div>
<div class="listingblock">
<div class="title">HTTP response</div>
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="http" class="language-http hljs">HTTP/1.1 204 No Content</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Version 0.0.1-SNAPSHOT<br>
Last updated 2023-07-20 14:09:41 +0900
Last updated 2023-07-20 14:17:21 +0900
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/github.min.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@ void register() throws Exception {

final MemberCareerInitialRequest request = new MemberCareerInitialRequest(name, careerIds);

final RequestFieldsSnippet REQUEST_FIELDS = requestFields(
fieldWithPath("careerIds").description("활동 id들"),
fieldWithPath("name").description("사용자 이름"));

//when & then
mockMvc.perform(post("/members")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isNoContent())
.andDo(print());
.andDo(print())
.andDo(document("initial-register-member", REQUEST_FIELDS));
}

@Test
Expand Down

0 comments on commit 4738ad9

Please sign in to comment.