%E2%9C%8D%EF%B8%8F To Do %E2%9C%8D%EF%B8%8F - Polaris-Sopterm/Polaris-BACKEND GitHub Wiki
- 할 일 생성 API
createToDo
- 여정별 할 일 목록 API
listToDoByJourneys
- 날짜별 할 일 목록 API
listToDoByDate
- 할 일 수정 API
updateToDo
- 할 일 삭제 API
deleteToDo
- 날짜별 할 일 생성
- 여정별 할 일 생성
두 가지 기능을 모두 제공합니다.
POST
/toDo/v0
application/json
보다 쉽게 이해 할 수 있도록 여정별, 날짜별 나누어 작성하도록 하겠습니다.
- 여정별 할 일 생성
parameter | Type | Description |
---|---|---|
title |
string | 할 일 제목 |
date |
string(Date) | 할 일 수행 날짜(이번 주 중 언제 이 일을 해볼까요?) |
journeyIdx |
int | 할 일을 생성하려는 여정 idx |
isTop |
boolean | 상단 고정 여부 |
- 날짜별 할 일 생성
journeyTitle은 여정의 여정 제목 목록을 통해 해당 주차의 여정 목록 제목과 idx를 가져올 수 있습니다. 만약 선택안함이면 title에 default, journeyIdx에 null 이면 됩니다.
parameter | Type | Description |
---|---|---|
title |
string | 할 일 제목 |
date |
string(Date) | 할 일을 생성 하려는 날짜 |
journeyIdx |
int | 할 일을 생성하려는 여정 idx/ 기본 여정(default)인 경우는 null 값으로 전달 |
isTop |
boolean | 상단 고정 여부 |
{
"idx": {integer},
"createdAt": {string},
"updatedAt": {string},
}
여정별로 할 일 목록을 보여줍니다.
GET
/toDo/v0/journey?year=2021&month=6&weekNo=3
?이후부터는 예시
application/json
query parameter이지만 필수로 인자를 전달해주셔야합니다.인자를 붙이지 않을 시 전체 목록이 호출됩니다.
parameter | Type | Description |
---|---|---|
year |
string | 년도 |
month |
string | 월 |
weekNo |
string | 주차 정보 |
[
{
"idx": {integer},
"title": {string},
"value1": {string(enum)},
"value2": {string(enum)},
"year": {integer},
"month": {integer},
"weekNo": {integer},
"userIdx": {integer},
"toDos": [
{
"idx": {integer},
"title": {string},
"isTop": {boolean},
"isDone": {string(Date)},
"date": {string(-월 -일 -요일)},
"createdAt" {string}
},
{
...
},
...
],
},
{
"idx": {integer},
"title": {string},
"value1": {string(enum)},
"value2": {string(enum)},
"year": {integer},
"month": {integer},
"weekNo": {integer},
"userIdx": {integer},
"toDos": [
{
"idx": {integer},
"title": {string},
"isTop": {boolean},
"isDone": {string(Date)},
"date": {string(-월 -일 -요일)},
"createdAt" {string}
},
{
...
},
...
],
},
...
]
날짜별로 할 일 목록을 보여줍니다.
GET
/toDo/v0/date?year=2021&month=6&weekNo=3
?이후부터는 예시
application/json
query parameter이지만 필수로 인자를 전달해주셔야합니다. 인자를 붙이지 않을 시 전체 목록이 호출됩니다.
parameter | Type | Description |
---|---|---|
year |
string | 년도 |
month |
string | 월 |
weekNo |
string | 주차 정보 |
request
: localhost:3000/toDo/v0/date?year=2021&month=7&weekNo=4
{
"data": [
{
"day": "7월 20일 화요일",
"todoList": [
{
"idx": 4,
"title": "aaada",
"isTop": false,
"isDone": null,
"date": "7월 20일 화요일",
"createdAt": "2021-07-22T09:57:05.961Z"
}
]
},
{
"day": "7월 21일 수요일",
"todoList": [
{
"idx": 1,
"title": "aaa",
"isTop": false,
"isDone": null,
"date": "7월 21일 수요일",
"createdAt": "2021-07-22T06:00:49.889Z"
},
{
"idx": 2,
"title": "aada",
"isTop": false,
"isDone": null,
"date": "7월 21일 수요일",
"createdAt": "2021-07-22T06:52:29.854Z"
},
{
"idx": 3,
"title": "aaada",
"isTop": false,
"isDone": null,
"date": "7월 21일 수요일",
"createdAt": "2021-07-22T06:53:05.945Z"
}
]
}
]
}
할 일을 수정합니다. 할 일 완료 체크를 해당 API를 사용하시면 됩니다.
isDone
을 True
로 주시면 isDone에 완료시각이 저장됩니다.
PATCH
/toDo/v0/:toDoIdx
application/json
parameter | Type | Description |
---|---|---|
title |
string | 할 일 제목 |
date |
string(date) | 할 일 날짜 |
journeyIdx |
integer | 연결될 여정 idx |
isTop |
boolean | 상단 고정 여부 |
isDone |
boolean | 할 일 완료 여부 |
{
"idx": {integer},
"journeyIdx": {integer},
"title": {string},
"isTop": {boolean},
"isDone": {string(Date)},
"date": {string(-월 -일 -요일)},
"createdAt" {string}
},
할 일을 삭제합니다.
DELETE
/toDo/v0/:toDoIdx
application/json
200
{
"isSuccess": true
},