cherry_be/README.md
2020-04-10 20:31:14 +08:00

60 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 挂柯南
## 服务器配置
```js
// 安装venv
python3 -m venv venv
// 启动venv
. venv/bin/activate
// 升级pip
pip install --upgrade pip
// 安装flask...
pip install Flask
pip install requests
pip install bs4
pip install gunicorn
pip install pymongo
pip install flask_cors
// 设置全局变量
export FLASK_APP=coc.py
export FLASK_ENV=development
// 启动临时服务
flask run --host=0.0.0.0 -p 8001
// beta
flask run --host=127.0.0.1 -p 5005
// 启动永久服务
gunicorn coc:cherry -c gunicorn.conf.py
// 查看已启动服务
pstree -ap|grep gunicorn
// 关闭某服务
kill (pid)
//关闭venv
deactivate
```
## 错误代码一览
/api/login
100数据校验失败
101账户错误
102教务挂了
200ok
/api/game/schedule/upload
400数据校验失败
401排名表修改失败
/api/game/schedule/get
410: 数据校验失败
411排名表获取失败
# game
* /api/game/schedule/upload
* data
* nick
* count
* time
* sign
* /api/game/schedule/get
* data
* sign