[BREAKING CHANGE] GET to POST: enhance kb list capability (#7205)

### What problem does this PR solve?

Enhance capability of `list_kbs`.

Breaking change: change method from `GET` to `POST`.

### Type of change

- [x] Refactoring
- [x] Enhancement with breaking change
This commit is contained in:
Yongteng Lei
2025-04-22 17:54:12 +08:00
committed by GitHub
parent ba0e363d5a
commit f35ff65c36
3 changed files with 40 additions and 25 deletions

View File

@ -150,6 +150,7 @@ class KnowledgebaseService(CommonService):
cls.model.name,
cls.model.language,
cls.model.description,
cls.model.tenant_id,
cls.model.permission,
cls.model.doc_num,
cls.model.token_num,
@ -184,7 +185,8 @@ class KnowledgebaseService(CommonService):
count = kbs.count()
kbs = kbs.paginate(page_number, items_per_page)
if page_number and items_per_page:
kbs = kbs.paginate(page_number, items_per_page)
return list(kbs.dicts()), count