python3 -m pip install --user -r requirements.txt
You can use shell script to start or stop the application
cd volunteer-certificate
# start up
./bin/start.sh
# shutdown
./bin/stop.sh
# restart
./bin/restart.sh
You need to put data.json
, pic.jpg
in the project root directory.
cp config/data.json ./
Optionally you can make a file email.json
and edit the configuration.
cp config/email.json.config email.json
To start the server, run the following command in project root directory
python3 app.py
To test whether the server works, you can use curl
curl http://127.0.0.1:5000/api/getUserInfo?token=dsfasgdafgaggsdagdsg
类型:get请求
https://api.wuhan2020.org.cn/api/getUserInfo?token=dsfasgdafgaggsdagdsg
{
"code": 0,
"data": {
"email":"xxxx@yeah.net", //邮箱,在页面不可以编辑
"name":"xxxxx", //称呼
},
"message": "success"
}
{
"code": 1,
"data": "",
"message": "user not in server"
}
https://api.wuhan2020.org.cn/api/submitUserInfo
类型:post请求 post的Content-Type一定是application/json
入参
{
"token":"dsfasgdafgaggsdagdsg", // token
"name":"new namw" //修改后的称呼
}
结果
{
"code":0, // 成功
"message": "",
"data":null
}
{
"code":1, // 失败
"message": "网络异常",
"data":null
}
http://47.75.179.6:5000/api/addUserData
按照github 拼音顺序进行排列
字段 | 类型 | 名称 | 描述 |
---|---|---|---|
id | 整型 | 自增主键 | |
token | 字符型 | 验证码 | 因为没有用户权限系统,所以用token作为本次活动权限标识,用uuid算法生成唯一串 |
name | 字符型 | 称呼 | |
字符型 | 邮箱 | ||
number | 字符型 | 证书编号 | 在数据源导入时候已经生成 |
pic_url | 字符型 | 生成证书图片名称 | |
status | 整型 | 状态 | 0:初始化 1 已经发送提醒邮件 2:用户已提交 3:图片已经生成 4:证书邮件已发出 |
将为当前邮箱状态为0的邮箱生成token(可以定时任务扫描),并更新本行记录的token为新token
每个邮件的关键内容为确认称呼的ur:
https://community.wuhan2020.org.cn/zh-cn/certification/index.html?token=dsfasgdafgaggsdagdsg
邮件发送完毕后,状态置为 1
调用接口1.通过token获取用户信息展示数据
调用接口**2.用户提交信息:**提交到后端
状态2后每一次断掉可以重试(定时任务扫描)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。