<?php

use Illuminate\Support\Facades\Route;
use Modules\CpManage\Http\Controllers\CpListController;
use Modules\CpManage\Http\Controllers\CpSubscribeStatisticDataController;


Route::prefix('cpManage')->group(function () {
    Route::prefix('cp')->group(function () {
        Route::apiResource('manage/cp_list', CpListController::class);
        // cp选择项
        Route::any('options',[CpListController::class,"selectOptions"]);
        /**
         * cp结算数据中心
         */
        Route::get('subscribeStatisticData/list', [CpSubscribeStatisticDataController::class, 'list']);
        /**
         * cp结算数据中心统计数据
         */
        Route::get('subscribeStatisticData/listStatistic', [CpSubscribeStatisticDataController::class, 'listStatistic']);
        /**
         * cp结算
         */
        Route::get('subscribeStatisticData/monthList', [CpSubscribeStatisticDataController::class, 'monthList']);
        /**
         * 导出某个cp某个月的各个书籍的应结算金额
         */
        Route::get('subscribeStatisticData/listCpMonthFinalAmount', [CpSubscribeStatisticDataController::class, 'listCpMonthFinalAmount']);
        /**
         * 修改cp结算状态
         */
        Route::post('subscribeStatisticData/saveFinalState',
            [CpSubscribeStatisticDataController::class, 'saveFinalState']);


        Route::get('cpCollection',[CpListController::class,"cpCollection"])->withoutMiddleware(config('catch.route.middlewares'));
    });
});
