From cbd7e5ab97f36b271de7f5f5811d26ba4ac84604 Mon Sep 17 00:00:00 2001 From: 0919word <835535015@qq.com> Date: Mon, 21 Sep 2026 09:25:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=AE=A1=E7=90=86=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PythonProject/model/class_model.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PythonProject/model/class_model.py b/PythonProject/model/class_model.py index 5ab4883..c028862 100644 --- a/PythonProject/model/class_model.py +++ b/PythonProject/model/class_model.py @@ -4,10 +4,6 @@ from sqlalchemy.orm import declarative_base from pydantic import BaseModel -db_url = "mysql+pymysql://root:123456@127.0.0.1:3306/ai0824?charset=utf8mb4" -engine = create_engine(db_url) - -Base = declarative_base() class ClassManagement(Base): __tablename__ = "wl_class" @@ -33,6 +29,8 @@ class ClassManagement(Base): ) delete_time = Column(DateTime, nullable=True, comment='删除时间') +Base.metadata.create_all(engine) +/ app=FastAPI(title='学生管理系统班级管理') class ClassRequest(BaseModel):