generated from team-B-free/express-typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 5
구현 : timelog
whoamixzerone edited this page Jul 29, 2022
·
4 revisions
timelog에 대한 상세 구현 문서입니다.
기능 목록
- 출근시간 등록
- 퇴근시간 등록
- 출퇴근시간 조회
POST http://localhost:3000/api/timelog
{
"status": 200,
"isSuccess": true,
"message": "성공",
"data" : {"id" : 1, "fromWork" : "2022-07-28T08:55:11.000Z"}
}
- fromWork : 현재시간보다 이전시간 등록 불가능
PATCH http://localhost:3000/api/timelog/1
{
"status": 200,
"isSuccess": true,
"message": "성공",
"data" : {"id" : 1, "fromWork" : "2022-07-28T08:55:11.000Z", "toWork" : "2022-07-28T18:05:11.000Z", "workTime" : 9}
}
- toWork: 현재시간보다 이전시간 등록 불가능
GET /api/timelog?period=daily
GET /api/timelog?period=weekly
GET /api/timelog?period=montly
[daily]
{
"status": 200,
"isSuccess": true,
"message": "성공",
"data" : {"id" : 1, "fromWork" : "2022-07-28T08:40:59.0000Z", "toWork" : "2022-07-28T18:00:59.0000Z", "workTime" : 9}
}
[weekly]
{
"status": 200,
"isSuccess": true,
"message": "성공",
"data" : [{
"id": 32,
"fromWork": "2022-07-28T09:00:00.000Z",
"toWork": "2022-07-28T18:05:53.000Z",
"workTime": 9
},
{
"id": 36,
"fromWork": "2022-07-27T08:58:23.000Z",
"toWork": "2022-07-27T18:01:23.000Z",
"workTime": 9
}
...
]
}
[montly]
{
"status": 200,
"isSuccess": true,
"message": "성공",
"data" : [{
"id": 32,
"fromWork": "2022-07-28T09:00:00.000Z",
"toWork": "2022-07-28T18:05:53.000Z",
"workTime": 9
},
{
"id": 36,
"fromWork": "2022-07-27T08:58:23.000Z",
"toWork": "2022-07-27T18:01:23.000Z",
"workTime": 9
}
...
]
}
- workTime: 달의 첫번째 일부터 마지막 일까지 계산해주는 로직