ClearBannedIpCommand.php 587 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Command;
  4. use App\Repositories\BannedIpRepository;
  5. use Hyperf\Command\Command as HyperfCommand;
  6. use Hyperf\Command\Annotation\Command;
  7. /**
  8. * @Command
  9. */
  10. #[Command]
  11. class ClearBannedIpCommand extends HyperfCommand
  12. {
  13. /**
  14. * 执行的命令行
  15. *
  16. * @var string
  17. */
  18. protected $name = 'clear:banned_ip';
  19. public function handle()
  20. {
  21. make(BannedIpRepository::class)->clearAllIp();
  22. logger('ClearBannedIpCommand', ['msg' => '请空IP被名单']);
  23. $this->info('请空IP被名单');
  24. }
  25. }