feat:增加分页功能
This commit is contained in:
@@ -57,6 +57,7 @@ from tool.llm import llm
|
||||
from utils.exceptions import ForbiddenError, NotFoundError, ParamError
|
||||
from utils.request_id import get_request_id, new_request_id
|
||||
from utils.response import success
|
||||
from utils.pagination import normalize_pagination
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
@@ -474,10 +475,11 @@ async def list_query_history(
|
||||
):
|
||||
"""分页读取当前员工自己的查询历史。"""
|
||||
ensure_query_employee(user)
|
||||
page, page_size, offset = normalize_pagination(page, page_size)
|
||||
rows = await Nl2SqlPermissionRepo(db).list_query_history(
|
||||
user.id,
|
||||
limit=page_size,
|
||||
offset=(page - 1) * page_size,
|
||||
offset=offset,
|
||||
status=status,
|
||||
start_time=start_time,
|
||||
end_time=end_time,
|
||||
|
||||
Reference in New Issue
Block a user