Skip to content

의원 댓글 관련 API

ihaeeun edited this page Feb 24, 2019 · 12 revisions

URL

[GET] ~/comment/:legi_id

[POST] ~/comment

[PUT] ~/comment

[DELETE] ~/comment/:comment_idx

메소드 파라미터명 설명
header Content-Type application/json
header token user token (GET에는 필요 없음)
params legi_id 의원 idx
params comment_idx 댓글 idx

예시 URL

[GET] ~/comment/100014

[POST] ~/comment

[PUT] ~/comment

[DELETE] ~/comment/5

응답예시

GET
{
    "status": 3200,
    "success": true,
    "message": "댓글 읽기 성공",
    "data": [
        {
            "idx": 2,
            "legi_idx": 100014,
            "writer": 4,
            "content": "test1",
            "writetime": "2019-02-24T06:46:07.000Z"
        }
    ]
}

#####[POST]

{
    "status": 3201,
    "success": true,
    "message": "댓글 작성 성공"
}

#####[PUT]

{
    "status": 3201,
    "success": true,
    "message": "댓글 작성 성공"
}

#####[DELETE]

{
    "status": 3201,
    "success": true,
    "message": "댓글 작성 성공"
}

####ERROR

{
    "status": 4604,
    "success": false,
    "message": "투표 결과 조회 실패",
    "data": null
}

토큰 값이 유효하지 않은 경우

{
    "status": "토큰값이 유효하지 않습니다.",
    "success": false,
    "message": null,
    "data": null
}