Supported method: POST
Registered at /account/login/
{
"name": "David",
"app_id": "aljsd8asdabsdb728d1djhasbkdjb",
"app_secret": "dasdasdasdabsdb728d1djhasbkdjb",
"code": "sdasdasdasda"
}
return value
{
"msg": "login!",
"token": "kjdagsjhdkanbcajgscjdgajhsbcjhagsc"
}
to remain login state, add followering to your request header
header: {
'Authorization': 'JWT <str:token>'
}
example:
header: {
'Authorization': 'JWT lakshdkjagsdjkgaskjdgkjasgdkjakjabsdkjasd'
}
Ever since the first login, one wechat union id will be bound with a name in the member name list. If login fail, the backend will retrun
{
"msg": "Error information"
}
and you may show the message directly to user
Supported method: POST
Registered at /absence/
{
"reason": "reasons",
"time_absence": "2018-01-22",
"type": "全体排练"
}
error response
{
"msg": "error reasons"
}
type choices: 全体排练, 弦乐分排, 管乐分排, 弦乐重奏, 管乐重奏, 全体排练+弦乐分排, 全体排练+管乐分排 times reach upper bound
{
"msg": "You have used up all of your chances."
}
Supported method: PUT
Registered at /absence/<int:absence_id>/
{
"reason": "reasons",
"time_absence": "2018-01-22",
"type": "A"
}
type choices: 全体排练, 弦乐分排, 管乐分排, 弦乐重奏, 管乐重奏, 全体排练+弦乐分排, 全体排练+管乐分排
Supported method: DELETE
Registered at /absence/<int:absence_id>/
401 status code
no return data
Supported method: GET
Registered at /absence/
[
{
"id": 1,
"applier": "David",
"processor": null,
"reason": "testReason",
"time_absence": "2019-11-10",
"time_apply": "2019-11-10",
"result": "Not processed yet!",
"permission": false,
"type": "全体"
}
]
any student try access these information will get code 401
Supported method: GET
Registered at /manager/
[
{
"id": 4,
"applier": "David",
"processor": null,
"reason": "testReason",
"time_absence": "2019-11-10",
"time_apply": "2019-11-10",
"result": "Not processed yet!",
"permission": false,
"type": "全体"
}
]
Supported method: PUT
Registered at /manager/<int:absence_id>/
id is the pk of absence
{
"processor": "David"
"result": "Reason for allowing/not allowing absence",
"permission": false
}
return data
{
"msg": "xxxxxxxx"
}
Supported method: GET
Registered at /manager/<str:time>/present/
time in YYYY-MM-DD formate example: ('2020-3-12')
{
"time": "2018-01-22",
"members":[
{
"name": "David",
"state": "absent"
},
{
"name": "John",
"state": "absent"
}
]
}
filtered by the closest time anyone applied for absence.
Supported method: GET
Registered at /manager/next/
{
"time": "2020-03-24",
"stringed": [
{
"id": 23340,
"applier": "赵乘风",
"processor": null,
"reason": "test2",
"time_absence": "2020-03-24",
"type": "全体排练",
"time_apply": "2020-02-08",
"result": "Not processed yet!",
"permission": false
}
]
"wind": [
{
"id": 23340,
"applier": "赵乘风",
"processor": null,
"reason": "test2",
"time_absence": "2020-03-24",
"type": "全体排练",
"time_apply": "2020-02-08",
"result": "Not processed yet!",
"permission": false
}
],
"percussion": [
{
"id": 23340,
"applier": "赵乘风",
"processor": null,
"reason": "test2",
"time_absence": "2020-03-24",
"type": "全体排练",
"time_apply": "2020-02-08",
"result": "Not processed yet!",
"permission": false
}
],
}
Supported method: GET
Registered at /manager/history/
[
{
"id": 4,
"applier": "David",
"processor": null,
"reason": "testReason",
"time_absence": "2019-11-10",
"time_apply": "2019-11-10",
"result": "Not processed yet!",
"permission": false,
"type": "全体"
}
]
Supported method: GET
Registered at /manager/future/
[
{
"id": 4,
"applier": "David",
"processor": null,
"reason": "testReason",
"time_absence": "2019-11-10",
"time_apply": "2019-11-10",
"result": "Not processed yet!",
"permission": false,
"type": "全体"
}
]
cd /env:root_dir source bin/activate
pip3 install -r requirements.txt
tips: (sudo pip3 install -r requirements.txt) will install teh library to the system's environment instead of env's
python3 manage.py makemigrations python3 manage.py migrate
sudo bash update.sh (the script is set up)