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

use app\api\controller\BaseApiController;
use app\service\api\channel\ChannelService;
use think\Request;


/**
 * C端渠道控制器
 * 渠道列表、详情、底部导航配置
 * @package app\api\controller\channel
 */
class Channel extends BaseApiController
{
    /**
     * 渠道列表
     * @return \think\response\Json
     */
    public function list()
    {
        return json($this->app->make(ChannelService::class)->list());
    }

    /**
     * 渠道详情
     * @param string $channel 渠道
     * @return \think\response\Json
     */
    public function detail(string $channel)
    {
        return json($this->app->make(ChannelService::class)->detail($channel));
    }

    /**
     * 底部导航配置
     * @param Request $request
     * @return \think\response\Json
     */
    public function bottomNavConfig(Request $request)
    {
        return json($this->app->make(ChannelService::class)->bottomNavConfig($request));
    }
}