From 66c51f334380e3184cfbb11da2eb2fa78dbd870f Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Fri, 12 Dec 2025 17:09:17 +0800 Subject: [PATCH 1/2] update --- b/product/get_firstpage_product_tree.dspy | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/b/product/get_firstpage_product_tree.dspy b/b/product/get_firstpage_product_tree.dspy index 53cdfeb..5e07266 100644 --- a/b/product/get_firstpage_product_tree.dspy +++ b/b/product/get_firstpage_product_tree.dspy @@ -705,6 +705,18 @@ async def get_firstpage_product_tree(ns={}): key=lambda x: (priority.get(x['thrTitle'], 4), result.index(x)) ) data['product_service'][0]['secMenu'][0]['thrMenu'] = sorted_data + + # 使用jsonpath 查找data下所有value下name包含'用'的对象 + if ns.get('keyword'): + jsonpath_result = jsonpath.jsonpath(data, '$..value') + data = [] + jsonpath_result = jsonpath_result if jsonpath_result else [] + for item in jsonpath_result: + for sub_item in item: + if ns['keyword'] in sub_item.get('name', ''): + data.append(sub_item) + + return { 'status': True, 'msg': 'get product list success', From 38700cd786cd56227cfc981ad4053ee25bc26b33 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Fri, 12 Dec 2025 17:11:55 +0800 Subject: [PATCH 2/2] update --- kgadget/src/kgadget.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kgadget/src/kgadget.py b/kgadget/src/kgadget.py index eb6de3a..f40200a 100644 --- a/kgadget/src/kgadget.py +++ b/kgadget/src/kgadget.py @@ -111,6 +111,8 @@ from KaiYyEnDecryptUtil import KaiYyEnDecryptUtil from async_container import async_post +import jsonpath + if __name__ == '__main__': p = ProgramPath() parser = argparse.ArgumentParser(prog='Kaiyuan cloud Bussiness Operation Support System') @@ -214,6 +216,7 @@ if __name__ == '__main__': g.BaiduKafKaConsumer = BaiduKafKaConsumer g.KaiYyEnDecryptUtil = KaiYyEnDecryptUtil g.async_post = async_post + g.jsonpath = jsonpath i18n = getI18N(path=workdir) info(f'gadget version={__version__}')