world/wwwroot/api/list_worlds.dspy

16 lines
748 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
# list_worlds.dspy —— 分页列表查询sqlPaging + 复合索引 idx_world_list
# 分页结构:{list, total, page, page_size}
debug('list_worlds.dspy: START params_kw=%s' % json.dumps(dict(params_kw), ensure_ascii=False))
try:
result = await list_worlds(dict(params_kw))
return {"status": "ok", "data": result}
except Exception as e:
code = getattr(e, 'code', 'INTERNAL_ERROR')
message = getattr(e, 'message', str(e)) or str(e)
field = getattr(e, 'field', '')
detail = getattr(e, 'detail', '') or ''
debug('list_worlds.dspy: ERROR %s %s' % (code, message))
exception(format_exc())
return {"status": "error", "code": code, "message": message, "field": field, "detail": detail}