TelegramCommonMessageJob.php 542 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Jobs;
  3. use App\Repositories\Utils\TelegramRepository;
  4. use Hyperf\AsyncQueue\Job;
  5. class TelegramCommonMessageJob extends Job
  6. {
  7. protected $params = [];
  8. public function __construct($params = [])
  9. {
  10. $this->params = $params;
  11. }
  12. public function handle()
  13. {
  14. $taskName = '';
  15. if (!empty($this->params['task_name'])) {
  16. $taskName = $this->params['task_name'];
  17. }
  18. make(TelegramRepository::class)->sendCommonText($this->params['content'], $taskName);
  19. }
  20. }