API 목록

게시글 작성 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-USER-ID: 1' \
    -d '{
  "title" : "게시글 제목",
  "body" : "<p>게시글 본문입니다.</p>"
}'

HTTP request

POST /api/v2/articles HTTP/1.1
Content-Type: application/json
X-USER-ID: 1
Content-Length: 82
Host: localhost:8080

{
  "title" : "게시글 제목",
  "body" : "<p>게시글 본문입니다.</p>"
}

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 76

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : 1
}

HTTPie request

$ echo '{
  "title" : "게시글 제목",
  "body" : "<p>게시글 본문입니다.</p>"
}' | http POST 'http://localhost:8080/api/v2/articles' \
    'Content-Type:application/json' \
    'X-USER-ID:1'

Request body

{
  "title" : "게시글 제목",
  "body" : "<p>게시글 본문입니다.</p>"
}

Request fields

Path Type Description

title

String

게시글 제목

body

String

게시글 본문

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : 1
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Number

작성된 게시글 id

게시글 수정 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'X-USER-ID: 1' \
    -d '{
  "title" : "수정된 게시글 제목",
  "body" : "<p>수정된 게시글 본문입니다.</p>"
}'

HTTP request

PUT /api/v2/articles/1 HTTP/1.1
Content-Type: application/json
X-USER-ID: 1
Content-Length: 102
Host: localhost:8080

{
  "title" : "수정된 게시글 제목",
  "body" : "<p>수정된 게시글 본문입니다.</p>"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ echo '{
  "title" : "수정된 게시글 제목",
  "body" : "<p>수정된 게시글 본문입니다.</p>"
}' | http PUT 'http://localhost:8080/api/v2/articles/1' \
    'Content-Type:application/json' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}
Parameter Description

articleId

게시글 id

Request body

{
  "title" : "수정된 게시글 제목",
  "body" : "<p>수정된 게시글 본문입니다.</p>"
}

Request fields

Path Type Description

title

String

게시글 제목

body

String

게시글 본문

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

수정 완료 여부

게시글 삭제 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1' -i -X DELETE \
    -H 'X-USER-ID: 1'

HTTP request

DELETE /api/v2/articles/1 HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ http DELETE 'http://localhost:8080/api/v2/articles/1' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}
Parameter Description

articleId

게시글 id

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

삭제 완료 여부

게시글 좋아요 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/like' -i -X PUT \
    -H 'X-USER-ID: 1'

HTTP request

PUT /api/v2/articles/1/like HTTP/1.1
X-USER-ID: 1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ http PUT 'http://localhost:8080/api/v2/articles/1/like' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}/like
Parameter Description

articleId

게시글 id

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

좋아요 완료 여부

게시글 좋아요 취소 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/like' -i -X DELETE \
    -H 'X-USER-ID: 1'

HTTP request

DELETE /api/v2/articles/1/like HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ http DELETE 'http://localhost:8080/api/v2/articles/1/like' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}/like
Parameter Description

articleId

게시글 id

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

좋아요 완료 여부

게시글 목록 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles?page=1&size=10' -i -X GET

HTTP request

GET /api/v2/articles?page=1&size=10 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 490

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articles" : [ {
      "articleId" : 1,
      "thumbnail" : "https://example.com/thumbnail.png",
      "title" : "게시글 제목",
      "viewCount" : 30,
      "likeCount" : 5,
      "commentCount" : 10,
      "savedAt" : "2024-03-13T14:22:51.456418314Z",
      "nickName" : "닉네임"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/articles?page=1&size=10'

Query parameters

Parameter Description

page

페이지

size

페이지 사이즈

Request body

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articles" : [ {
      "articleId" : 1,
      "thumbnail" : "https://example.com/thumbnail.png",
      "title" : "게시글 제목",
      "viewCount" : 30,
      "likeCount" : 5,
      "commentCount" : 10,
      "savedAt" : "2024-03-13T14:22:51.456418314Z",
      "nickName" : "닉네임"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.page

Number

페이지

data.size

Number

페이지 사이즈

data.totalPages

Number

총 페이지 수

data.numberOfElements

Number

반환된 데이터 개수

data.totalElements

Number

전체 데이터 개수

data.articles

Array

게시글 목록

data.articles[].articleId

Number

게시글 id

data.articles[].thumbnail

String

게시글 썸네일

data.articles[].title

String

게시글 제목

data.articles[].viewCount

Number

게시글 조회수

data.articles[].likeCount

Number

게시글 좋아요 개수

data.articles[].commentCount

Number

게시글에 달린 댓글 개수

data.articles[].savedAt

String

게시글이 작성된 시각

data.articles[].nickName

String

게시글 작성자

내가 작성한 게시글 목록 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/me?page=1&size=10' -i -X GET \
    -H 'X-USER-ID: 1'

HTTP request

GET /api/v2/articles/me?page=1&size=10 HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 327

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articles" : [ {
      "articleId" : 1,
      "title" : "게시글 제목",
      "savedAt" : "2024-03-13T14:22:51.229133584Z"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/articles/me?page=1&size=10' \
    'X-USER-ID:1'

Query parameters

Parameter Description

page

페이지

size

페이지 사이즈

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articles" : [ {
      "articleId" : 1,
      "title" : "게시글 제목",
      "savedAt" : "2024-03-13T14:22:51.229133584Z"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.page

Number

페이지

data.size

Number

페이지 사이즈

data.totalPages

Number

총 페이지 수

data.numberOfElements

Number

반환된 데이터 개수

data.totalElements

Number

전체 데이터 개수

data.articles

Array

게시글 목록

data.articles[].articleId

Number

게시글 id

data.articles[].title

String

게시글 제목

data.articles[].savedAt

String

게시글이 작성된 시각

게시글 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1' -i -X GET

HTTP request

GET /api/v2/articles/1 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 457

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articleId" : 1,
    "title" : "게시글 제목",
    "body" : "<p>게시글 본문</p>",
    "viewCount" : 30,
    "likeCount" : 5,
    "commentCount" : 10,
    "savedAt" : "2024-03-13T14:22:51.364467535Z",
    "user" : {
      "uuid" : "7dc06ebc-e9cb-40ab-8b42-571a49a30b92",
      "thumbnail" : "https://example.com/thumbnail.png",
      "nickName" : "닉네임"
    }
  }
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/articles/1'

Path parameters

Table 1. /api/v2/articles/{articleId}
Parameter Description

articleId

게시글 id

Request body

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articleId" : 1,
    "title" : "게시글 제목",
    "body" : "<p>게시글 본문</p>",
    "viewCount" : 30,
    "likeCount" : 5,
    "commentCount" : 10,
    "savedAt" : "2024-03-13T14:22:51.364467535Z",
    "user" : {
      "uuid" : "7dc06ebc-e9cb-40ab-8b42-571a49a30b92",
      "thumbnail" : "https://example.com/thumbnail.png",
      "nickName" : "닉네임"
    }
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.articleId

Number

게시글 id

data.title

String

게시글 제목

data.body

String

게시글 본문

data.viewCount

Number

게시글 조회수

data.likeCount

Number

게시글 좋아요 개수

data.commentCount

Number

게시글에 달린 댓글 개수

data.savedAt

String

게시글이 작성된 시각

data.user

Object

게시글 작성자

data.user.uuid

String

게시글 작성자 UUID

data.user.thumbnail

String

게시글 작성자 썸네일

data.user.nickName

String

게시글 작성자 닉네임

게시글 반응 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/reaction' -i -X GET \
    -H 'X-USER-ID: 1'

HTTP request

GET /api/v2/articles/1/reaction HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 166

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articleId" : 1,
    "isArticleLiked" : true,
    "likedCommentIds" : [ 1, 3, 5 ]
  }
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/articles/1/reaction' \
    'X-USER-ID:1'

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "articleId" : 1,
    "isArticleLiked" : true,
    "likedCommentIds" : [ 1, 3, 5 ]
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.articleId

Number

게시글 id

data.isArticleLiked

Boolean

게시글 좋아요 여부

data.likedCommentIds

Array

좋아요한 댓글 목록


댓글 작성 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/comments' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-USER-ID: 1' \
    -d '{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}'

HTTP request

POST /api/v2/articles/1/comments HTTP/1.1
Content-Type: application/json
X-USER-ID: 1
Content-Length: 81
Host: localhost:8080

{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 323

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "commentId" : 1,
    "nickName" : "닉네임",
    "thumbnail" : "https://example.com/thumbnail.png",
    "content" : "댓글 본문",
    "imageUrl" : "https://emxaple.com/image.jpg",
    "parentCommentId" : null,
    "baseCommentId" : 1
  }
}

HTTPie request

$ echo '{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}' | http POST 'http://localhost:8080/api/v2/articles/1/comments' \
    'Content-Type:application/json' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}/comments
Parameter Description

articleId

게시글 id

Request body

{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}

Request fields

Path Type Description

content

String

댓글 본문

imageUrl

String

댓글 첨부 이미지

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "commentId" : 1,
    "nickName" : "닉네임",
    "thumbnail" : "https://example.com/thumbnail.png",
    "content" : "댓글 본문",
    "imageUrl" : "https://emxaple.com/image.jpg",
    "parentCommentId" : null,
    "baseCommentId" : 1
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.commentId

Number

댓글 id

data.nickName

String

댓글 작성자

data.thumbnail

String

댓글 작성자 썸네일

data.content

String

댓글 본문

data.imageUrl

String

댓글 첨부 이미지

data.parentCommentId

Null

부모 댓글 id (답글인 경우)

data.baseCommentId

Number

기준 댓글 id

답글 작성 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/comments/1' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-USER-ID: 1' \
    -d '{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}'

HTTP request

POST /api/v2/articles/1/comments/1 HTTP/1.1
Content-Type: application/json
X-USER-ID: 1
Content-Length: 81
Host: localhost:8080

{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 320

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "commentId" : 2,
    "nickName" : "닉네임",
    "thumbnail" : "https://example.com/thumbnail.png",
    "content" : "댓글 본문",
    "imageUrl" : "https://emxaple.com/image.jpg",
    "parentCommentId" : 1,
    "baseCommentId" : 1
  }
}

HTTPie request

$ echo '{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}' | http POST 'http://localhost:8080/api/v2/articles/1/comments/1' \
    'Content-Type:application/json' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}/comments/{commentId}
Parameter Description

articleId

게시글 id

commentId

부모 댓글 id (답글을 달고자 하는 댓글 id)

Request body

{
  "content" : "댓글 본문",
  "imageUrl" : "https://emxaple.com/image.jpg"
}

Request fields

Path Type Description

content

String

댓글 본문

imageUrl

String

댓글 첨부 이미지

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "commentId" : 2,
    "nickName" : "닉네임",
    "thumbnail" : "https://example.com/thumbnail.png",
    "content" : "댓글 본문",
    "imageUrl" : "https://emxaple.com/image.jpg",
    "parentCommentId" : 1,
    "baseCommentId" : 1
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.commentId

Number

댓글 id

data.nickName

String

댓글 작성자

data.thumbnail

String

댓글 작성자 썸네일

data.content

String

댓글 본문

data.imageUrl

String

댓글 첨부 이미지

data.parentCommentId

Number

부모 댓글 id (답글인 경우)

data.baseCommentId

Number

기준 댓글 id

댓글 삭제 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/comments/1' -i -X DELETE \
    -H 'X-USER-ID: 1'

HTTP request

DELETE /api/v2/articles/1/comments/1 HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ http DELETE 'http://localhost:8080/api/v2/articles/1/comments/1' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}/comments/{commentId}
Parameter Description

articleId

게시글 id

commentId

댓글 id

Request body

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

댓글 삭제 여부

댓글 좋아요 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/comments/1/like' -i -X PUT \
    -H 'X-USER-ID: 1'

HTTP request

PUT /api/v2/articles/1/comments/1/like HTTP/1.1
X-USER-ID: 1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ http PUT 'http://localhost:8080/api/v2/articles/1/comments/1/like' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}/comments/{commentId}/like
Parameter Description

articleId

게시글 id

commentId

댓글 id

Request body

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

댓글 좋아요 여부

댓글 좋아요 취소 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/comments/1/like' -i -X DELETE \
    -H 'X-USER-ID: 1'

HTTP request

DELETE /api/v2/articles/1/comments/1/like HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ http DELETE 'http://localhost:8080/api/v2/articles/1/comments/1/like' \
    'X-USER-ID:1'

Path parameters

Table 1. /api/v2/articles/{articleId}/comments/{commentId}/like
Parameter Description

articleId

게시글 id

commentId

댓글 id

Request body

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

댓글 좋아요 취소 여부

댓글 목록 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/articles/1/comments?page=1&size=10' -i -X GET

HTTP request

GET /api/v2/articles/1/comments?page=1&size=10 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 636

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "comments" : [ {
      "commentId" : 1,
      "articleId" : 1,
      "parentCommentId" : null,
      "baseCommentId" : 1,
      "content" : "댓글 본문",
      "imageUrl" : "https://example.com/image.png",
      "likeCount" : 10,
      "userUUID" : "628b3116-e7cd-4cf2-92f2-4d326964ae49",
      "nickName" : "닉네임",
      "userThumbnail" : "https://example.com/thumbnail.png",
      "savedAt" : "2024-03-13T14:22:52.582376925Z"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/articles/1/comments?page=1&size=10'

Path parameters

Table 1. /api/v2/articles/{articleId}/comments
Parameter Description

articleId

게시글 id

Query parameters

Parameter Description

page

페이지

size

페이지 사이즈

Request body

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "comments" : [ {
      "commentId" : 1,
      "articleId" : 1,
      "parentCommentId" : null,
      "baseCommentId" : 1,
      "content" : "댓글 본문",
      "imageUrl" : "https://example.com/image.png",
      "likeCount" : 10,
      "userUUID" : "628b3116-e7cd-4cf2-92f2-4d326964ae49",
      "nickName" : "닉네임",
      "userThumbnail" : "https://example.com/thumbnail.png",
      "savedAt" : "2024-03-13T14:22:52.582376925Z"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.page

Number

페이지

data.size

Number

페이지 사이즈

data.totalPages

Number

총 페이지 수

data.numberOfElements

Number

반환된 데이터 개수

data.totalElements

Number

전체 데이터 개수

data.comments

Array

댓글 목록

data.comments[].commentId

Number

댓글 제목

data.comments[].articleId

Number

게시글 id

data.comments[].parentCommentId

Null

부모 댓글 id (답글인 경우)

data.comments[].baseCommentId

Number

기준 댓글 id

data.comments[].content

String

댓글 본문

data.comments[].imageUrl

String

댓글 첨부 이미지

data.comments[].likeCount

Number

댓글 좋아요 수

data.comments[].userUUID

String

댓글 작성자 UUID

data.comments[].nickName

String

댓글 작성자 닉네임

data.comments[].userThumbnail

String

댓글 작성자 썸네일

data.comments[].savedAt

String

댓글 작성된 시각

data.comments[].nickName

String

게시글 작성자

내가 작성한 댓글 목록 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/comments/me?page=1&size=10' -i -X GET \
    -H 'X-USER-ID: 1'

HTTP request

GET /api/v2/comments/me?page=1&size=10 HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 400

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "comments" : [ {
      "commentId" : 1,
      "articleId" : 1,
      "content" : "댓글 본문",
      "imageUrl" : "https://example.com/image.png",
      "savedAt" : "2024-03-13T14:22:52.47054557Z"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/comments/me?page=1&size=10' \
    'X-USER-ID:1'

Query parameters

Parameter Description

page

페이지

size

페이지 사이즈

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "comments" : [ {
      "commentId" : 1,
      "articleId" : 1,
      "content" : "댓글 본문",
      "imageUrl" : "https://example.com/image.png",
      "savedAt" : "2024-03-13T14:22:52.47054557Z"
    } ],
    "page" : 1,
    "size" : 10,
    "totalPages" : 1,
    "numberOfElements" : 1,
    "totalElements" : 1
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.page

Number

페이지

data.size

Number

페이지 사이즈

data.totalPages

Number

총 페이지 수

data.numberOfElements

Number

반환된 데이터 개수

data.totalElements

Number

전체 데이터 개수

data.comments

Array

댓글 목록

data.comments[].commentId

Number

댓글 제목

data.comments[].articleId

Number

게시글 id

data.comments[].content

String

댓글 본문

data.comments[].imageUrl

String

댓글 첨부 이미지

data.comments[].savedAt

String

댓글 작성된 시각

작성된 댓글 페이지 오프셋 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/comments/1/page?size=10' -i -X GET

HTTP request

GET /api/v2/comments/1/page?size=10 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 76

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : 3
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/comments/1/page?size=10'

Path parameters

Table 1. /api/v2/comments/{commentId}/page
Parameter Description

commentId

댓글 id

Query parameters

Parameter Description

size

페이지 사이즈

Request body

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : 3
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Number

페이지 오프셋