<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2017/11/20
 * Time: 15:50
 */
Route::group(['domain' => env('CHANNEL_DOMAIN'), 'namespace' => 'App\Http\Controllers\Channel\SendOrder', 'prefix' => 'api/sendOrder', 'middleware' => 'ChannelApiAuth'], function () {

    Route::group(['middleware'=>'ChannelOperateRecord'],function (){
        //获取派单列表派单
        Route::get('getSendOrders', 'SendOrderController@getSendOrders');

        //生成派单（推广页面）
        Route::post('createFromPage', 'SendOrderController@createFromPage');
        
        //获取周报
        Route::get('getWeeklySendOrderStatistics', 'SendOrderStatisticsController@getWeeklySendOrderStatistics');

        //通过模板图片生成
        Route::post('createFromPromotionImageTemplate', 'SendOrderController@createFromPromotionImageTemplate');

        //生成派单（章节）
        Route::post('createFromChapter', 'SendOrderController@createFromChapter');

        //生成派单（目录）
        Route::post('createFromDirectory', 'SendOrderController@createFromDirectory');

        //更新派单备注
        Route::post('updateRemark', 'SendOrderController@updateRemark');

        //更新派单星级数
        Route::post('updateStarNum', 'SendOrderController@updateStarNum');

        //更新派单星级数和备注
        Route::any('updateStarNumAndRemark', 'SendOrderController@updateStarNumAndRemark');

        //获取派单的统计信息
        Route::get('getDataInfo', 'DataInfoController@getDataInfo');

        //获取导出派单的统计信息
        Route::get('exportSendOrders', 'SendOrderController@exportSendOrders');

        //更新派单信息
        Route::any('updateSendOrderInfo', 'SendOrderController@updateSendOrderInfo');

        //删除派单
        Route::post('removeSendOrder', 'SendOrderController@removeSendOrder');

        //设置成本
        Route::post('setCost', 'SendOrderController@setCost');

        Route::post('uploadSendOrders', 'SendOrderController@uploadSendOrders');

        //获取回本率数据
        Route::get('getSendOrderBreakevenStats', 'SendOrderBreakevenStatsController@getSendOrderBreakevenStats');

        //导出回本率数据
        Route::get('exportSendOrderBreakevenStats', 'SendOrderBreakevenStatsController@exportSendOrderBreakevenStats');

        Route::get('downloadTemplate', 'SendOrderBatchHandleController@downloadTemplate');
        Route::post('importSendOrders', 'SendOrderBatchHandleController@importSendOrders');


        Route::post('checkOriginUrl', 'SendOrderController@checkOriginUrl');
        Route::post('decryptOrEncrptOriginUrl', 'SendOrderController@decryptOrEncrptOriginUrl');
    });


});