From a469461f88cb46467ec5b7642f42ce7853b6b406 Mon Sep 17 00:00:00 2001 From: Windows <2209639385@qq.com> Date: Mon, 21 Sep 2026 12:24:56 +0800 Subject: [PATCH] nb --- PythonProject/api/grade_api.py | 9 +++++++++ PythonProject/{api/Grades_api.py => dao/grade_dao.py} | 0 PythonProject/schema/grade_schema.py | 10 ++++++++++ 3 files changed, 19 insertions(+) create mode 100644 PythonProject/api/grade_api.py rename PythonProject/{api/Grades_api.py => dao/grade_dao.py} (100%) create mode 100644 PythonProject/schema/grade_schema.py diff --git a/PythonProject/api/grade_api.py b/PythonProject/api/grade_api.py new file mode 100644 index 0000000..b87e9dc --- /dev/null +++ b/PythonProject/api/grade_api.py @@ -0,0 +1,9 @@ +from fastapi import APIRouter,Depends,HTTPException,Path +from util.database import get_db +from model.student_model import Student_Model + +gradeAPI = APIRouter() + +@gradeAPI.get(f"/grade/{id}",summary="根据ID查询单条成绩") +def get_grade(id:int,db=Depends(get_db)): + r =db. diff --git a/PythonProject/api/Grades_api.py b/PythonProject/dao/grade_dao.py similarity index 100% rename from PythonProject/api/Grades_api.py rename to PythonProject/dao/grade_dao.py diff --git a/PythonProject/schema/grade_schema.py b/PythonProject/schema/grade_schema.py new file mode 100644 index 0000000..09de5b5 --- /dev/null +++ b/PythonProject/schema/grade_schema.py @@ -0,0 +1,10 @@ +from datetime import date +from typing import Self +from pydantic import BaseModel,Field + +class GradeRequest(BaseModel): + stu_id:str|None = Field(description="学生编号") + + + +class GradeResponse(BaseModel): \ No newline at end of file