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 |
|---|---|---|
|
|
게시글 제목 |
|
|
게시글 본문 |
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : 1
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
작성된 게시글 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
| Parameter | Description |
|---|---|
|
게시글 id |
Request body
{
"title" : "수정된 게시글 제목",
"body" : "<p>수정된 게시글 본문입니다.</p>"
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
게시글 제목 |
|
|
게시글 본문 |
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
수정 완료 여부 |
게시글 삭제 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
| Parameter | Description |
|---|---|
|
게시글 id |
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
삭제 완료 여부 |
게시글 좋아요 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
| Parameter | Description |
|---|---|
|
게시글 id |
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
좋아요 완료 여부 |
게시글 좋아요 취소 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
| Parameter | Description |
|---|---|
|
게시글 id |
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
좋아요 완료 여부 |
게시글 목록 조회 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 |
|---|---|
|
페이지 |
|
페이지 사이즈 |
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 |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
페이지 |
|
|
페이지 사이즈 |
|
|
총 페이지 수 |
|
|
반환된 데이터 개수 |
|
|
전체 데이터 개수 |
|
|
게시글 목록 |
|
|
게시글 id |
|
|
게시글 썸네일 |
|
|
게시글 제목 |
|
|
게시글 조회수 |
|
|
게시글 좋아요 개수 |
|
|
게시글에 달린 댓글 개수 |
|
|
게시글이 작성된 시각 |
|
|
게시글 작성자 |
내가 작성한 게시글 목록 조회 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 |
|---|---|
|
페이지 |
|
페이지 사이즈 |
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 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 |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
페이지 |
|
|
페이지 사이즈 |
|
|
총 페이지 수 |
|
|
반환된 데이터 개수 |
|
|
전체 데이터 개수 |
|
|
게시글 목록 |
|
|
게시글 id |
|
|
게시글 제목 |
|
|
게시글이 작성된 시각 |
게시글 조회 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
| Parameter | Description |
|---|---|
|
게시글 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 |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
게시글 id |
|
|
게시글 제목 |
|
|
게시글 본문 |
|
|
게시글 조회수 |
|
|
게시글 좋아요 개수 |
|
|
게시글에 달린 댓글 개수 |
|
|
게시글이 작성된 시각 |
|
|
게시글 작성자 |
|
|
게시글 작성자 UUID |
|
|
게시글 작성자 썸네일 |
|
|
게시글 작성자 닉네임 |
게시글 반응 조회 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 |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : {
"articleId" : 1,
"isArticleLiked" : true,
"likedCommentIds" : [ 1, 3, 5 ]
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
게시글 id |
|
|
게시글 좋아요 여부 |
|
|
좋아요한 댓글 목록 |
댓글 작성 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
| Parameter | Description |
|---|---|
|
게시글 id |
Request body
{
"content" : "댓글 본문",
"imageUrl" : "https://emxaple.com/image.jpg"
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
댓글 본문 |
|
|
댓글 첨부 이미지 |
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 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 |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
댓글 id |
|
|
댓글 작성자 |
|
|
댓글 작성자 썸네일 |
|
|
댓글 본문 |
|
|
댓글 첨부 이미지 |
|
|
부모 댓글 id (답글인 경우) |
|
|
기준 댓글 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
| Parameter | Description |
|---|---|
|
게시글 id |
|
부모 댓글 id (답글을 달고자 하는 댓글 id) |
Request body
{
"content" : "댓글 본문",
"imageUrl" : "https://emxaple.com/image.jpg"
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
댓글 본문 |
|
|
댓글 첨부 이미지 |
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 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 |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
댓글 id |
|
|
댓글 작성자 |
|
|
댓글 작성자 썸네일 |
|
|
댓글 본문 |
|
|
댓글 첨부 이미지 |
|
|
부모 댓글 id (답글인 경우) |
|
|
기준 댓글 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
| Parameter | Description |
|---|---|
|
게시글 id |
|
댓글 id |
Request body
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
댓글 삭제 여부 |
댓글 좋아요 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
| Parameter | Description |
|---|---|
|
게시글 id |
|
댓글 id |
Request body
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
댓글 좋아요 여부 |
댓글 좋아요 취소 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
| Parameter | Description |
|---|---|
|
게시글 id |
|
댓글 id |
Request body
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
댓글 좋아요 취소 여부 |
댓글 목록 조회 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
| Parameter | Description |
|---|---|
|
게시글 id |
Query parameters
| Parameter | Description |
|---|---|
|
페이지 |
|
페이지 사이즈 |
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 |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
페이지 |
|
|
페이지 사이즈 |
|
|
총 페이지 수 |
|
|
반환된 데이터 개수 |
|
|
전체 데이터 개수 |
|
|
댓글 목록 |
|
|
댓글 제목 |
|
|
게시글 id |
|
|
부모 댓글 id (답글인 경우) |
|
|
기준 댓글 id |
|
|
댓글 본문 |
|
|
댓글 첨부 이미지 |
|
|
댓글 좋아요 수 |
|
|
댓글 작성자 UUID |
|
|
댓글 작성자 닉네임 |
|
|
댓글 작성자 썸네일 |
|
|
댓글 작성된 시각 |
|
|
게시글 작성자 |
내가 작성한 댓글 목록 조회 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 |
|---|---|
|
페이지 |
|
페이지 사이즈 |
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 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 |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
페이지 |
|
|
페이지 사이즈 |
|
|
총 페이지 수 |
|
|
반환된 데이터 개수 |
|
|
전체 데이터 개수 |
|
|
댓글 목록 |
|
|
댓글 제목 |
|
|
게시글 id |
|
|
댓글 본문 |
|
|
댓글 첨부 이미지 |
|
|
댓글 작성된 시각 |
작성된 댓글 페이지 오프셋 조회 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
| Parameter | Description |
|---|---|
|
댓글 id |
Query parameters
| Parameter | Description |
|---|---|
|
페이지 사이즈 |
Request body
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : 3
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
페이지 오프셋 |