world/wwwroot/api/list_worlds.dspy

11 lines
498 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.

"""世界列表查询sqlPaging + 复合索引(org_id+mode+created_at)过滤。
REST 契约:分页结构 {list, total, page, page_size};错误 {code, message, field, detail}。
"""
try:
data = await list_worlds(dict(params_kw))
return json.dumps(data, ensure_ascii=False)
except Exception as e:
exception('list_worlds.dspy: %s' % e)
return json.dumps({'code': 'INTERNAL_ERROR', 'message': '查询世界列表失败', 'field': '', 'detail': format_exc()}, ensure_ascii=False)