llmage/wwwroot/api/get_upapps.dspy
yumoqing 9aa917bce5 feat: add data_filter and CRUD endpoints for llm table
- Add data_filter with 4 searchable fields (name LIKE, model LIKE, providerid, upappid)
- Add filter_labels for search form display
- Create llm_list.dspy with DBFilter support and LIKE wildcard handling
- Create llm_create.dspy, llm_update.dspy, llm_delete.dspy
- Create get_organizations.dspy and get_upapps.dspy for dropdown options
- Add browserfields alters for providerid and upappid dropdowns
- Add editable URLs for DataViewer CRUD operations
2026-05-26 14:26:38 +08:00

19 lines
622 B
Python

#!/usr/bin/env python3
import json
result = {'success': False, 'data': {'upapps': []}}
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['data']['upapps'] = [{'id': r['id'], 'text': r['name']} for r in (apps or [])]
result['success'] = True
except Exception as e:
result['error'] = str(e)
return json.dumps(result, ensure_ascii=False, default=str)