<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    //API
    $router->get('api/iptvChannel', 'ApiController@iptvChannel');
    $router->get('api/series', 'ApiController@series');
    $router->get('api/tagType', 'ApiController@tagType');
    $router->get('api/tag', 'ApiController@tag');
    $router->get('api/ftpServer', 'ApiController@ftpServer');
    $router->get('api/getIptvChannelListByKey', 'ApiController@getIptvChannelListByKey');


    //问题
    $router->resource('question', 'QuestionController');
    //选项
    $router->resource('option', 'OptionController');
    
    //影片
    $router->put('movie/relationProgram', 'MovieController@relationProgram');
    $router->put('movie/pushMovie', 'MovieController@pushMovie');
    $router->resource('movie', 'MovieController');

    $router->get('program/getProgramListByKey', 'ProgramController@getProgramListByKey');
    $router->put('program/relationSeries', 'ProgramController@relationSeries');
    $router->resource('program', 'ProgramController');
    
    $router->get('series/getSeriesListByKey', 'SeriesController@getSeriesListByKey');
    $router->put('series/addToPushTask', 'SeriesController@addToPushTask');
    $router->resource('series', 'SeriesController');
    
    // FTP 
    $router->get('ftpserver/{id}/sync', 'FtpserverController@sync');
    $router->resource('ftpserver', 'FtpserverController');

    // 合作公司
    $router->resource('company', 'CompanyController');

    // 渠道
    $router->resource('iptvchannel', 'IptvChannelController');

    // 注入点
    $router->resource('injection', 'InjectionController');

    // 标签
    $router->resource('tag', 'TagController');

    // 标签类型
    $router->resource('tagtype', 'TagTypeController');

    // 图片
    $router->resource('picture', 'PictureController');

    //推送任务
    $router->get('pushtask/getTaskListByKey', 'PushTaskController@getTaskListByKey');
    $router->get('pushtask/{id}/start', 'PushTaskController@start');
    $router->resource('pushtask', 'PushTaskController');

});
