- install node and redis
npm install
- start redis
node app
- Register:
POST /account/register
(do not need to implement)
payload:
{
userId: string,
name: string,
password: string,
courses: [
string
]
}
- Login:
POST /account/login
payload:
{
userId: string,
password: string
}
respond: 200 - {uuid: string}
or 400 - failed
UUID is like user ID but unique for each user
- Get profile:
GET /account/:UUID
response:
200 - {
name: string,
courses: [
string
]
}
or
400 - failed
- Get profile picture:
GET /account/picture/:UUID
response: image
- Update profile:
PUT /account/:UUID
payload:
{
name: string (optional),
courses: [
string
]
}
- Sign up for study:
POST /study/schedule
payload:
{
uuid: string,
date: "DDMMYY",
maxMembers: int,
courses: [
string
]
}
- Remove for study:
DELETE /study/schedule
payload:
{
uuid: string,
date: "DDMMYY",
groupMembers: [
(UUIDs of group members)
],
courses: [
string
]
}
- Check status for study group:
GET /study/schedule/:UUID
response:
[
{
date: "DDMMYY",
courses: [
string
],
group: [
(UUIDs of group numbers)
]
},
{
date: "DDMMYY",
courses: [
string
],
group: [
(UUIDs of group numbers)
]
}
]