소개

핀업 API 문서 입니다.

게시글 API

게시글 목록 조회

Path parameters

Table 1. /api/post/list/{storeId}
Parameter Description

storeId

스토어 ID

Response fields

Path Type Description

[].id

Number

게시글 ID

[].storeId

Number

스토어 ID

[].member.id

Number

작성자 ID

[].member.name

Null

작성자 이름 (nullable)

[].member.nickname

String

작성자 닉네임

[].member.email

String

작성자 이메일

[].member.providerType

String

OAuth 제공자

[].member.role

String

사용자 권한

[].member.deleted

Boolean

탈퇴 여부

[].title

String

게시글 제목

[].content

String

게시글 내용

[].thumbnail

String

썸네일 이미지 URL

[].createdAt

String

작성일시

[].updatedAt

String

수정일시

[].commentCount

Number

댓글 수

게시글 상세 조회

Path parameters

Table 1. /api/post/{postId}
Parameter Description

postId

게시글 ID

Response fields

Path Type Description

post

Object

게시글 정보

post.id

Number

게시글 ID

post.storeId

Number

스토어 ID

post.member.id

Number

작성자 ID

post.member.nickname

String

작성자 닉네임

post.member.email

String

작성자 이메일

post.member.providerType

String

OAuth 제공자

post.member.role

String

사용자 권한

post.member.deleted

Boolean

탈퇴 여부

post.title

String

게시글 제목

post.content

String

게시글 내용

post.thumbnail

String

썸네일 이미지 URL

post.createdAt

String

게시글 생성일

post.updatedAt

String

게시글 수정일

post.commentCount

Number

댓글 수

comments

Array

댓글 목록

comments[].id

Number

댓글 ID

comments[].postId

Number

댓글이 속한 게시글 ID

comments[].member.nickname

String

댓글 작성자 닉네임

comments[].content

String

댓글 내용

comments[].createdAt

String

댓글 작성일

postImages

Array

게시글 이미지 목록

postImages[].id

Number

이미지 ID

postImages[].postId

Number

이미지가 속한 게시글 ID

postImages[].s3Url

String

이미지 S3 URL

게시글 생성

요청은 multipart/form-data 형식으로 전송되며, 다음과 같은 파트로 구성됩니다:

  • post: 게시글 생성 정보 (JSON)

  • images: 이미지 파일 배열

HTTP request

POST /api/post/create HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Accept: application/json
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=post; filename=post.json
Content-Type: application/json;charset=UTF-8

{"storeId":1,"title":"제목","content":"내용"}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=images; filename=img1.jpg
Content-Type: image/jpeg

data1
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=images; filename=img2.jpg
Content-Type: image/jpeg

data2
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Request parts

Part Description

post

게시글 정보(JSON)

images

이미지 파일들 (2장 이상)

Request part-post-fields

Path Type Description

storeId

Number

스토어 ID

title

String

게시글 제목

content

String

게시글 내용

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 364

{"id":1,"storeId":null,"member":{"id":null,"name":"테스터","email":"test@naver.com","nickname":"행복한돼지","providerType":"NAVER","role":"ROLE_USER","deleted":false},"title":"제목","content":"내용","thumbnail":"https://example.com/thumbnail.jpg","createdAt":"2025-06-19T14:30:40.919998404","updatedAt":"2025-06-19T14:30:40.920000968","commentCount":0}

Response fields

Path Type Description

id

Number

게시글 ID

storeId

Null

스토어 ID

member.id

Null

작성자 ID (nullable)

member.name

String

작성자 이름

member.email

String

작성자 이메일

member.nickname

String

작성자 닉네임

member.providerType

String

OAuth 제공자

member.role

String

사용자 역할

member.deleted

Boolean

삭제 여부

title

String

제목

content

String

내용

thumbnail

String

썸네일 이미지 URL

createdAt

String

생성 일시

updatedAt

String

수정 일시

commentCount

Number

댓글 수

게시글 삭제

Path parameters

Table 1. /api/post/{postId}
Parameter Description

postId

삭제할 게시글 ID

게시글 수정

요청은 multipart/form-data 형식으로 전송되며, 다음과 같은 파트로 구성됩니다:

  • updatePostRequest: 수정할 게시글 정보 (JSON)

  • images: 추가로 업로드할 이미지 파일들 (선택)

  • imagesToDelete: 쿼리 파라미터로 삭제할 이미지 파일 이름 목록 (선택)

HTTP request

PUT /api/post/1 HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=updatePostRequest; filename=updatePostRequest.json
Content-Type: application/json;charset=UTF-8

{"title":"수정 제목","content":"수정 내용"}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=images; filename=image1.jpg
Content-Type: image/jpeg

이미지데이터1
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=images; filename=image2.jpg
Content-Type: image/jpeg

이미지데이터2
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Path parameters

Table 1. /api/post/{postId}
Parameter Description

postId

수정할 게시글 ID

Request parts

Part Description

updatePostRequest

수정할 게시글 정보 (title, content 포함)

images

추가로 업로드할 이미지 파일들 (0개 이상 가능)

Request part-updatepostrequest-fields

Path Type Description

title

String

수정할 제목

content

String

수정할 내용

Query parameters

Parameter Description

imagesToDelete

삭제할 이미지 파일 이름 목록 (선택)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 386

{"id":1,"storeId":null,"member":{"id":null,"name":"테스터","email":"test@naver.com","nickname":"행복한돼지","providerType":"NAVER","role":"ROLE_USER","deleted":false},"title":"수정 제목","content":"수정 내용","thumbnail":"https://example.com/updated-thumbnail.jpg","createdAt":"2025-06-18T14:30:40.896372441","updatedAt":"2025-06-19T14:30:40.896383222","commentCount":0}

Response fields

Path Type Description

id

Number

게시글 ID

storeId

Null

스토어 ID

member.id

Null

작성자 ID

member.name

String

작성자 이름

member.email

String

작성자 이메일

member.nickname

String

작성자 닉네임

member.providerType

String

소셜 로그인 제공자

member.role

String

회원 권한

member.deleted

Boolean

회원 삭제 여부

title

String

제목

content

String

내용

thumbnail

String

썸네일 이미지 URL

createdAt

String

생성 일시

updatedAt

String

수정 일시

commentCount

Number

댓글 수

게시글 비활성화

Path parameters

Table 1. /api/post/{postId}/disable
Parameter Description

postId

비활성화할 게시글 ID

댓글 API

댓글 생성

HTTP request

Snippet http-request not found for operation::comment-create

Path parameters

Snippet path-parameters not found for operation::comment-create

Request fields

Snippet request-fields not found for operation::comment-create

HTTP response

Snippet http-response not found for operation::comment-create

Response fields

Snippet response-fields not found for operation::comment-create

댓글 삭제

HTTP request

Snippet http-request not found for operation::comment-delete

Path parameters

Snippet path-parameters not found for operation::comment-delete

HTTP response

Snippet http-response not found for operation::comment-delete

공지사항 API

전체 조회

Curl request

$ curl 'http://localhost:8080/api/notices' -i -X GET

HTTP request

GET /api/notices HTTP/1.1
Host: localhost:8080

HTTP response

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

[ {
  "id" : 2,
  "title" : "title 2",
  "content" : "content 2",
  "member" : {
    "id" : 1,
    "name" : "핀업",
    "email" : "pinup0106@gmail.com",
    "nickname" : "핀업",
    "providerType" : "NAVER",
    "role" : "ROLE_ADMIN",
    "deleted" : false
  },
  "createdAt" : "2025-01-01T01:00:00",
  "updatedAt" : null
}, {
  "id" : 1,
  "title" : "title 1",
  "content" : "content 1",
  "member" : {
    "id" : 1,
    "name" : "핀업",
    "email" : "pinup0106@gmail.com",
    "nickname" : "핀업",
    "providerType" : "NAVER",
    "role" : "ROLE_ADMIN",
    "deleted" : false
  },
  "createdAt" : "2025-01-01T00:00:00",
  "updatedAt" : null
} ]

Response fields

Path Type Description

[].id

Number

공지사항 아이디

[].title

String

공지사항 제목

[].content

String

공지사항 내용

[].member.id

Number

작성자 아이디

[].member.name

String

작성자 이름

[].member.email

String

작성자 이메일

[].member.nickname

String

작성자 닉네임

[].member.providerType

String

OAuth 제공자

[].member.role

String

작성자 권한

[].member.deleted

Boolean

작성자 탈퇴 여부

[].createdAt

String

공지사항 작성일

[].updatedAt

String

공지사항 수정일

단건 조회

Curl request

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

HTTP request

GET /api/notices/1 HTTP/1.1
Host: localhost:8080

HTTP response

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

{
  "id" : 1,
  "title" : "title",
  "content" : "content",
  "member" : {
    "id" : 1,
    "name" : "핀업",
    "email" : "pinup0106@gmail.com",
    "nickname" : "핀업",
    "providerType" : "NAVER",
    "role" : "ROLE_ADMIN",
    "deleted" : false
  },
  "createdAt" : "2025-01-01T00:00:00",
  "updatedAt" : null
}

Response fields

Path Type Description

id

Number

공지사항 아이디

title

String

공지사항 제목

content

String

공지사항 내용

member.id

Number

작성자 아이디

member.name

String

작성자 이름

member.email

String

작성자 이메일

member.nickname

String

작성자 닉네임

member.providerType

String

OAuth 제공자

member.role

String

작성자 권한

member.deleted

Boolean

작성자 탈퇴 여부

createdAt

String

공지사항 작성일

updatedAt

String

공지사항 수정일

존재하지 않는 ID로 조회

  • 요청: GET /api/notices/{noticeId}

  • 설명: 존재하지 않는 공지사항 요청 시, error View 반환

  • Path Parameters: noticeId (Long): 조회할 공지사항의 ID

  • View name: error

  • Model attributes: error

저장

Curl request

$ curl 'http://localhost:8080/api/notices' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : "title 1",
  "content" : "content 1"
}'

HTTP request

POST /api/notices HTTP/1.1
Content-Type: application/json
Content-Length: 52
Host: localhost:8080

{
  "title" : "title 1",
  "content" : "content 1"
}

HTTP response

HTTP/1.1 201 Created

저장 시 제목 누락 예외

Curl request

$ curl 'http://localhost:8080/api/notices' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : null,
  "content" : "content 1"
}'

HTTP request

POST /api/notices HTTP/1.1
Content-Type: application/json
Content-Length: 47
Host: localhost:8080

{
  "title" : null,
  "content" : "content 1"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 144

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "title" : "제목을 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.title

String

제목은 필수 입력 필드입니다.

저장 시 제목 길이 제한 예외

Curl request

$ curl 'http://localhost:8080/api/notices' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "content" : "content 1"
}'

HTTP request

POST /api/notices HTTP/1.1
Content-Type: application/json
Content-Length: 146
Host: localhost:8080

{
  "title" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "content" : "content 1"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 163

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "title" : "제목을 1~100자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.title

String

제목은 1~100자 이내여야 합니다.

저장 시 내용 누락 예외

Curl request

$ curl 'http://localhost:8080/api/notices' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : "title 1",
  "content" : null
}'

HTTP request

POST /api/notices HTTP/1.1
Content-Type: application/json
Content-Length: 45
Host: localhost:8080

{
  "title" : "title 1",
  "content" : null
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 146

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "content" : "내용을 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.content

String

내용은 필수 입력 필드입니다.

수정

Curl request

$ curl 'http://localhost:8080/api/notices/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : "title 1",
  "content" : "update content"
}'

HTTP request

PUT /api/notices/1 HTTP/1.1
Content-Type: application/json
Content-Length: 57
Host: localhost:8080

{
  "title" : "title 1",
  "content" : "update content"
}

HTTP response

HTTP/1.1 204 No Content

존재하지 않는 ID로 수정

  • 요청: PUT /api/notices/{noticeId}

  • 설명: 존재하지 않는 공지사항 수정 요청 시, error View 반환

  • Path Parameters: noticeId (Long): 수정할 공지사항의 ID

  • View name: error

  • Model attributes: error

수정 시 제목 누락 예외

Curl request

$ curl 'http://localhost:8080/api/notices/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : null,
  "content" : "update content"
}'

HTTP request

PUT /api/notices/1 HTTP/1.1
Content-Type: application/json
Content-Length: 52
Host: localhost:8080

{
  "title" : null,
  "content" : "update content"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 144

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "title" : "제목을 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.title

String

제목은 필수 입력 필드입니다.

수정 시 제목 길이 제한 예외

Curl request

$ curl 'http://localhost:8080/api/notices/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "content" : "update content"
}'

HTTP request

PUT /api/notices/1 HTTP/1.1
Content-Type: application/json
Content-Length: 151
Host: localhost:8080

{
  "title" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "content" : "update content"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 163

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "title" : "제목을 1~100자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.title

String

제목은 1~100자 이내여야 합니다.

수정 시 내용 누락 예외

Curl request

$ curl 'http://localhost:8080/api/notices/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "title" : "title update",
  "content" : null
}'

HTTP request

PUT /api/notices/1 HTTP/1.1
Content-Type: application/json
Content-Length: 50
Host: localhost:8080

{
  "title" : "title update",
  "content" : null
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 146

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "content" : "내용을 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.content

String

내용은 필수 입력 필드입니다.

삭제

Curl request

$ curl 'http://localhost:8080/api/notices/1' -i -X DELETE

HTTP request

DELETE /api/notices/1 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 204 No Content

존재하지 않는 ID로 삭제

  • 요청: DELETE /api/notices/{noticeId}

  • 설명: 존재하지 않는 공지사항 삭제 요청 시, error View 반환

  • Path Parameters: noticeId (Long): 삭제할 공지사항의 ID

  • View name: error

  • Model attributes: error

FAQ API

전체 조회

Curl request

$ curl 'http://localhost:8080/api/faqs' -i -X GET

HTTP request

GET /api/faqs HTTP/1.1
Host: localhost:8080

HTTP response

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

[ {
  "id" : 2,
  "question" : "question 2",
  "answer" : "answer 2",
  "category" : "USE",
  "member" : {
    "id" : 1,
    "name" : "핀업",
    "email" : "pinup0106@gmail.com",
    "nickname" : "핀업",
    "providerType" : "NAVER",
    "role" : "ROLE_ADMIN",
    "deleted" : false
  },
  "createdAt" : "2025-01-02T00:00:00",
  "updatedAt" : null
}, {
  "id" : 1,
  "question" : "question 1",
  "answer" : "answer 1",
  "category" : "USE",
  "member" : {
    "id" : 1,
    "name" : "핀업",
    "email" : "pinup0106@gmail.com",
    "nickname" : "핀업",
    "providerType" : "NAVER",
    "role" : "ROLE_ADMIN",
    "deleted" : false
  },
  "createdAt" : "2025-01-01T00:00:00",
  "updatedAt" : null
} ]

Response fields

Path Type Description

[].id

Number

FAQ ID

[].question

String

FAQ 질문

[].answer

String

FAQ 답변

[].category

String

FAQ 카테고리

[].member.id

Number

작성자 ID

[].member.name

String

작성자 이름

[].member.email

String

작성자 이메일

[].member.nickname

String

작성자 닉네임

[].member.providerType

String

OAuth 제공자

[].member.role

String

작성자 권한

[].member.deleted

Boolean

작성자 탈퇴 여부

[].createdAt

String

FAQ 작성일

[].updatedAt

String

FAQ 수정일

단건 조회

Curl request

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

HTTP request

GET /api/faqs/1 HTTP/1.1
Host: localhost:8080

HTTP response

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

{
  "id" : 1,
  "question" : "question",
  "answer" : "answer",
  "category" : "USE",
  "member" : {
    "id" : 1,
    "name" : "핀업",
    "email" : "pinup0106@gmail.com",
    "nickname" : "핀업",
    "providerType" : "NAVER",
    "role" : "ROLE_ADMIN",
    "deleted" : false
  },
  "createdAt" : "2025-01-01T00:00:00",
  "updatedAt" : null
}

Response fields

Path Type Description

id

Number

FAQ ID

question

String

FAQ 질문

answer

String

FAQ 답변

category

String

FAQ 카테고리

member.id

Number

작성자 ID

member.name

String

작성자 이름

member.email

String

작성자 이메일

member.nickname

String

작성자 닉네임

member.providerType

String

OAuth 제공자

member.role

String

작성자 권한

member.deleted

Boolean

작성자 탈퇴 여부

createdAt

String

FAQ 작성일

updatedAt

String

FAQ 수정일

존재하지 않는 ID로 조회

  • 요청: GET /api/faqs/{faqId}

  • 설명: 존재하지 않는 FAQ 요청 시, error View 반환

  • Path Parameters: faqId (Long): 조회할 FAQ의 ID

  • View name: error

  • Model attributes: error

저장

Curl request

$ curl 'http://localhost:8080/api/faqs' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "question",
  "answer" : "answer",
  "category" : "USE"
}'

HTTP request

POST /api/faqs HTTP/1.1
Content-Type: application/json
Content-Length: 74
Host: localhost:8080

{
  "question" : "question",
  "answer" : "answer",
  "category" : "USE"
}

HTTP response

HTTP/1.1 201 Created

저장 시 질문 누락 예외

Curl request

$ curl 'http://localhost:8080/api/faqs' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "",
  "answer" : "answer",
  "category" : "USE"
}'

HTTP request

POST /api/faqs HTTP/1.1
Content-Type: application/json
Content-Length: 66
Host: localhost:8080

{
  "question" : "",
  "answer" : "answer",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 154

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "question" : "질문 내용을 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.question

String

질문은 필수 입력 필드입니다.

저장 시 질문 길이 제한 예외

Curl request

$ curl 'http://localhost:8080/api/faqs' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "answer" : "answer",
  "category" : "USE"
}'

HTTP request

POST /api/faqs HTTP/1.1
Content-Type: application/json
Content-Length: 167
Host: localhost:8080

{
  "question" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "answer" : "answer",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 173

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "question" : "질문 내용을 1~100자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.question

String

질문은 1~100자 이내여야 합니다.

저장 시 답변 누락 예외

Curl request

$ curl 'http://localhost:8080/api/faqs' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "question",
  "answer" : "",
  "category" : "USE"
}'

HTTP request

POST /api/faqs HTTP/1.1
Content-Type: application/json
Content-Length: 68
Host: localhost:8080

{
  "question" : "question",
  "answer" : "",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 152

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "answer" : "답변 내용을 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.answer

String

답변은 필수 입력 필드입니다.

저장 시 답변 길이 제한 예외

Curl request

$ curl 'http://localhost:8080/api/faqs' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "question",
  "answer" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "category" : "USE"
}'

HTTP request

POST /api/faqs HTTP/1.1
Content-Type: application/json
Content-Length: 569
Host: localhost:8080

{
  "question" : "question",
  "answer" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 171

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "answer" : "답변 내용을 1~500자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.answer

String

답변은 1~500자 이내여야 합니다.

저장 시 카테고리 누락 예외

Curl request

$ curl 'http://localhost:8080/api/faqs' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "question",
  "answer" : "answer",
  "category" : null
}'

HTTP request

POST /api/faqs HTTP/1.1
Content-Type: application/json
Content-Length: 73
Host: localhost:8080

{
  "question" : "question",
  "answer" : "answer",
  "category" : null
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 153

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "category" : "카테고리는 필수입니다."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.category

String

카테고리는 필수 입력 필드입니다.

수정

Curl request

$ curl 'http://localhost:8080/api/faqs/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "update question",
  "answer" : "update answer",
  "category" : "USE"
}'

HTTP request

PUT /api/faqs/1 HTTP/1.1
Content-Type: application/json
Content-Length: 88
Host: localhost:8080

{
  "question" : "update question",
  "answer" : "update answer",
  "category" : "USE"
}

HTTP response

HTTP/1.1 204 No Content

존재하지 않는 ID로 수정

  • 요청: PUT /api/faqs/{faqId}

  • 설명: 존재하지 않는 FAQ 수정 요청 시, error View 반환

  • Path Parameters: faqId (Long): 수정할 FAQ의 ID

  • View name: error

  • Model attributes: error

수정 시 질문 누락 예외

Curl request

$ curl 'http://localhost:8080/api/faqs/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "",
  "answer" : "answer",
  "category" : "USE"
}'

HTTP request

PUT /api/faqs/1 HTTP/1.1
Content-Type: application/json
Content-Length: 66
Host: localhost:8080

{
  "question" : "",
  "answer" : "answer",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 173

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "question" : "질문 내용을 1~100자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.question

String

질문은 필수 입력 필드입니다.

수정 시 질문 길이 제한 예외

Curl request

$ curl 'http://localhost:8080/api/faqs/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "answer" : "answer",
  "category" : "USE"
}'

HTTP request

PUT /api/faqs/1 HTTP/1.1
Content-Type: application/json
Content-Length: 167
Host: localhost:8080

{
  "question" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "answer" : "answer",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 173

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "question" : "질문 내용을 1~100자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.question

String

질문은 1~100자 이내여야 합니다.

수정 시 답변 누락 예외

Curl request

$ curl 'http://localhost:8080/api/faqs/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "question",
  "answer" : "",
  "category" : "USE"
}'

HTTP request

PUT /api/faqs/1 HTTP/1.1
Content-Type: application/json
Content-Length: 68
Host: localhost:8080

{
  "question" : "question",
  "answer" : "",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 171

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "answer" : "답변 내용을 1~500자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.answer

String

답변은 필수 입력 필드입니다.

수정 시 답변 길이 제한 예외

Curl request

$ curl 'http://localhost:8080/api/faqs/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "question",
  "answer" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "category" : "USE"
}'

HTTP request

PUT /api/faqs/1 HTTP/1.1
Content-Type: application/json
Content-Length: 569
Host: localhost:8080

{
  "question" : "question",
  "answer" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "category" : "USE"
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 171

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "answer" : "답변 내용을 1~500자 이내로 입력하세요."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.answer

String

답변은 1~500자 이내여야 합니다.

수정 시 카테고리 누락 예외

Curl request

$ curl 'http://localhost:8080/api/faqs/1' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "question" : "question",
  "answer" : "answer",
  "category" : null
}'

HTTP request

PUT /api/faqs/1 HTTP/1.1
Content-Type: application/json
Content-Length: 73
Host: localhost:8080

{
  "question" : "question",
  "answer" : "answer",
  "category" : null
}

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 153

{
  "status" : 400,
  "message" : "입력값이 유효하지 않습니다.",
  "validation" : {
    "category" : "카테고리는 필수입니다."
  }
}

Response fields

Path Type Description

status

Number

상태 코드

message

String

에러 메시지

validation.category

String

카테고리는 필수 입력 필드입니다.

삭제

Curl request

$ curl 'http://localhost:8080/api/faqs/1' -i -X DELETE

HTTP request

DELETE /api/faqs/1 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 204 No Content

존재하지 않는 ID로 삭제

  • 요청: DELETE /api/faqs/{faqId}

  • 설명: 존재하지 않는 FAQ 삭제 요청 시, error View 반환

  • Path Parameters: faqId (Long): 삭제할 FAQ의 ID

  • View name: error

  • Model attributes: error

Member API

닉네임 생성

Curl request

$ curl 'http://localhost:8080/api/members/nickname' -i -X GET \
    -H 'Content-Type: text/plain'

HTTP request

GET /api/members/nickname HTTP/1.1
Content-Type: text/plain
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 17

generatedNickname

닉네임 수정

Curl request

$ curl 'http://localhost:8080/api/members' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer testToken' \
    -d '{"name":"test","email":"test@naver.com","nickname":"updatedTestNickname","providerType":"NAVER"}'

Request fields

Path Type Description

name

String

이름

email

String

이메일

nickname

String

변경할 닉네임

providerType

String

OAuth 제공자

HTTP request

PATCH /api/members HTTP/1.1
Content-Type: application/json
Authorization: Bearer testToken
Content-Length: 96
Host: localhost:8080

{"name":"test","email":"test@naver.com","nickname":"updatedTestNickname","providerType":"NAVER"}

HTTP response

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

{"code":200,"message":"닉네임이 변경되었습니다."}

Response fields

Path Type Description

code

Number

응답 코드

message

String

닉네임 변경 결과 메시지

회원 탈퇴

Curl request

$ curl 'http://localhost:8080/api/members' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer testToken' \
    -d '{"name":"test","email":"test@naver.com","nickname":"updatedTestNickname","providerType":"NAVER"}'

Request fields

Path Type Description

name

String

이름

email

String

이메일

nickname

String

닉네임

providerType

String

OAuth 제공자

HTTP request

DELETE /api/members HTTP/1.1
Content-Type: application/json
Authorization: Bearer testToken
Content-Length: 96
Host: localhost:8080

{"name":"test","email":"test@naver.com","nickname":"updatedTestNickname","providerType":"NAVER"}

HTTP response

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

{"code":200,"message":"탈퇴되었습니다. 이용해주셔서 감사합니다."}

Response fields

Path Type Description

code

Number

응답 코드

message

String

탈퇴 결과 메시지

로그아웃

Curl request

$ curl 'http://localhost:8080/api/members/logout' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer testToken'

HTTP request

POST /api/members/logout HTTP/1.1
Content-Type: application/json
Authorization: Bearer testToken
Host: localhost:8080

HTTP response

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

{"code":200,"message":"로그아웃에 성공하였습니다."}

Response fields

Path Type Description

code

Number

응답 코드

message

String

로그아웃 결과 메시지