from pot_libs.sanic_api import summary, skip_validate
from unify_api.modules.product_info.components.couse_cps import ArticleListResp, ArticleItem
from unify_api.modules.product_info.procedures.course_pds import get_articles


@summary("获取文章列表接口")
async def post_article_list(request) -> ArticleListResp:
    articles = await get_articles()
    return ArticleListResp([ArticleItem(label=i["title"], url=i["content"]) for i in articles])
