写好了增加学生接口,增加学生dao层,main里加入了student——router

This commit is contained in:
wolin_liyujie
2026-09-21 16:19:44 +08:00
parent da71b48a10
commit 1a8e4f7571
9 changed files with 82 additions and 55 deletions
+3 -3
View File
@@ -6,11 +6,11 @@ from core.database import Base, engine
# 为了符合三范式,就业表只保存 student_id,不保存学生姓名和班级名称。查询返回时通过关联 students 和 classes 带出学生姓名、班级名称。
class Employment(Base):
__tablename__ = "employments" # 实际数据库的表名字
id = Column(BigInteger, primary_key=True # 主键
__tablename__ = "employment_info_detail" # 实际数据库的表名字
id = Column(Integer, primary_key=True # 主键
, autoincrement=True # 声明是自增主键
,comment="就业信息主键id")
student_id = Column(BigInteger, ForeignKey("students.id") # 外键 -> students.id
student_id = Column(Integer, ForeignKey("student_info_detail.id") # 外键 -> students.id
, nullable=False # 不允许为null
,comment="关联学生id")
employment_status = Column(String(50)