From bcbc59e6599ee0b0c65f02b891911933df40da84 Mon Sep 17 00:00:00 2001 From: zhaoxiangpeng <1943364377@qq.com> Date: Mon, 12 Jan 2026 10:20:50 +0800 Subject: [PATCH] wos:param model --- .../science_article_add/models/wos_model.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/science_article_add/science_article_add/models/wos_model.py b/science_article_add/science_article_add/models/wos_model.py index 8e4bff6..d671d46 100644 --- a/science_article_add/science_article_add/models/wos_model.py +++ b/science_article_add/science_article_add/models/wos_model.py @@ -314,5 +314,18 @@ def get_refine_count(q_id: str, count: int = 5): return model +def get_record_info(body: bytes, sep: Union[str, bytes] = b'\n'): + resp_texts = body.strip().split(sep) + query_id = None + records_found = 0 + for resp_text in resp_texts: + resp_row_dict: dict = json.loads(resp_text) + if resp_row_dict.get("key") == "searchInfo": + query_id = resp_row_dict.get("payload", {}).get("QueryID") + records_found = resp_row_dict.get("payload", {}).get("RecordsFound") # 找到的记录 + break # 找到就结束 + return query_id, records_found + + if __name__ == '__main__': m1 = lite_base_model(WosDB.WOS)