<?php

namespace App\Console\Commands\ContentManage;

use Illuminate\Console\Command;
use Modules\ContentManage\Services\CpManage\SyncSubscribe;

class SyncCpSubscribeStatisticDataFromZW extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'ContentManage:SyncCpSubscribeStatisticDataFromZW {--startDate= : 开始日期如2023-03-01}
                                                                             {--endDate= : 结束日期如2023-03-02}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '从掌维拉取cp书籍订阅数据';

    /**
     * Execute the console command.
     */
    public function handle(): void
    {
        $startDate = $this->option('startDate');
        $endDate = $this->option('endDate');

        $syncService = new SyncSubscribe();
        $syncService->syncStartDate = $startDate;
        $syncService->syncEndDate = $endDate;
        $syncService->sync();
    }
}
