|
|
@ -7,6 +7,36 @@ db = client["back"] |
|
|
|
collection = db["users"] |
|
|
|
|
|
|
|
|
|
|
|
# 初始化数据 |
|
|
|
def initData(): |
|
|
|
isAdmin = collection.find_one({"isAdmin": 1, "isExit": 1}) |
|
|
|
if isAdmin is None: |
|
|
|
# 学校名称、学校代号、专业名称、专业代号、年级、班级、学生姓名、学号、成绩、作弊情况(作弊类型、作弊时间、作弊图片)、考试类型、考试科目、考试时间段、是否是管理员、是否删除、创建时间、更新时间 |
|
|
|
# xuexiaomingcheng、xuexiaodaihao、zhuanyemingcheng、zhuanyedaihao、nianji、banji、xueshengxingming、xuehao、chengji、zuobiqingkuang(zuobileixing、zuobishijian、zuobitupian)、kaoshileixing、kaoshikemu、kaoshishijianduan、isAdmin、isExit、chuangjianshijian、gengxinshijian |
|
|
|
user = { |
|
|
|
"xuexiaomingcheng": "", |
|
|
|
"xuexiaodaihao": "", |
|
|
|
"zhuanyemingcheng": "", |
|
|
|
"zhuanyedaihao": "", |
|
|
|
"nianji": "", |
|
|
|
"banji": "", |
|
|
|
"xueshengxingming": "老师", |
|
|
|
"xuehao": "0000", |
|
|
|
"chengji": "", |
|
|
|
"zuobiqingkuang": [], |
|
|
|
"kaoshileixing": "", |
|
|
|
"kaoshikemu": "", |
|
|
|
"kaoshishijianduan": "", |
|
|
|
"isAdmin": 1, |
|
|
|
"isExit": 1, |
|
|
|
"chuangjianshijian": "", |
|
|
|
"gengxinshijian": "", |
|
|
|
} |
|
|
|
collection.insert_one(user) |
|
|
|
else: |
|
|
|
print(888, isAdmin) |
|
|
|
|
|
|
|
|
|
|
|
# 测试 |
|
|
|
@app.route("/") |
|
|
|
def hello(): |
|
|
@ -49,4 +79,5 @@ def delete_data(): |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
initData() |
|
|
|
app.run() |
|
|
|