Board
게시판
게시글 생성
create board
POST boards/
새 게시판을 만듭니다.
Request Body
Name
Type
Description
title*
string
게시물의 제목을 입력합니다.
제목은 Null, Blank값이 올 수 없으며 최소 1글자 이상 15글자 이하로 구성해야 합니다.
content*
string
게시물의 내용을 입력합니다.
내용은 Null값이 올 수 없으며, 1글자 이상 1000글자 이하로 구성해야 합니다.
{
"id": int,
"title": "제목",
"content": "내용",
"createAt": "2023-05-22T04:53:17.2417056"
}게시글 전체 조회
find boards all
GET boards/
모든 게시물을 조회합니다.
Query Parameters
Name
Type
Description
page*
int
조회하고 싶은 페이지 수를 입력합니다.
전체 페이지 수와 현재 페이지 수, 그리고 페이지 안에 있는 게시물의 정보를 반환합니다.
{
"boardResponseDtos": [
{
"id": 6,
"title": "6 게시물",
"content": "6 내용",
"createAt": "2023-05-22T04:53:17"
},
{
"id": 5,
"title": "5 게시물",
"content": "5 내용",
"createAt": "2023-05-18T03:49:03"
},
{
"id": 1,
"title": "1 게시물",
"content": "1 내용",
"createAt": "2023-05-15T16:31:08"
}
],
"totalPages": 1,
"offset": 0
}
```만일 게시물이 없다면 빈 공간을반환합니다.
특정 게시글 조회
find board
GET boards/id
특정 게시물을 id 값으로 조회합니다.
Path Parameters
Name
Type
Description
id*
int
조회하고 싶은 게시물의 id 값을 입력합니다.
{
"id": 1,
"title": "1 게시물",
"content": "1 내용",
"createAt": "2023-05-15T16:31:08"
}특정 게시글 수정
update board
GET boards/id
id로 조회한 특정 게시글의 제목과 내용을 수정합니다.
Path Parameters
Name
Type
Description
id*
int
수정하고 싶은 게시글의 id 값을 입력합니다.
Request Body
Name
Type
Description
title*
String
제목을 입력합니다.
게시물 생성과 동일한 유효성 검사를 진행합니다.
content
String
내용을 입력합니다.
게시물 생성과 동일한 유효성 검사를 진행합니다.
{
"id": 2,
"title": "2 제목 수정",
"content": "2 내용 수정",
"createAt": "2023-05-15T16:31:15"
}특정 게시글 삭제 기능
delete board
DELETE boards/id
id로 조회한 특정 게시글을 삭제합니다.
Path Parameters
Name
Type
Description
id*
int
삭제할 게시글의 id 값을 입력합니다.
성공적으로 제거했습니다.게시글 검색 기능
search board
GET boards/search
제목에 keyword가 포함된 게시글을 조회합니다.
Query Parameters
Name
Type
Description
keyword*
string
검색할 키워드를 입력해야 합니다.
page*
int
원하는 페이지를 입력합니다.
{
"boardResponseDtos": [
{
"id": 2,
"title": "2 제목 수정",
"content": "2 내용 수정",
"createAt": "2023-05-15T16:31:15"
}
],
"totalPages": 1,
"offset": 0
}Last updated