llmage/wwwroot/api/get_search_upappid.dspy

14 lines
410 B
Plaintext

result = [{'value': '', 'text': '全部'}]
try:
async with get_sor_context(request._run_ns, 'uapi') as sor:
apps = await sor.sqlExe(
"select id as value, name as text from upapp order by name",
{}
)
return json.dumps([{'value': '', 'text': '全部'}] + list(apps), ensure_ascii=False)
except Exception as e:
debug(f'get_search_upappid error: {e}')
return json.dumps(result, ensure_ascii=False)