43 lines
1.1 KiB
PHP
Executable File
43 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Command;
|
|
|
|
use App\FormModel\spider\ReviewModel;
|
|
use App\Model\AppArticle;
|
|
use Hyperf\Collection\Collection;
|
|
use Hyperf\Command\Annotation\Command;
|
|
use Hyperf\Command\Command as HyperfCommand;
|
|
use Hyperf\DbConnection\Db;
|
|
use Psr\Container\ContainerInterface;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Input\InputOption;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
use function Hyperf\Coroutine\co;
|
|
|
|
#[Command]
|
|
class SpiderReviewCommand extends HyperfCommand
|
|
{
|
|
|
|
protected $reids;
|
|
public function __construct(protected ContainerInterface $container)
|
|
{
|
|
parent::__construct('spider:review');
|
|
}
|
|
|
|
public function configure()
|
|
{
|
|
parent::configure();
|
|
$this->setDescription('review spider article.');
|
|
$this->addOption('id', 'i', InputOption::VALUE_REQUIRED, '文章id', false);
|
|
}
|
|
|
|
public function execute(InputInterface $input, OutputInterface $output): int
|
|
{
|
|
$reviewModel = new ReviewModel();
|
|
$reviewModel->pass($input->getOption('id'));
|
|
return 0;
|
|
}
|
|
}
|