Skip to content

의원 댓글 관련 API

sujin edited this page Feb 25, 2019 · 12 revisions

URL

[GET] ~/comment/:legi_id

예시 URL

[GET] ~/comment/100014

메소드 파라미터명 설명
header Content-Type application/json
params legi_id 의원 idx

응답예시

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

URL

[POST] ~/comment

예시 URL

[POST] ~/comment

메소드 파라미터명 설명
header Content-Type application/json
header token user token
body legi_id 의원 idx
body content 댓글 내용

응답예시

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

URL

[PUT] ~/comment

예시 URL

[PUT] ~/comment

메소드 파라미터명 설명
header Content-Type application/json
header token user token
body comment_idx 댓글 idx
body writer 작성자 idx
body content 댓글 내용

응답예시

{
    "status": 3202,
    "success": true,
    "message": "댓글 수정 성공"
}

URL

[DELETE] ~/comment

예시 URL

[DELETE] ~/comment

메소드 파라미터명 설명
header Content-Type application/json
header token user token (GET에는 필요 없음)
body comment_idx 댓글 idx
body writer 작성자 idx

응답 예시

{
    "status": 3203,
    "success": true,
    "message": "댓글 삭제 성공"
}

ERROR

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

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