Blog API 문서

Table of Contents

Blog API 문서

업데이트 → ./gradlew test + ./gradlew asciidoctor

카테고리 API (공개)

전체 카테고리 조회

HTTP 요청

GET /api/categories HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/categories/request-fields.adoc[]

HTTP 응답

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

{
  "categoryResponses" : [ {
    "categoryId" : 34,
    "categoryName" : "Java1",
    "priority" : 0
  }, {
    "categoryId" : 35,
    "categoryName" : "Java2",
    "priority" : 0
  } ]
}

응답 필드

Path Type Description

categoryResponses

Array

카테고리 목록

categoryResponses[].categoryId

Number

카테고리 아이디

categoryResponses[].categoryName

String

저장된 카테고리 이름

categoryResponses[].priority

Number

카테고리 우선순위

카테고리별 포스트 수 조회

HTTP 요청

GET /api/categories/stats HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get -/api/categories/stats 카테고리 + 카테고리 별 post 수/request-fields.adoc[]

HTTP 응답

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

{
  "CategoryWithCountResponses" : [ {
    "categoryId" : 36,
    "categoryName" : "Java1",
    "postCount" : 0,
    "priority" : 0
  }, {
    "categoryId" : 37,
    "categoryName" : "Java2",
    "postCount" : 0,
    "priority" : 0
  } ]
}

응답 필드

Path Type Description

CategoryWithCountResponses

Array

카테고리 목록

CategoryWithCountResponses[].categoryId

Number

카테고리 아이디

CategoryWithCountResponses[].categoryName

String

저장된 카테고리 이름

CategoryWithCountResponses[].postCount

Number

해당 카테고리 Post 수

CategoryWithCountResponses[].priority

Number

카테고리 우선순위

카테고리 API (관리자)

카테고리 추가 (관리자)

HTTP 요청

POST /api/admin/categories HTTP/1.1
Content-Type: application/json
Content-Length: 56
Host: localhost:8080

{
  "categoryName" : "테스트1",
  "priority" : 1
}

요청 필드

Path Type Description

categoryName

String

추가 카테고리 이름

priority

Number

카테고리 우선순위

HTTP 응답

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

{
  "categoryResponses" : [ {
    "categoryId" : 23,
    "categoryName" : "Java1",
    "priority" : 0
  }, {
    "categoryId" : 24,
    "categoryName" : "Java2",
    "priority" : 0
  }, {
    "categoryId" : 25,
    "categoryName" : "테스트1",
    "priority" : 1
  } ]
}

응답 필드

Path Type Description

categoryResponses

Array

카테고리 목록

categoryResponses[].categoryId

Number

카테고리 아이디

categoryResponses[].categoryName

String

저장된 카테고리 이름

categoryResponses[].priority

Number

카테고리 우선순위

카테고리 삭제 (관리자)

HTTP 요청

DELETE /api/admin/categories HTTP/1.1
Content-Type: application/json
Content-Length: 59
Host: localhost:8080

{
  "categoryId" : 28,
  "categoryName" : "테스트1"
}

요청 필드

Path Type Description

categoryId

Number

삭제 카테고리 Id

categoryName

String

삭제 카테고리 이름

HTTP 응답

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

{
  "categoryResponses" : [ {
    "categoryId" : 26,
    "categoryName" : "Java1",
    "priority" : 0
  }, {
    "categoryId" : 27,
    "categoryName" : "Java2",
    "priority" : 0
  } ]
}

응답 필드

Path Type Description

categoryResponses

Array

카테고리 목록

categoryResponses[].categoryId

Number

카테고리 아이디

categoryResponses[].categoryName

String

저장된 카테고리 이름

categoryResponses[].priority

Number

카테고리 우선순위

카테고리 이름 수정 (관리자)

HTTP 요청

PUT /api/admin/categories HTTP/1.1
Content-Type: application/json
Content-Length: 92
Host: localhost:8080

{
  "categoryId" : 29,
  "categoryName" : "변경된카테고리명",
  "priority" : 2
}

요청 필드

Path Type Description

categoryId

Number

변경할 카테고리 아이디

categoryName

String

변경 할 테스트 카테고리 명

priority

Number

카테고리 우선순위

HTTP 응답

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

{
  "categoryResponses" : [ {
    "categoryId" : 30,
    "categoryName" : "Java2",
    "priority" : 0
  }, {
    "categoryId" : 29,
    "categoryName" : "변경된카테고리명",
    "priority" : 2
  } ]
}

응답 필드

Path Type Description

categoryResponses

Array

카테고리 목록

categoryResponses[].categoryId

Number

카테고리 아이디

categoryResponses[].categoryName

String

저장된 카테고리 이름

categoryResponses[].priority

Number

카테고리 우선순위

포스트 API (공개)

전체 포스트 조회

HTTP 요청

GET /api/posts HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/posts/request-fields.adoc[]

HTTP 응답

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

{
  "content" : [ {
    "postId" : 51,
    "title" : "Java 기초 문법 정리",
    "memberName" : "testName",
    "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 53,
    "title" : "React Hook 사용법",
    "memberName" : "testName",
    "content" : "React의 useState, useEffect 등 주요 Hook들의 사용법을 정리했습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 55,
    "title" : "MySQL 최적화 팁",
    "memberName" : "testName",
    "content" : "데이터베이스 성능을 향상시키는 다양한 방법들을 알아봅시다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 57,
    "title" : "Docker 컨테이너 활용",
    "memberName" : "testName",
    "content" : "Docker를 이용한 개발 환경 구축과 배포 방법을 다룹니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 59,
    "title" : "Git 브랜치 전략",
    "memberName" : "testName",
    "content" : "효율적인 Git 브랜치 관리와 협업 방법을 소개합니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  } ],
  "pageNumber" : 0,
  "pageSize" : 5,
  "totalElements" : 5,
  "totalPages" : 1,
  "first" : true,
  "last" : true
}

응답 필드

Path Type Description

content

Array

포스트

content[].postId

Number

포스트 Id

content[].title

String

제목

content[].memberName

String

작성자 이름

content[].content

String

내용

content[].categoryName

String

카테고리 이름

content[].status

String

enum + 상태

content[].regDate

String

저장 날짜

pageNumber

Number

페이지 넘버

pageSize

Number

페이지 사이즈

totalElements

Number

총 elements 갯수

totalPages

Number

총 페이지

first

Boolean

처음인지 아닌지

last

Boolean

마지막인지 아닌지

카테고리별 포스트 조회

HTTP 요청

GET /api/posts/category?categoryName=Java1 HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-api-posts-category/request-fields.adoc[]

HTTP 응답

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

{
  "content" : [ {
    "postId" : 61,
    "title" : "Java 기초 문법 정리",
    "memberName" : "testName",
    "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 63,
    "title" : "React Hook 사용법",
    "memberName" : "testName",
    "content" : "React의 useState, useEffect 등 주요 Hook들의 사용법을 정리했습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 65,
    "title" : "MySQL 최적화 팁",
    "memberName" : "testName",
    "content" : "데이터베이스 성능을 향상시키는 다양한 방법들을 알아봅시다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 67,
    "title" : "Docker 컨테이너 활용",
    "memberName" : "testName",
    "content" : "Docker를 이용한 개발 환경 구축과 배포 방법을 다룹니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 69,
    "title" : "Git 브랜치 전략",
    "memberName" : "testName",
    "content" : "효율적인 Git 브랜치 관리와 협업 방법을 소개합니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  } ],
  "pageNumber" : 0,
  "pageSize" : 5,
  "totalElements" : 5,
  "totalPages" : 1,
  "first" : true,
  "last" : true
}

응답 필드

Path Type Description

content

Array

포스트

content[].postId

Number

포스트 Id

content[].title

String

제목

content[].memberName

String

작성자 이름

content[].content

String

내용

content[].categoryName

String

카테고리 이름

content[].status

String

enum + 상태

content[].regDate

String

저장 날짜

pageNumber

Number

페이지 넘버

pageSize

Number

페이지 사이즈

totalElements

Number

총 elements 갯수

totalPages

Number

총 페이지

first

Boolean

처음인지 아닌지

last

Boolean

마지막인지 아닌지

단일 포스트 조회

HTTP 요청

GET /api/posts/single?postId=71 HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-api-posts-single/request-fields.adoc[]

HTTP 응답

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

{
  "postId" : 71,
  "title" : "Java 기초 문법 정리",
  "memberName" : "testName",
  "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
  "categoryName" : "Java1",
  "status" : "PUBLISHED",
  "regDate" : "2025-07-04 19:03"
}

응답 필드

Path Type Description

postId

Number

포스트 Id

title

String

제목

memberName

String

작성자 이름

content

String

내용

categoryName

String

카테고리 이름

status

String

enum + 상태

regDate

String

저장 날짜

포스트 API (관리자)

전체 포스트 조회 (관리자)

HTTP 요청

GET /api/admin/posts HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/admin/posts/request-fields.adoc[]

HTTP 응답

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

{
  "content" : [ {
    "postId" : 1,
    "title" : "Java 기초 문법 정리",
    "memberName" : "testName",
    "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 2,
    "title" : "Spring Boot 시작하기",
    "memberName" : "testName",
    "content" : "Spring Boot로 웹 애플리케이션을 개발하는 방법을 소개합니다.",
    "categoryName" : "Java2",
    "status" : "PRIVATE",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 3,
    "title" : "React Hook 사용법",
    "memberName" : "testName",
    "content" : "React의 useState, useEffect 등 주요 Hook들의 사용법을 정리했습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 4,
    "title" : "JavaScript ES6+ 문법",
    "memberName" : "testName",
    "content" : "최신 JavaScript 문법과 기능들을 예제와 함께 설명합니다.",
    "categoryName" : "Java2",
    "status" : "PRIVATE",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 5,
    "title" : "MySQL 최적화 팁",
    "memberName" : "testName",
    "content" : "데이터베이스 성능을 향상시키는 다양한 방법들을 알아봅시다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  } ],
  "pageNumber" : 0,
  "pageSize" : 5,
  "totalElements" : 10,
  "totalPages" : 2,
  "first" : true,
  "last" : false
}

응답 필드

Path Type Description

content

Array

포스트

content[].postId

Number

포스트 Id

content[].title

String

제목

content[].memberName

String

작성자 이름

content[].content

String

내용

content[].categoryName

String

카테고리 이름

content[].status

String

enum + 상태

content[].regDate

String

저장 날짜

pageNumber

Number

페이지 넘버

pageSize

Number

페이지 사이즈

totalElements

Number

총 elements 갯수

totalPages

Number

총 페이지

first

Boolean

처음인지 아닌지

last

Boolean

마지막인지 아닌지

통합 포스트 조회 (관리자)

HTTP 요청

GET /api/admin/posts?categoryName=Java1&postStatus=PUBLISHED&page=0&size=2 HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/admin/posts Integration Api/request-fields.adoc[]

HTTP 응답

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

{
  "content" : [ {
    "postId" : 41,
    "title" : "Java 기초 문법 정리",
    "memberName" : "testName",
    "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 43,
    "title" : "React Hook 사용법",
    "memberName" : "testName",
    "content" : "React의 useState, useEffect 등 주요 Hook들의 사용법을 정리했습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  } ],
  "pageNumber" : 0,
  "pageSize" : 2,
  "totalElements" : 5,
  "totalPages" : 3,
  "first" : true,
  "last" : false
}

응답 필드

Path Type Description

content

Array

포스트

content[].postId

Number

포스트 Id

content[].title

String

제목

content[].memberName

String

작성자 이름

content[].content

String

내용

content[].categoryName

String

카테고리 이름

content[].status

String

enum + 상태

content[].regDate

String

저장 날짜

pageNumber

Number

페이지 넘버

pageSize

Number

페이지 사이즈

totalElements

Number

총 elements 갯수

totalPages

Number

총 페이지

first

Boolean

처음인지 아닌지

last

Boolean

마지막인지 아닌지

카테고리별 포스트 조회 (관리자)

HTTP 요청

GET /api/admin/posts?categoryName=Java1 HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/admin/posts and categoryName para/request-fields.adoc[]

HTTP 응답

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

{
  "content" : [ {
    "postId" : 11,
    "title" : "Java 기초 문법 정리",
    "memberName" : "testName",
    "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 13,
    "title" : "React Hook 사용법",
    "memberName" : "testName",
    "content" : "React의 useState, useEffect 등 주요 Hook들의 사용법을 정리했습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 15,
    "title" : "MySQL 최적화 팁",
    "memberName" : "testName",
    "content" : "데이터베이스 성능을 향상시키는 다양한 방법들을 알아봅시다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 17,
    "title" : "Docker 컨테이너 활용",
    "memberName" : "testName",
    "content" : "Docker를 이용한 개발 환경 구축과 배포 방법을 다룹니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 19,
    "title" : "Git 브랜치 전략",
    "memberName" : "testName",
    "content" : "효율적인 Git 브랜치 관리와 협업 방법을 소개합니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  } ],
  "pageNumber" : 0,
  "pageSize" : 5,
  "totalElements" : 5,
  "totalPages" : 1,
  "first" : true,
  "last" : true
}

응답 필드

Path Type Description

content

Array

포스트

content[].postId

Number

포스트 Id

content[].title

String

제목

content[].memberName

String

작성자 이름

content[].content

String

내용

content[].categoryName

String

카테고리 이름

content[].status

String

enum + 상태

content[].regDate

String

저장 날짜

pageNumber

Number

페이지 넘버

pageSize

Number

페이지 사이즈

totalElements

Number

총 elements 갯수

totalPages

Number

총 페이지

first

Boolean

처음인지 아닌지

last

Boolean

마지막인지 아닌지

단일 포스트 조회 (관리자)

HTTP 요청

GET /api/admin/posts/single?postId=21 HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/admin/posts/single/request-fields.adoc[]

HTTP 응답

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

{
  "postId" : 21,
  "title" : "Java 기초 문법 정리",
  "memberName" : "testName",
  "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
  "categoryName" : "Java1",
  "status" : "PUBLISHED",
  "regDate" : "2025-07-04 19:03"
}

응답 필드

Path Type Description

postId

Number

포스트 Id

title

String

제목

memberName

String

작성자 이름

content

String

내용

categoryName

String

카테고리 이름

status

String

enum + 상태

regDate

String

저장 날짜

상태별 포스트 조회 (관리자)

HTTP 요청

GET /api/admin/posts?postStatus=PUBLISHED HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/admin/posts and postStatus para/request-fields.adoc[]

HTTP 응답

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

{
  "content" : [ {
    "postId" : 31,
    "title" : "Java 기초 문법 정리",
    "memberName" : "testName",
    "content" : "Java의 기본 문법과 객체지향 프로그래밍에 대해 알아보겠습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 33,
    "title" : "React Hook 사용법",
    "memberName" : "testName",
    "content" : "React의 useState, useEffect 등 주요 Hook들의 사용법을 정리했습니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 35,
    "title" : "MySQL 최적화 팁",
    "memberName" : "testName",
    "content" : "데이터베이스 성능을 향상시키는 다양한 방법들을 알아봅시다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 37,
    "title" : "Docker 컨테이너 활용",
    "memberName" : "testName",
    "content" : "Docker를 이용한 개발 환경 구축과 배포 방법을 다룹니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  }, {
    "postId" : 39,
    "title" : "Git 브랜치 전략",
    "memberName" : "testName",
    "content" : "효율적인 Git 브랜치 관리와 협업 방법을 소개합니다.",
    "categoryName" : "Java1",
    "status" : "PUBLISHED",
    "regDate" : "2025-07-04 19:03"
  } ],
  "pageNumber" : 0,
  "pageSize" : 5,
  "totalElements" : 5,
  "totalPages" : 1,
  "first" : true,
  "last" : true
}

응답 필드

Path Type Description

content

Array

포스트

content[].postId

Number

포스트 Id

content[].title

String

제목

content[].memberName

String

작성자 이름

content[].content

String

내용

content[].categoryName

String

카테고리 이름

content[].status

String

enum + 상태

content[].regDate

String

저장 날짜

pageNumber

Number

페이지 넘버

pageSize

Number

페이지 사이즈

totalElements

Number

총 elements 갯수

totalPages

Number

총 페이지

first

Boolean

처음인지 아닌지

last

Boolean

마지막인지 아닌지

포스트 작성 (관리자)

HTTP 요청

POST /api/admin/posts HTTP/1.1
Content-Type: application/json
Content-Length: 161
Host: localhost:8080

{
  "title" : "새로운 게시글 제목",
  "content" : "새로운 게시글 내용입니다.",
  "categoryName" : "Java1",
  "postStatus" : "PUBLISHED"
}

요청 필드

Path Type Description

title

String

게시글 제목

content

String

게시글 내용

categoryName

String

카테고리 ID

postStatus

String

게시글 상태 (PUBLISHED, PRIVATE)

HTTP 응답

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

{
  "title" : "새로운 게시글 제목",
  "regDate" : "2025-07-04 19:03"
}

응답 필드

Path Type Description

title

String

제목

regDate

String

저장 날짜

포스트 수정 (관리자)

HTTP 요청

PUT /api/admin/posts HTTP/1.1
Content-Type: application/json
Content-Length: 177
Host: localhost:8080

{
  "postId" : 92,
  "title" : "수정된 게시글 제목",
  "content" : "수정된 게시글 내용입니다.",
  "categoryName" : "Java2",
  "postStatus" : "PRIVATE"
}

요청 필드

Path Type Description

postId

Number

수정할 게시글 ID

title

String

수정할 게시글 제목

content

String

수정할 게시글 내용

categoryName

String

수정할 카테고리 ID

postStatus

String

수정할 게시글 상태 (PUBLISHED, PRIVATE)

HTTP 응답

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

{
  "title" : "수정된 게시글 제목",
  "regDate" : "2025-07-04 19:03"
}

응답 필드

Path Type Description

title

String

수정된 제목

regDate

String

저장 날짜

포스트 삭제 (관리자)

HTTP 요청

DELETE /api/admin/posts HTTP/1.1
Content-Type: application/json
Content-Length: 22
Host: localhost:8080

{
  "postId" : 102
}

요청 필드

Path Type Description

postId

Number

삭제할 게시글 ID

HTTP 응답

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

{
  "message" : "게시글이 성골적으로 삭제 되었습니다."
}

응답 필드

Path Type Description

message

String

삭제 완료 메시지

댓글 API (공개)

댓글 조회

HTTP 요청

GET /api/posts/132/comments HTTP/1.1
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/posts/{postId}/comments/request-fields.adoc[]

HTTP 응답

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

{
  "commentDtoList" : [ {
    "id" : 21,
    "content" : "정말 유익한 글이네요! 감사합니다.",
    "email" : "test@naver.com",
    "postId" : 132,
    "parentId" : null,
    "status" : "ACTIVE",
    "regDate" : "2025-06-04 19:04",
    "replies" : [ {
      "id" : 22,
      "content" : "사용자 삭제된 댓글입니다",
      "email" : "test@naver.com",
      "postId" : 132,
      "parentId" : 21,
      "status" : "DELETED",
      "regDate" : "2025-06-04 21:04",
      "replies" : [ ]
    } ]
  } ]
}

응답 필드

Path Type Description

commentDtoList

Array

댓글 목록

commentDtoList[].id

Number

댓글 ID

commentDtoList[].content

String

댓글 내용

commentDtoList[].regDate

String

댓글 작성 시간

commentDtoList[].email

String

작성자 이메일

commentDtoList[].postId

Number

포스트 ID

commentDtoList[].status

String

댓글 상태 (ACTIVE, DELETED, ADMIN_DELETED)

commentDtoList[].parentId

Null

부모 댓글 ID (최상위 댓글인 경우 null)

commentDtoList[].replies

Array

대댓글 목록 (구조는 상위 댓글과 동일)

댓글 작성

HTTP 요청

POST /api/posts/comments HTTP/1.1
Content-Type: application/json
Content-Length: 138
Host: localhost:8080

{
  "postId" : 142,
  "parentId" : null,
  "email" : "hurjin1109@test.com",
  "password" : "1234",
  "content" : "안녕하세요"
}

요청 필드

Path Type Description

postId

Number

post Id

parentId

Null

부모 댓글 Id (null 가능)

email

String

댓글 아이디

password

String

댓글 비밀 번호

content

String

댓글 내용

HTTP 응답

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

{
  "commentDtoList" : [ {
    "id" : 31,
    "content" : "정말 유익한 글이네요! 감사합니다.",
    "email" : "test@naver.com",
    "postId" : 142,
    "parentId" : null,
    "status" : "ACTIVE",
    "regDate" : "2025-06-04 19:04",
    "replies" : [ {
      "id" : 32,
      "content" : "사용자 삭제된 댓글입니다",
      "email" : "test@naver.com",
      "postId" : 142,
      "parentId" : 31,
      "status" : "DELETED",
      "regDate" : "2025-06-04 21:04",
      "replies" : [ ]
    } ]
  }, {
    "id" : 41,
    "content" : "안녕하세요",
    "email" : "hurjin1109@test.com",
    "postId" : 142,
    "parentId" : null,
    "status" : "ACTIVE",
    "regDate" : "2025-07-04 19:04",
    "replies" : [ ]
  } ]
}

응답 필드

Path Type Description

commentDtoList

Array

댓글 목록

commentDtoList[].id

Number

댓글 ID

commentDtoList[].content

String

댓글 내용

commentDtoList[].regDate

String

작성 날짜

commentDtoList[].email

String

작성자 이메일

commentDtoList[].postId

Number

포스트 ID

commentDtoList[].status

String

댓글 상태 (ACTIVE, DELETED, ADMIN_DELETED)

commentDtoList[].parentId

Null

부모 댓글 ID (최상위 댓글인 경우 null)

commentDtoList[].replies

Array

대댓글 목록 (구조는 상위 댓글과 동일)

댓글 임시 삭제

HTTP 요청

POST /api/comments HTTP/1.1
Content-Type: application/json
Content-Length: 192
Host: localhost:8080

{
  "postId" : 152,
  "commentId" : 43,
  "parentId" : 42,
  "email" : "test@naver.com",
  "password" : "1234",
  "content" : "이해하기 쉽게 설명해주셔서 고맙습니다."
}

요청 필드

Path Type Description

postId

Number

post Id

commentId

Number

commentId

parentId

Number

부모 댓글 Id (null 가능)

email

String

댓글 아이디

password

String

댓글 비밀 번호

content

String

댓글 내용

HTTP 응답

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

{
  "commentDtoList" : [ {
    "id" : 42,
    "content" : "정말 유익한 글이네요! 감사합니다.",
    "email" : "test@naver.com",
    "postId" : 152,
    "parentId" : null,
    "status" : "ACTIVE",
    "regDate" : "2025-06-04 19:04",
    "replies" : [ {
      "id" : 43,
      "content" : "사용자 삭제된 댓글입니다",
      "email" : "test@naver.com",
      "postId" : 152,
      "parentId" : 42,
      "status" : "DELETED",
      "regDate" : "2025-06-04 21:04",
      "replies" : [ ]
    } ]
  } ]
}

응답 필드

Path Type Description

commentDtoList

Array

댓글 목록

commentDtoList[].id

Number

댓글 ID

commentDtoList[].regDate

String

작성 날짜

commentDtoList[].content

String

댓글 내용

commentDtoList[].email

String

작성자 이메일

commentDtoList[].status

String

댓글 상태 (ACTIVE, DELETED, ADMIN_DELETED)

commentDtoList[].postId

Number

포스트 ID

commentDtoList[].parentId

Null

부모 댓글 ID (최상위 댓글인 경우 null)

commentDtoList[].replies

Array

대댓글 목록 (구조는 상위 댓글과 동일)

댓글 수정

HTTP 요청

PUT /api/comments HTTP/1.1
Content-Type: application/json
Content-Length: 162
Host: localhost:8080

{
  "postId" : 162,
  "commentId" : 52,
  "parentId" : null,
  "password" : "1234",
  "email" : "test@naver.com",
  "content" : "수정된 댓글 내용"
}

요청 필드

Path Type Description

postId

Number

포스트 ID

commentId

Number

수정할 댓글 ID

parentId

Null

부모 댓글 ID (최상위 댓글인 경우 null)

password

String

댓글 비밀번호

email

String

작성자 이메일

content

String

수정할 댓글 내용

HTTP 응답

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

{
  "commentDtoList" : [ {
    "id" : 52,
    "content" : "수정된 댓글 내용",
    "email" : "test@naver.com",
    "postId" : 162,
    "parentId" : null,
    "status" : "ACTIVE",
    "regDate" : "2025-06-04 19:04",
    "replies" : [ {
      "id" : 53,
      "content" : "사용자 삭제된 댓글입니다",
      "email" : "test@naver.com",
      "postId" : 162,
      "parentId" : 52,
      "status" : "DELETED",
      "regDate" : "2025-06-04 21:04",
      "replies" : [ ]
    } ]
  } ]
}

응답 필드

Path Type Description

commentDtoList

Array

댓글 목록

commentDtoList[].id

Number

댓글 ID

commentDtoList[].regDate

String

작성 날짜

commentDtoList[].content

String

댓글 내용

commentDtoList[].status

String

댓글 상태 (ACTIVE, DELETED, ADMIN_DELETED)

commentDtoList[].email

String

작성자 이메일

commentDtoList[].postId

Number

포스트 ID

commentDtoList[].parentId

Null

부모 댓글 ID (최상위 댓글인 경우 null)

commentDtoList[].replies

Array

대댓글 목록 (구조는 상위 댓글과 동일)

댓글 API (관리자)

댓글 조회 (관리자)

HTTP 요청

GET /api/admin/posts/112/comments HTTP/1.1
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-/api/admin/posts/{postId}/comments/request-fields.adoc[]

HTTP 응답

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

{
  "commentDtoList" : [ {
    "id" : 1,
    "content" : "정말 유익한 글이네요! 감사합니다.",
    "email" : "test@naver.com",
    "postId" : 112,
    "parentId" : null,
    "status" : "ACTIVE",
    "regDate" : "2025-06-04 19:04",
    "replies" : [ {
      "id" : 2,
      "content" : "이해하기 쉽게 설명해주셔서 고맙습니다.",
      "email" : "test@naver.com",
      "postId" : 112,
      "parentId" : 1,
      "status" : "DELETED",
      "regDate" : "2025-06-04 21:04",
      "replies" : [ ]
    } ]
  } ]
}

응답 필드

Path Type Description

commentDtoList

Array

댓글 목록

commentDtoList[].id

Number

댓글 ID

commentDtoList[].content

String

댓글 내용

commentDtoList[].email

String

작성자 이메일

commentDtoList[].postId

Number

포스트 ID

commentDtoList[].status

String

댓글 상태 (ACTIVE, DELETED, ADMIN_DELETED)

commentDtoList[].regDate

String

작성 날짜

commentDtoList[].parentId

Null

부모 댓글 ID (최상위 댓글인 경우 null)

commentDtoList[].replies

Array

대댓글 목록 (구조는 상위 댓글과 동일)

댓글 삭제 (관리자)

HTTP 요청

DELETE /api/admin/comments HTTP/1.1
Content-Type: application/json
Content-Length: 168
Host: localhost:8080

{
  "postId" : 122,
  "commentId" : 12,
  "parentId" : 11,
  "email" : "test@naver.com",
  "content" : "이해하기 쉽게 설명해주셔서 고맙습니다."
}

요청 필드

Path Type Description

postId

Number

포스트 ID

commentId

Number

삭제할 댓글 ID

parentId

Number

부모 댓글 ID (null 가능)

email

String

댓글 작성자 이메일

content

String

댓글 내용

HTTP 응답

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

{
  "commentDtoList" : [ {
    "id" : 11,
    "content" : "정말 유익한 글이네요! 감사합니다.",
    "email" : "test@naver.com",
    "postId" : 122,
    "parentId" : null,
    "status" : "ACTIVE",
    "regDate" : "2025-06-04 19:04",
    "replies" : [ ]
  } ]
}

응답 필드

Path Type Description

commentDtoList

Array

삭제 후 댓글 목록

commentDtoList[].id

Number

댓글 ID

commentDtoList[].content

String

댓글 내용

commentDtoList[].regDate

String

댓글 작성 시간

commentDtoList[].email

String

작성자 이메일

commentDtoList[].status

String

댓글 상태 (ACTIVE, DELETED, ADMIN_DELETED)

commentDtoList[].postId

Number

포스트 ID

commentDtoList[].parentId

Null

부모 댓글 ID (최상위 댓글인 경우 null)

commentDtoList[].replies

Array

대댓글 목록 (구조는 상위 댓글과 동일)

인증 API

세션 확인

HTTP 요청

GET /api/auth/session HTTP/1.1
Content-Type: application/json
Host: localhost:8080

요청 필드

Unresolved directive in api-doc-template.adoc - include::C:/Users/hurji/Desktop/demoBlog/demoBlog/build/generated-snippets/get-api-auth-session-authenticated/request-fields.adoc[]

HTTP 응답

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

{
  "authenticated" : true,
  "message" : "인증됨"
}

응답 필드

Path Type Description

authenticated

Boolean

인증 상태

message

String

인증 상태 메시지