<?php
// +----------------------------------------------------------------------
// | onezan-admin 快速开发的管理平台
// +----------------------------------------------------------------------
// | 官方网址：https://www.onezan.cn
// +----------------------------------------------------------------------
// | onezan团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: 543885307@qq.com
// +----------------------------------------------------------------------
namespace Applications\sample\api\controller\article;

use app\api\controller\BaseApiController;
use Applications\sample\modules\article\service\api\ArticleService;
use think\Request;

/**
 * Article
 * @package Applications\sample\api\controller\article
 */
class Article extends BaseApiController
{
    /**
     * 文章列表
     */
    public function list(Request $request)
    {
        return json($this->app->make(ArticleService::class)->list($request));
    }

    /**
     * 文章详情
     */
    public function detail($id, Request $request)
    {
        return json($this->app->make(ArticleService::class)->detail((int)$id, $this->getOptionalUid($request)));
    }
}
