feat: adjust comments
This commit is contained in:
@@ -58,7 +58,7 @@ def add_model_routes(app: FastAPI, clazz: type[BasicModel], route_prefix: str):
|
||||
@router.post('/item')
|
||||
async def _item(body: ItemQuerySchema, session: AsyncSessionDep):
|
||||
"""
|
||||
获取用户详情
|
||||
获取记录详情
|
||||
"""
|
||||
query = select(clazz).where(clazz.id == body.id)
|
||||
result = await session.execute(query)
|
||||
@@ -68,7 +68,7 @@ def add_model_routes(app: FastAPI, clazz: type[BasicModel], route_prefix: str):
|
||||
@router.post('/insert')
|
||||
async def _insert(body: InsertBodySchema, session: AsyncSessionDep):
|
||||
"""
|
||||
插入用户
|
||||
插入记录
|
||||
"""
|
||||
new_obj = body.row
|
||||
if not new_obj.id:
|
||||
@@ -80,7 +80,7 @@ def add_model_routes(app: FastAPI, clazz: type[BasicModel], route_prefix: str):
|
||||
@router.post('/update')
|
||||
async def _update(body: UpdateBodySchema, session: AsyncSessionDep):
|
||||
"""
|
||||
更新用户
|
||||
更新记录
|
||||
"""
|
||||
edit_obj = body.row
|
||||
query = select(clazz).where(clazz.id == edit_obj.id)
|
||||
@@ -105,7 +105,7 @@ def add_model_routes(app: FastAPI, clazz: type[BasicModel], route_prefix: str):
|
||||
@router.post('/delete')
|
||||
async def _delete(body: clazz, session: AsyncSessionDep):
|
||||
"""
|
||||
更新用户
|
||||
删除记录
|
||||
"""
|
||||
query = select(clazz).where(clazz.id == body.id)
|
||||
result = await session.execute(query)
|
||||
|
||||
Reference in New Issue
Block a user