Skip to content

api_spec

chlwlgus4 edited this page Dec 15, 2021 · 29 revisions

๊ฐœ์š”

  • api ์ŠคํŽ™

ํšŒ์› API

ํšŒ์›๊ฐ€์ž…

  • api: /api/v1/user/signup
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
  • request_body
{
    "email": "hello@world.com",
    "password": "password",
    "nickname": "testuser"
}
  • ์„ฑ๊ณต ์‘๋‹ต
201 CREATED
{
  "id": "1" ; ์ƒ์„ฑ id
}

๋กœ๊ทธ์ธ

  • api: /api/v1/user/signin
  • http method: POST
  • request_body: json
{
  "email": "",
  "password": ""
}
  • ์„ฑ๊ณต ์‘๋‹ต
    • status_code: 200 OK
    • header: Authorization bearer return
  • ์‹คํŒจ ์‘๋‹ต
    • status_code: 401 Unauthorized

๋กœ๊ทธ์•„์›ƒ (to do)

  • api: /api/v1/user/logout

  • http method: POST

  • ์„ฑ๊ณต ์‘๋‹ต

200 OK

์นดํ…Œ๊ณ ๋ฆฌ ์กฐํšŒ

  • api: /category
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์นดํ…Œ๊ณ ๋ฆฌ ์ƒ์„ฑ

  • api: /category
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
cookie: "JESSIONID: <id>"
  • request_body
{
    "name": "",
    "parentId": 0L
}

์นดํ…Œ๊ณ ๋ฆฌ ์ˆ˜์ •

  • api: /category/{category_id}
  • http method: PUT
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
cookie: "JESSIONID: <id>"
  • request_body
{
    "name": "",
    "parentId": ""
}

์นดํ…Œ๊ณ ๋ฆฌ ์‚ญ์ œ

  • api: /category/{category_id}
  • http method: DELETE
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
cookie: "JESSIONID: <id>"

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œํŒ ์กฐํšŒ

  • api: /board
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์ปค๋ฎค๋‹ˆํ‹ฐ ํšŒ์›๋ณ„ ๊ฒŒ์‹œํŒ ์กฐํšŒ

  • api: /board/{account_id}
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์ปค๋ฎค๋‹ˆํ‹ฐ ํŠน์ • ๊ฒŒ์‹œ๋ฌผ ์กฐํšŒ

  • api: /board/{board_id}
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œ๋ฌผ ์ž‘์„ฑ

  • api: /board
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
cookie: "JESSIONID: <id>"
  • request_body
{
    "content": "",
    "account": {}
}

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œ๋ฌผ ์ˆ˜์ •

  • api: /board/{board_id}
  • http method: PUT
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
cookie: "JESSIONID: <id>"
  • request_body
{
    "content": "",
}

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œ๋ฌผ ์‚ญ์ œ

  • api: /board/{board_id}
  • http method: DELETE
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
cookie: "JESSIONID: <id>"

[์‹ค๋‚ด์ •์›์šฉ ์‹๋ฌผ API]

์‹ค๋‚ด์ •์›์šฉ ์‹๋ฌผ ๋ชฉ๋ก

  • api: /gardenList
  • request_body
{
  "sType" : (ํ•œ๋ช… : sPlntbneNm, ์‹๋ฌผ๋ช… : sCntntsSj, ์˜๋ช… : sPlntzrNm)
  "sText" : (๊ฒ€์ƒ‰์–ด)
  "word" : (ใ„ฑ & ใ„ด & A & B)
}

์‹ค๋‚ด์ •์›์šฉ ์‹๋ฌผ ์ƒ์„ธ

  • api: /gardenDtl/{cntntsNo}
  • request_heder ์ปจํ…์ธ ๋ฒˆํ˜ธ