Compare commits

...

3 Commits

Author SHA1 Message Date
ping
23057efe1f Merge branch 'main' of https://git.opencomputing.cn/yumoqing/kboss 2025-12-12 17:12:00 +08:00
ping
38700cd786 update 2025-12-12 17:11:55 +08:00
ping
66c51f3343 update 2025-12-12 17:09:17 +08:00
2 changed files with 15 additions and 0 deletions

View File

@ -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',

View File

@ -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__}')