<?php

namespace App\Console;

use App\Console\Commands\IncrementSyncDrugReportCommand;
use App\Console\Commands\IncrementSyncDrugReportAssCommand;
use App\Console\Commands\HistorySyncDrugReportCommand;
use App\Console\Commands\SignedSyncDrugReportCommand;
use App\Console\Commands\UpdateDrugReportAssCommand;
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 = [
        IncrementSyncDrugReportCommand::class,
        IncrementSyncDrugReportAssCommand::class,
        HistorySyncDrugReportCommand::class,
        SignedSyncDrugReportCommand::class,
        UpdateDrugReportAssCommand::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('increment-drug-report')->everyThirtyMinutes();
        $schedule->command('increment-drug-report-ass')->everyThirtyMinutes();
        $schedule->command('update-drug-report-ass')->everyThreeHours(15);
        //$schedule->command('drug-report-history')->everyThirtyMinutes();
        //$schedule->command('drug-report-signed')->everyThirtyMinutes();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        // 自动引入任务命令
        $this->load(__DIR__.'/Commands');
        // 引入任务路由
        require base_path('routes/console.php');
    }
}
