<?php

namespace App\Console;

use App\Console\Commands\CheckGooglePlayStore;
use App\Console\Commands\CheckIosAppStore;
use App\Console\Commands\CheckPaymentWarning;
use App\Console\Commands\CheckStockModeNegative;
use App\Console\Commands\DbQueue;
use App\Console\Commands\OnlineReport;
use App\Console\Commands\DecStock;
use App\Console\Commands\ExemptReview;
use App\Console\Commands\Extension;
use App\Console\Commands\PayOrder;
use App\Console\Commands\RecordPlatformData;
use App\Console\Commands\RecordServerGameCount;
use App\Console\Commands\RecordServerGameCountYesterday;
use App\Console\Commands\RecordThreeGameYesterday;
use App\Console\Commands\RecordPaidRewardDailyStatistics;
use App\Console\Commands\RecordUserScoreChangeStatistics;
use App\Console\Commands\SuperballUpdatePoolAndStats;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        ExemptReview::class,
        PayOrder::class,
        Extension::class,
        CheckStockModeNegative::class,
        RecordPlatformData::class,
        RecordServerGameCount::class,
        RecordServerGameCountYesterday::class,
        RecordPaidRewardDailyStatistics::class,
        RecordUserScoreChangeStatistics::class,
        DecStock::class,
        CheckIosAppStore::class,
        CheckPaymentWarning::class,
        CheckGooglePlayStore::class,
        OnlineReport::class,
        DbQueue::class,
        RecordThreeGameYesterday::class,
        SuperballUpdatePoolAndStats::class,

    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
//        $schedule->command('db_queue')->everyMinute()->description('批量处理redis队列任务');
        $schedule->command('exempt_review')->everyMinute()->description('免审提现');
        $schedule->command('record_server_game_count')->cron('*/15 * * * * ')->description('按天统计游戏人数');
        $schedule->command('stock_mode:check_negative')->cron('*/5 * * * *')->description('检测库存模式房间库存是否为负并通过 Telegram 报警');
        $schedule->command('online_max')->cron('*/8 * * * * ')->description('最高在线人数统计');
        $schedule->command('record_server_game_count_yesterday')->cron('05 0 * * * ')->description('按天统计游戏人数--今日执行昨日');
        $schedule->command('RecordPlatformData')->cron('10 0 * * * ')->description('数据统计');
        $schedule->command('RecordPaidRewardDailyStatistics')->cron('15 0 * * * ')->description('付费用户奖励日统计');
        $schedule->command('RecordUserScoreChangeStatistics')->cron('03 0 * * * ')->description('用户金额变化明细按天按用户汇总');
        $schedule->command('superball:update-pool-stats')->everyMinute()->description('Superball 每分钟刷新奖池及展示统计');
        $schedule->command('online_report')->everyMinute()->description('每分钟统计曲线');
        $schedule->command('payment:check-warning')->everyMinute()->description('Check payment warning metrics');
        $schedule->command('ios:check-app-store')->everyMinute()->description('每5分钟检测 iOS App Store 包是否下架');
        $schedule->command('google:check-play-store')->everyMinute()->description('每5分钟检测 Google Play 包是否下架');

//        $schedule->command('record_three_game_yesterday')->cron('05 0 * * * ')->description('按天统计游戏人数--今日执行昨日');
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

//        require base_path('routes/console.php');
    }
}
