def api_blogs(*,page='1'):
page_index = get_page_index(page)
num = await Blog.findNumber('count(id)')
p = Page(num,page_index)
if num == 0:
return dict(page=0,blogs={})
blogs = await Blog.findAll(orderBy='created_at desc',limit=(p.offset,p.limit))
return dict(page=p,blogs=blogs)
评论列表
文章目录