This commit is contained in:
2026-07-03 10:05:21 +08:00
parent 5a98d7c1f2
commit 2d7b8ca334
7 changed files with 332 additions and 100 deletions
+19 -1
View File
@@ -1,7 +1,7 @@
from datetime import datetime, timezone
from fastapi import APIRouter, Body, Depends, HTTPException, Path, Query
from sqlalchemy import select
from sqlalchemy import and_, select
from sqlalchemy.ext.asyncio import AsyncSession
from app.dependencies import get_current_user, get_db
@@ -232,6 +232,21 @@ async def list_tasks(
description="查询相关用户名的对应记录[管理后台]",
examples=["demo"],
),
engine_id: str | None = Query(
None,
description="按引擎ID筛选[管理后台]",
examples=["0019e1697667d0eff39"],
),
created_start: datetime | None = Query(
None,
description="创建时间起始(含),ISO 格式,例如 2026-07-03T00:00:00",
examples=["2026-07-03T00:00:00"],
),
created_end: datetime | None = Query(
None,
description="创建时间截止(含),ISO 格式,例如 2026-07-03T23:59:59",
examples=["2026-07-03T23:59:59"],
),
current_user: User = Depends(get_current_user),
db: AsyncSession = Depends(get_db),
):
@@ -250,6 +265,9 @@ async def list_tasks(
page,
page_size,
is_admin,
engine_id=engine_id,
created_start=created_start,
created_end=created_end,
)
# ====================== 在这里加排序(最新在前)======================