fix(knowledge): paginate document list without content

This commit is contained in:
mlogclub
2026-04-30 13:43:22 +08:00
parent 3245c7f73b
commit 8be2d06283
8 changed files with 176 additions and 42 deletions
@@ -39,10 +39,10 @@ func (c *KnowledgeDocumentController) AnyList() *web.JsonResult {
cnd.Where("index_status = ?", indexStatus)
}
list, paging := services.KnowledgeDocumentService.FindPageByCnd(cnd)
results := make([]response.KnowledgeDocumentResponse, 0, len(list))
list, paging := services.KnowledgeDocumentService.FindPageListByCnd(cnd)
results := make([]response.KnowledgeDocumentListResponse, 0, len(list))
for _, item := range list {
results = append(results, builders.BuildKnowledgeDocument(&item))
results = append(results, builders.BuildKnowledgeDocumentList(&item))
}
return web.JsonData(&web.PageResult{Results: results, Page: paging})
}