Skip to content

Comment API

Kwon soon won edited this page Nov 3, 2020 · 4 revisions

Comment API 개요

METHOD URL DESCRIPITION
GET /api/comment/:issueId comment list를 가져오기 comment list api
POST /api/comment comment를 생성 comment create api
PATCH /api/comment comment 수정하기 comment update api
DELETE /api/comment/:commentId comment 삭제하기 comment delete api

Comment list API

request

URL

GET /api/comment/:issueId

response

[
  {
    id: 1,
    isFirst: false,
    content: 'update2',
    createdAt: '2020-11-02T08:40:07.000Z',
    updatedAt: '2020-11-02T14:12:56.000Z',
    emojis: [
      {
        id: 1,
        name: 'airplane',
        imageUrl: 'https://homepages.cae.wisc.edu/~ece533/images/airplane.png',
        commentEmoji: {
          createdAt: '2020-11-02T08:40:07.000Z',
          updatedAt: '2020-11-02T08:40:07.000Z',
          emojiId: 1,
          commentId: 1,
        },
      },
    ],
    creater: {
      id: 1,
      email: 'kyle@example.com',
      imageUrl: null,
      name: null,
      createdAt: '2020-11-02T08:40:07.000Z',
      updatedAt: '2020-11-02T08:40:07.000Z',
    },
  },
]

Comment create API

request

URL

POST /api/comment

Body

NAME TYPE DESCRIPITION REQUIRED
isFirst Boolean 코멘트 status O
content String 코멘트 내용 O
createrId Int 생성자 ID O
issueId Int 이슈 ID O

이모지 추가해야 해용

JSON example

{
    "isFirst": true,
    "content": "create",
    "createrId": 1,
    "issueId": 1
}

response

{
    "id": 6,
    "isFirst": true,
    "content": "create",
    "createrId": 1,
    "issueId": 1,
    "updatedAt": "2020-11-03T06:51:41.207Z",
    "createdAt": "2020-11-03T06:51:41.207Z"
}

추후 결정

Comment update API

request

URL

PATCH /api/comment

Body

NAME TYPE DESCRIPITION REQUIRED
commentId Int commentID O
content String comment 내용 O

이모지 추가해야 해용

JSON example

{
    "commentId": 1,
    "content": "content example"
}

response

1

Comment delete API

request

URL

DELETE /api/comment/:commentId

response

1

Clone this wiki locally