From eedec157a7c7d750f9781940b3dbd90e145f6bf0 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Thu, 15 Aug 2024 09:34:24 +0800 Subject: [PATCH] add interface to get doc infos by doc ids (#1950) ### What problem does this PR solve? ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) --- api/apps/document_app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/apps/document_app.py b/api/apps/document_app.py index baaf7fe30..721f8d137 100644 --- a/api/apps/document_app.py +++ b/api/apps/document_app.py @@ -203,6 +203,14 @@ def list_docs(): return server_error_response(e) +@manager.route('/infos', methods=['POST']) +def docinfos(): + req = request.json + doc_ids = req["doc_ids"] + docs = DocumentService.get_by_ids(doc_ids) + return get_json_result(data=list(docs.dicts())) + + @manager.route('/thumbnails', methods=['GET']) @login_required def thumbnails():