회원 정보

Method URL Req Res Etc
Register POST /api/auth/register Body:{
id(username):
password
} {
ok:true
status:201,
msg:’회원가입 완료
}
{
ok:false,
Status:
Msg:중복된 아이디 입니다}
} id(username):5~10자
Password:
8자 - 20자
대소문자, 특수문자,숫자 포함
Login POST /api/auth/login Body:{
id(username)
password
} {
ok:true,
Status:200,
Msg:로그인완료
Data:{
Token
User:{Id(username), nickname}
}
알림 설정 유무(첫 로그인일 경우 알림 팝업이 떠야 하기 때문에)
소셜 로그인
로그아웃 프론트~~~~~ 프론트~~~~~ 프론트~~~~~ 프론트~~~~~ 프론트~~~~~

내정보

Method URL Req Res Etc
MyPage GET /api/mypage {

} | { isNotice:””, timePA:””, hour:””, min:””, } | | | | | | | | | | |

메인 페이지

Method URL Req Res Etc
Main GET /api/main {
} {
audios;[
{
id, //오디오의ID
title,
audioUrl,
category,
iconUrl,
playTime, //optional
},
{
id, //오디오의ID
title,
audioUrl,
category,
iconUrl,
playTime, //optional
},
]
}

수면 기록

Method URL Req Res Etc
Notice(마이페이지 isNotice 프론트 필터)/알림수정은 전체 가져옴 GET /api/notice {
} {
isNotice : “true/false”,
timePA: “PM”or”AM”,
hour : “12”,
min: “00”,
}
Notice(로그인시) POST /api/notice {
isNotice:””
timePA:””,
hour:””,
min:””,
}
성공
{
statusCode(200)
}
실패
{
statusCode(400)
}

힐링 보이스

Method URL Req Res Etc
Voice
랜덤-배열(본인 녹음 안 뜰 수도 있음)
GET /api/voice {
} {
voice:[
{
id, //voice 의 ID
voiceUrl
}
{
voiceId,
voiceUrl
}
]
(랜덤)
Voice
로그인 유저만 사용 가능 Post /api/voice {
voiceFile: “”
} 성공
{
id,
voiceUrl
}
실패
{
statusCode(400)}
Method URL Req Res Etc
Diary GET /api/diary {
year: “2021”
month: “12”,
} {
diary:[
{
day:”1”
feelingScore:”5”,
enoughSleep:”5”,
comment:””,
},
{
day:”2”
feelingScore:”5”,
enoughSleep:”5”,
comment:””,
},
{
day:”3”
feelingScore:”0”,
enoughSleep:”0”,
comment:””,
},
{
day:”4”
feelingScore:”5”,
enoughSleep:”5”,
comment:””,
},
]
sleepAvg:””
} //스코어 추가

배열의 숫자는 해당 월의 일 수 만큼

값을 합산 달끼리 비교 | | | Diary | POST | /api/diary | { year:”2021”, month:”12”, day:”25”, feelingScore:”5”, enoughSleep:”2”, comment:”수면기록코멘트”, } | 성공 { statusCode(201) } 실패 { statusCode(400) } | | | | Diary | PUT | /api/diary | { year:”2021”, month:”12”, day:”25”, feelingScore:”5”, enoughSleep:”2”, comment:”수면기록코멘트”, } | 성공 { statusCode(201) } 실패 { statusCode(400) } | | |

다이어리

Method URL Req Res Etc
Diary GET /api/diary {
year: “2021”
month: “12”,
} {
diary:[
{
day:”1”
feelingScore:”5”,
enoughSleep:”5”,
comment:””,
},
{
day:”2”
feelingScore:”5”,
enoughSleep:”5”,
comment:””,
},
{
day:”3”
feelingScore:”0”,
enoughSleep:”0”,
comment:””,
},
{
day:”4”
feelingScore:”5”,
enoughSleep:”5”,
comment:””,
},
]
sleepAvg:””
} //스코어 추가

배열의 숫자는 해당 월의 일 수 만큼

값을 합산 달끼리 비교 | | | Diary | POST | /api/diary | { year:”2021”, month:”12”, day:”25”, feelingScore:”5”, enoughSleep:”2”, comment:”수면기록코멘트”, } | 성공 { statusCode(201) } 실패 { statusCode(400) } | | | | Diary | PUT | /api/diary | { year:”2021”, month:”12”, day:”25”, feelingScore:”5”, enoughSleep:”2”, comment:”수면기록코멘트”, } | 성공 { statusCode(201) } 실패 { statusCode(400) } | | |

🚀DB

User