Comment API
1. 게시글에 대한 댓글 리스트 조회
Request
GET /api/v1/comments/1505 HTTP/1.1
Accept: application/json
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 218
{
"code" : "SUCCESS",
"message" : "성공",
"data" : [ {
"commentId" : 35887,
"nickName" : "테스트유저1",
"content" : "댓글이란다.",
"createdAt" : "2024-03-25T12:10:58.845+00:00"
} ]
}
2. 댓글 작성
Request
POST /api/v1/comments HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NTgsImF1dGgiOiJVU0VSIiwidHlwZSI6Ik5PTkUifQ.tO7jkZcAfHp6fq2Ox9GJD89MTrKYm6Pb7LqCNuHT_JDmVUO7g46HOW-ZPrH5LTbqsPK9Nov4DbioAKvOV4lINQ
Accept: application/json
Content-Length: 65
Host: localhost:8080
{
"boardId" : 1507,
"content" : "짱구야, 공부 하자."
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 66
{
"code" : "SUCCESS",
"message" : "성공",
"data" : 35902
}
3. 댓글 수정
Request
PUT /api/v1/comments/35893 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NTgsImF1dGgiOiJVU0VSIiwidHlwZSI6Ik5PTkUifQ.tO7jkZcAfHp6fq2Ox9GJD89MTrKYm6Pb7LqCNuHT_JDmVUO7g46HOW-ZPrH5LTbqsPK9Nov4DbioAKvOV4lINQ
Accept: application/json
Content-Length: 65
Host: localhost:8080
{
"boardId" : 1506,
"content" : "짱구야, 공부 하자."
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 66
{
"code" : "SUCCESS",
"message" : "성공",
"data" : 35893
}
4. 댓글 삭제
Request
DELETE /api/v1/comments/35908 HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0X2pob3VzZV9jb20iLCJleHAiOjE3MTEzNzA0NTksImF1dGgiOiJVU0VSIiwidHlwZSI6Ik5PTkUifQ.-qn2SMFZQ_oc8QAuVHbajtHuMd9onfFAIeYHHhU6NsmaZjCLipWp7hFm_x4xaXLjGOfaM3TWIF9e_JJg-dr-Cg
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 48
{
"code" : "SUCCESS",
"message" : "성공"
}