llmage/wwwroot/api/get_upapps.dspy
yumoqing d84cc1d859 fix: API返回纯数组格式,添加模型上下架功能
- get_organizations/get_upapps/uapi_options: 返回纯数组[{value,text}]
- 新增 get_catelogs/get_apis/get_ppids: 独立下拉数据API
- llm_api_map_manage.ui: 使用独立API替代data_field嵌套格式
- json/llm.json: 移除data_field,添加上架/下架toolbar
- llm_status_update.dspy: 模型上下架状态更新API
- 重新生成 llm/index.ui CRUD界面
2026-05-30 01:43:09 +08:00

18 lines
514 B
Python

#!/usr/bin/env python3
import json
result = []
try:
async with get_sor_context(request._run_ns, 'uapi') as sor:
user_orgid = await get_userorgid()
apps = await sor.sqlExe(
"select id, name from upapp where ownerid = ${ownerid}$ or ownerid is null order by name",
{'ownerid': user_orgid}
)
result = [{'value': r['id'], 'text': r['name']} for r in (apps or [])]
except Exception as e:
pass
return json.dumps(result, ensure_ascii=False, default=str)