diff --git a/json/llm.json b/json/llm.json index 3b10b0c..007b32d 100644 --- a/json/llm.json +++ b/json/llm.json @@ -38,12 +38,12 @@ "valueField": "id" }, "providerid": { - "uitype": "code", - "dataurl": "{{entire_url('../api/get_organizations.dspy')}}" + "uitype": "code", + "dataurl": "{{entire_url('../api/get_search_providerid.dspy')}}" }, "upappid": { - "uitype": "code", - "dataurl": "{{entire_url('../api/get_upapps.dspy')}}" + "uitype": "code", + "dataurl": "{{entire_url('../api/get_search_upappid.dspy')}}" } } }, diff --git a/scripts/load_path.py b/scripts/load_path.py index 1a6b477..5a53b0a 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -88,6 +88,8 @@ PATHS_LOGINED = [ f"/{MOD}/api/get_catelogs.dspy", f"/{MOD}/api/get_organizations.dspy", f"/{MOD}/api/get_ppids.dspy", + f"/{MOD}/api/get_search_providerid.dspy", + f"/{MOD}/api/get_search_upappid.dspy", f"/{MOD}/api/get_upapps.dspy", f"/{MOD}/api/llm_api_map_create.dspy", f"/{MOD}/api/llm_api_map_delete.dspy", diff --git a/wwwroot/api/get_search_providerid.dspy b/wwwroot/api/get_search_providerid.dspy new file mode 100644 index 0000000..06cf4ef --- /dev/null +++ b/wwwroot/api/get_search_providerid.dspy @@ -0,0 +1,15 @@ +result = [{'providerid': '', 'providerid_text': '全部'}] + +try: + async with get_sor_context(request._run_ns, 'rbac') as sor: + orgs = await sor.sqlExe( + "select id, orgname from organization order by orgname", + {} + ) + if orgs: + for r in orgs: + result.append({'providerid': str(r.id), 'providerid_text': r.orgname or ''}) +except Exception as e: + debug(f'get_search_providerid error: {e}') + +return json.dumps(result, ensure_ascii=False) diff --git a/wwwroot/api/get_search_upappid.dspy b/wwwroot/api/get_search_upappid.dspy new file mode 100644 index 0000000..7d9b890 --- /dev/null +++ b/wwwroot/api/get_search_upappid.dspy @@ -0,0 +1,15 @@ +result = [{'upappid': '', 'upappid_text': '全部'}] + +try: + async with get_sor_context(request._run_ns, 'uapi') as sor: + apps = await sor.sqlExe( + "select id, name from upapp order by name", + {} + ) + if apps: + for r in apps: + result.append({'upappid': str(r.id), 'upappid_text': r.name or ''}) +except Exception as e: + debug(f'get_search_upappid error: {e}') + +return json.dumps(result, ensure_ascii=False)