| 123456789101112131415161718192021222324252627282930 |
- <?php
- declare(strict_types=1);
- namespace App\Command;
- use App\Repositories\BannedIpRepository;
- use Hyperf\Command\Command as HyperfCommand;
- use Hyperf\Command\Annotation\Command;
- /**
- * @Command
- */
- #[Command]
- class ClearBannedIpCommand extends HyperfCommand
- {
- /**
- * 执行的命令行
- *
- * @var string
- */
- protected $name = 'clear:banned_ip';
- public function handle()
- {
- make(BannedIpRepository::class)->clearAllIp();
- logger('ClearBannedIpCommand', ['msg' => '请空IP被名单']);
- $this->info('请空IP被名单');
- }
- }
|