From 60a72dd2970e564775175ed7ff04552208763668 Mon Sep 17 00:00:00 2001 From: chen <2966418553@qq.com> Date: Wed, 23 Sep 2026 10:24:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=A7=A3=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scores/README_scores.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/scores/README_scores.md b/scores/README_scores.md index 4c31e95..69ca823 100644 --- a/scores/README_scores.md +++ b/scores/README_scores.md @@ -1,33 +1,61 @@ #scores模块解释 ##项目层 + web框架:FastAPI(生成接口) + ORM:sqlalchemy + 校验:MYSQL(通过PyMysql驱动) + 运行:uvicorn,端口12346 用FastAPI显露HTTP接口 ,对MysQL的scores表进行一个增,删,改,查的动作,删除是软删除, + api是接口层,成绩信息的增加,删除,更新,查询 + dao是数据操作层,查询get_scores_dao + 更新add_scores_dao + 增加update_scores_dao + 删除delete_scores_dao + 统计查询80分以上的get_top_students_dao + 查询连续两次不及格的get_failing_students_dao + 班级平均分get_class_avg_dao + model是数据库表模型层,字段信息 id *pk* + sid 链接学生表的学生ID + cid 链接班级表的班级ID + num 考试序次 + score 考试成绩 + t_subject 链接科目表的科目ID + create_date 创建数据的时间 + update_date 更新数据的是时间 + is_deleted 逻辑删除 + deleted_date 删除的时间 + schema是请求体和响应体模型层, 查询的ScoreQuery + 更新,增加,删除的ScoreRequest + databases是数据库定义配置文件, 链接引擎对象db_url,链接地址engine, + 建表的基类Base,数据库会话管理Session + 会话实例def get_db() -main是主程序文件,将配置文件的接口导入,创建接口运行 \ No newline at end of file + +main是主程序文件,将配置文件的接口导入,创建接口运行