-
Notifications
You must be signed in to change notification settings - Fork 0
회고글 API
황종훈 edited this page Apr 27, 2021
·
3 revisions
/posts
-
URL
/
-
Method
POST
-
Headers
{
"access_token": "..."
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
access_token | String | 액세스 토큰 | "..." | O |
- Body
{
"category": "개발",
"title": "1일 1알고리즘 실천 일기",
"content": "...",
"template": {
"idx" : 1,
"template_name": "4F"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
category | String | 회고 글 카테고리 | "개발" | O |
title | String | 회고 글 제목 | "1일 1알고리즘 실천 일기" | O |
content | String | 회고 글 내용 | "..." | O |
template.idx | Long | 템플릿 인덱스 | 1 | O |
template.template_name | String | 템플릿 이름 | "4F" | O |
- Success Body
{
"result": {
"type": "post",
"idx": 169,
"status": 200,
"success": true,
"message": "회고 글 등록 성공",
},
"error": null
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
result.type | String | 데이터 타입 | "post" | O |
result.idx | Long | 회고 글 인덱스 | 169 | O |
result.status | Integer | HTTP status code | 200 | O |
result.success | Boolean | 요청 성공 여부 | false | O |
result.message | String | 응답 메시지 | "회고 글 등록/수정 성공" |
- Fail Body
{
"result": null,
"error": {
"type": "post",
"status": 500,
"message": "서버 내부 에러"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
error.type | String | 데이터 타입 | "post" | O |
error.status | Integer | HTTP status code | 500 | O |
error.message | String | 결과 메시지 | "서버 내부 에러" |
무한 스크롤
홈 첫화면 게시글 수 20개 - 스크롤 할때마다 20개씩 추가
-
URL
/
-
Method
GET
-
Query Params
Param | Type | Description | Example | Required |
---|---|---|---|---|
category | String | 카테고리 | "dev", "design", "plan", "marketing", ... | |
template | String | 회고 양식 | "4F", "PSI", "DAKI", ... | |
sort | String | 정렬기준 | "created(default)", view", "scraped", ... | O |
order | String | 차순 | "asc", "desc" |
- Headers
- Success Body
{
"result": {
"type": "post",
"status": 200,
"success": true,
"message": "회고 글 조회 성공",
"data": [ {
"idx": 1,
"category": "개발",
"title": "1일 1알고리즘 실천 일기",
"content": "...",
"view": 326,
"user": {
"idx": 40,
"nickname": "프로도",
"picture": "..."
},
"template":{
"idx" : 1,
"template_name": "4F"
}
}, {
"idx": 2,
"category": "개발",
"title": "테스트 주도 개발을 도입하고 나서...",
"content": "...",
"view": 326,
"user": {
"idx": 56,
"nickname": "라이언",
"picture": "..."
},
"template":{
"idx" : 2,
"template_name": "PSI"
}
},
...
]
},
"error": null
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
result.type | String | 데이터 타입 | "post" | O |
result.status | Integer | HTTP status code | 200 | O |
result.success | Boolean | 요청 성공 여부 | false | O |
result.message | String | 응답 메시지 | "회고 글 조회 성공" | |
data.idx | Long | 회고 글 인덱스 | 1 | O |
data.category | String | 회고 글 카테고리 | "개발" | O |
data.title | String | 회고 글 제목 | "1일 1알고리즘 실천 일기" | O |
data.content | String | 회고 글 내용 | "..." | O |
data.view | Integer | 회고 글 조회수 | 326 | O |
data.user.idx | Long | 회고 글 작성자 인덱스 | 40 | O |
data.user.nickname | String | 회고 글 작성자 닉네임 | "프로도" | O |
data.user.picture | String | 회고 글 작성자 프로필 이미지 URL | "..." | |
data.template.idx | Long | 템플릿 인덱스 | 1 | O |
data.template.template_name | String | 템플릿 이름 | "4F" | O |
- Fail Body
{
"result": null,
"error": {
"type": "post",
"status": 500,
"message": "서버 내부 에러"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
error.type | String | 데이터 타입 | "post" | O |
error.status | Integer | HTTP status code | 500 | O |
error.message | String | 결과 메시지 | "서버 내부 에러" |
-
URL
/:idx
-
Method
GET
-
Headers
{
"access_token": "..."
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
access_token | String | 액세스 토큰 | "..." | O |
- Success Body
{
"result": {
"type": "post",
"status": 200,
"success": true,
"message": "회고 글 조회 성공",
"data": {
"idx": 1,
"category": "디자인",
"title": "이번 주 디자인을 하며 느낀 것들",
"content": "...",
"view": 326,
"user": {
"idx": 55,
"nickname": "어피치",
"picture": "..."
},
"template": {
"idx": 3,
"template_name": "DAKI"
}
}
},
"error": null
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
result.type | String | 데이터 타입 | "post" | O |
result.status | Integer | HTTP status code | 200 | O |
result.success | Boolean | 요청 성공 여부 | false | O |
result.message | String | 응답 메시지 | "회고 글 조회 성공" | |
data.idx | Long | 회고 글 인덱스 | 1 | O |
data.category | String | 회고 글 카테고리 | "디자인" | O |
data.title | String | 회고 글 제목 | "이번 주 디자인을 하며 느낀 것들" | O |
data.content | String | 회고 글 내용 | "..." | O |
data.view | Integer | 회고 글 조회수 | 326 | O |
data.user.idx | Long | 회고 글 작성자 인덱스 | 55 | O |
data.user.nickname | String | 회고 글 작성자 닉네임 | "어피치" | O |
data.user.picture | String | 회고 글 작성자 프로필 이미지 URL | "..." | |
data.template.idx | Long | 템플릿 인덱스 | 1 | O |
data.template.template_name | String | 템플릿 이름 | "DAKI" | O |
- Fail Body
{
"result": null,
"error": {
"type": "post",
"status": 500,
"message": "서버 내부 에러"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
error.type | String | 데이터 타입 | "post" | O |
error.status | Integer | HTTP status code | 500 | O |
error.message | String | 결과 메시지 | "서버 내부 에러" |
-
URL
/
-
Method
PATCH
-
Headers
{
"access_token": "..."
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
access_token | String | 액세스 토큰 | "..." | O |
- Body
{
"idx": 321,
"category": "일기",
"title": "1일 1커밋 실천 일기",
"content": "...",
"template":{
"idx" : 1,
"template_name": "4F"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
idx | Long | 회고 글 인덱스 | 321 | O |
category | String | 회고 글 카테고리 | "일기" | O |
title | String | 회고 글 제목 | "1일 1커밋 실천 일기" | O |
content | String | 회고 글 내용 | "..." | O |
template.idx | Long | 템플릿 인덱스 | 1 | O |
template.template_name | String | 템플릿 이름 | "4F" | O |
- Success Body
{
"result": {
"type": "post",
"idx": 321,
"status": 200,
"success": true,
"message": "회고 글 수정 성공",
},
"error": null
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
result.type | String | 데이터 타입 | "post" | O |
result.idx | Long | 회고 글 인덱스 | 169 | O |
result.status | Integer | HTTP status code | 200 | O |
result.success | Boolean | 요청 성공 여부 | false | O |
result.message | String | 응답 메시지 | "회고 글 등록/수정 성공" |
- Fail Body
{
"result": null,
"error": {
"type": "post",
"status": 500,
"message": "서버 내부 에러"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
error.type | String | 데이터 타입 | "post" | O |
error.status | Integer | HTTP status code | 500 | O |
error.message | String | 결과 메시지 | "서버 내부 에러" |
-
URL
/:idx
-
Method
DELETE
-
Headers
{
"access_token": "..."
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
access_token | String | 액세스 토큰 | "..." | O |
- Success Body
{
"result": {
"type": "post",
"status": 200,
"success": true,
"message": "회고 글 삭제 성공",
"data": {
"idx": 10000
}
},
"error": null
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
result.type | String | 데이터 타입 | "post" | O |
result.status | Integer | HTTP status code | 200 | O |
result.success | Boolean | 요청 성공 여부 | false | O |
result.message | String | 응답 메시지 | "회고 글 조회 성공" | |
data.idx | Long | 회고 글 인덱스 | 1 | O |
- Fail Body
{
"result": null,
"error": {
"type": "post",
"status": 500,
"message": "서버 내부 에러"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
error.type | String | 데이터 타입 | "post" | O |
error.status | Integer | HTTP status code | 500 | O |
error.message | String | 결과 메시지 | "서버 내부 에러" |
-
URL
/write
-
Method
GET
-
Headers
{
"access_token": "..."
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
access_token | String | 액세스 토큰 | "..." | O |
- Success Body
{
"result": {
"type": "post",
"status": 200,
"success": true,
"message": "회고 글 작성 페이지 요청 성공",
"data": {
"template":[{
"idx" : 1,
"template_name": "4F",
},{
"idx" : 2,
"template_name": "PSI",
},{
"idx" : 3,
"template_name": "내 양식",
},
...
]
}
"error": null
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
result.type | String | 데이터 타입 | "post" | O |
result.status | Integer | HTTP status code | 200 | O |
result.success | Boolean | 요청 성공 여부 | false | O |
result.message | String | 응답 메시지 | "회고 글 조회 성공" | |
data.idx | Long | 회고 글 인덱스 | 1 | O |
data.category | String | 회고 글 카테고리 | "디자인" | O |
data.title | String | 회고 글 제목 | "이번 주 디자인을 하며 느낀 것들" | O |
data.content | String | 회고 글 내용 | "..." | O |
data.view | Integer | 회고 글 조회수 | 326 | O |
data.user.idx | Long | 회고 글 작성자 인덱스 | 55 | O |
data.user.nickname | String | 회고 글 작성자 닉네임 | "어피치" | O |
data.user.picture | String | 회고 글 작성자 프로필 이미지 URL | "..." |
- Fail Body
{
"result": null,
"error": {
"type": "post",
"status": 500,
"message": "서버 내부 에러"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
error.type | String | 데이터 타입 | "post" | O |
error.status | Integer | HTTP status code | 500 | O |
error.message | String | 결과 메시지 | "서버 내부 에러" |
-
URL
/:idx/update
-
Method
GET
-
Headers
{
"access_token": "..."
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
access_token | String | 액세스 토큰 | "..." | O |
- Success Body
{
"result": {
"type": "post",
"status": 200,
"success": true,
"message": "회고 글 수정 페이지 요청 성공",
"data": {
"idx": 1,
"category": "디자인",
"title": "이번 주 디자인을 하며 느낀 것들",
"content": "...",
"view": 326,
"user": {
"idx": 55,
"nickname": "어피치",
"picture": "..."
},
"template": {
"idx": 3,
"template_name": "DAKI"
}
}
},
"error": null
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
result.type | String | 데이터 타입 | "post" | O |
result.status | Integer | HTTP status code | 200 | O |
result.success | Boolean | 요청 성공 여부 | false | O |
result.message | String | 응답 메시지 | ""회고 글 수정 페이지 요청 성공" | |
data.idx | Long | 회고 글 인덱스 | 1 | O |
data.category | String | 회고 글 카테고리 | "디자인" | O |
data.title | String | 회고 글 제목 | "이번 주 디자인을 하며 느낀 것들" | O |
data.content | String | 회고 글 내용 | "..." | O |
data.view | Integer | 회고 글 조회수 | 326 | O |
data.user.idx | Long | 회고 글 작성자 인덱스 | 55 | O |
data.user.nickname | String | 회고 글 작성자 닉네임 | "어피치" | O |
data.user.picture | String | 회고 글 작성자 프로필 이미지 URL | "..." | |
data.template.idx | Long | 템플릿 인덱스 | 1 | O |
data.template.template_name | String | 템플릿 이름 | "DAKI" | O |
- Fail Body
{
"result": null,
"error": {
"type": "post",
"status": 500,
"message": "서버 내부 에러"
}
}
Field | Type | Description | Example | Required |
---|---|---|---|---|
error.status | Integer | HTTP status code | 500 | O |