From 4738ad96b1a9ec0718c0e94985ba9bbc87f65d03 Mon Sep 17 00:00:00 2001 From: java-saeng Date: Thu, 20 Jul 2023 14:18:50 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EC=B4=88=EA=B8=B0=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9E=90=20=EB=93=B1=EB=A1=9D=20API=20=EB=AC=B8?= =?UTF-8?q?=EC=84=9C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #66 --- backend/emm-sale/src/docs/asciidoc/index.adoc | 13 ++++ .../src/main/resources/static/docs/index.html | 62 ++++++++++++++++++- .../com/emmsale/member/api/MemberApiTest.java | 7 ++- 3 files changed, 80 insertions(+), 2 deletions(-) diff --git a/backend/emm-sale/src/docs/asciidoc/index.adoc b/backend/emm-sale/src/docs/asciidoc/index.adoc index 05ca6d291..0dd3718e7 100644 --- a/backend/emm-sale/src/docs/asciidoc/index.adoc +++ b/backend/emm-sale/src/docs/asciidoc/index.adoc @@ -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[] diff --git a/backend/emm-sale/src/main/resources/static/docs/index.html b/backend/emm-sale/src/main/resources/static/docs/index.html index 97f190990..7b6dea3b4 100644 --- a/backend/emm-sale/src/main/resources/static/docs/index.html +++ b/backend/emm-sale/src/main/resources/static/docs/index.html @@ -462,6 +462,11 @@

EMM-SALE API Docs

  • GET: 존재하는 커리어 전체 조회
  • +
  • Member + +
  • @@ -1398,11 +1403,66 @@

    +

    Member

    +
    +
    +

    POST: 초기 사용자 등록

    + + +++++ + + + + + + + + + + + + + + + + + + + +
    Table 20. HTTP request 설명
    PathTypeDescription

    careerIds

    Array

    활동 id들

    name

    String

    사용자 이름

    +
    +
    HTTP request
    +
    +
    POST /members HTTP/1.1
    +Content-Type: application/json
    +Content-Length: 49
    +Host: localhost:8080
    +
    +{
    +  "name" : "우르",
    +  "careerIds" : [ 1, 2 ]
    +}
    +
    +
    +
    +
    HTTP response
    +
    +
    HTTP/1.1 204 No Content
    +
    +
    +
    +
    + diff --git a/backend/emm-sale/src/test/java/com/emmsale/member/api/MemberApiTest.java b/backend/emm-sale/src/test/java/com/emmsale/member/api/MemberApiTest.java index 9ce91b87d..afebdbce9 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/member/api/MemberApiTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/member/api/MemberApiTest.java @@ -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