Skip to main content

Comment

Definition

comment.json
{
"id": 0,
"articleID": 0,
"userID": 0,
"commentTitle": "",
"commentContent": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Comments

curl -X GET "${baseUrl}/comment/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Comment

curl -X GET "${baseUrl}/comment/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply Comment.ID

curl -X POST "${baseUrl}/apply/comment/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create Comment

curl -X POST "${baseUrl}/comment/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @comment.json
info
comment.json
{
"articleID": 0,
"userID": 0,
"commentTitle": "",
"commentContent": "",
"status": 0,
}
tip

success status: 201

Update Comment

#!/bin/bash
curl -X PUT "${baseUrl}/comment/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @comment.json
info
comment.json
{
"articleID": 0,
"userID": 0,
"commentTitle": "",
"commentContent": "",
"status": 0,
}

Patch Comment

curl -X PATCH "${baseUrl}/comment/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: articleID,userID,commentTitle,commentContent,status" \
-d @comment.json
info
comment.json
{
"articleID": 0,
"userID": 0,
"commentTitle": "",
"commentContent": "",
"status": 0,
}

Update Comment Status

curl -X PATCH "${baseUrl}/comment/${id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @comment.json
info
comment.json
{
"status": 0
}

Destroy Comment

curl -X DELETE "${baseUrl}/comment/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"