Files
xit/sqlalchemy_fastapi_demo/api/__pycache__/students.cpython-310.pyc
T

22 lines
3.0 KiB
Plaintext
Raw Normal View History

2026-09-21 19:14:15 +08:00
o
¸Ò§jÏã@sÊddlmZmZmZmZddlmZddlmZm Z ddl
m Z ddl m
Z
ddlmZmZmZeddgd �Zejd
ed �ee ƒfd ed
efdd„ƒZejdeed �edddd�eddddd�ee ƒfdeded
efdd„ƒZejdeed �eddd�edd d�edd!d�ddee ƒfd"e ed#e ed$e ededed
ef d%d&„ƒZejd'ed �ee ƒfd"ed
efd(d)„ƒZejd'ed �ee ƒfd"ed*ed
efd+d,„ƒZejd'd-d.�ee ƒfd"ed
efd/d0„ƒZdS)1é)Ú APIRouterÚDependsÚ
HTTPExceptionÚQuery)ÚSession)ÚListÚOptional)Úget_db)Ú
StudentDAO)Ú
StudentCreateÚ
StudentUpdateÚStudentResponsez /studentsu学生管ç�†æŽ¥å�£)ÚprefixÚtagsú/)Úresponse_modelÚ
student_inÚdbcCstj||d�}|S)N)rZobj_in)r
Zcreate_student)rrÚstudent©rúWC:\Users\Windows\PycharmProjects\PythonProject7\sqlalchemy_fastapi_demo\api\students.pyÚcreate_student_apisrz/allu跳过的记录数)ÚgeÚ descriptionédééÈu返回的最大记录数)rÚlerÚskipÚlimitcÃs�tj|||d�}|S)N)rr)r
Zget_students_all)rrrÚstudentsrrrÚ get_all_apis€r!z/searchNu 学生编å�·)ru$学生姓å��(支æŒ�模糊查询)u ç�­çº§ç¼–å�·Ústu_idÚstu_nameÚclass_idcÃs�tj||||||d�}|S)N)rr"r#r$rr)r
Zquery_multi_condition)r"r#r$rrrrrrrÚget_multi_condition_api#s€ úr%z /{stu_id}cÃs$�tj||d�}|stddd�‚|S)N)rr"é”u用户ä¸�存在©Ú status_codeÚdetail)r
Úget_student_by_idr)r"rrrrrÚget_student_by_id_api6s
€ r+Ú