<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     */
    protected function schedule(Schedule $schedule): void
    {
        /**
         * 刷新微信小程序的accessToken
         */
        $schedule->command('Miniprogram:WechatAccessToken')->everyMinute();
        //每月24号执行创建表
        $schedule->command('create_track_table')->monthlyOn(24);

        //短剧统计
        $schedule->command('Stats:MiniprogramStats')->dailyAt('03:01');
        /**
         * 同步短剧剧目信息
         */
        $schedule->command('WechatCheck:SyncDramaInfo')->daily();
        /**
         * 同步短剧分集信息
         */
        $schedule->command('WechatCheck:SyncMediaInfo')->everySixHours();
        /**
         * 检查短剧剧目拉取任务
         */
        $schedule->command('WechatCheck:GetTaskInfo')->everyTenMinutes();
        /**
         * 客服消息发送
         */
        $schedule->command('WechatPlatform:KFMessageSend')->everyMinute();
    }

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

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