platform notify

This commit is contained in:
cano
2024-03-27 00:11:26 +08:00
parent 01e93acdd8
commit 4b47fe7250
21 changed files with 462 additions and 18 deletions

View File

@ -3,6 +3,7 @@
namespace App\Jobs\Wallet;
use App\Bean\Queue\Wallet\QueueNotifyToPlatformBean;
use App\Service\Wallet\PlatformNotifyService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@ -24,13 +25,18 @@ class WalletNotifyToPlatformQueue implements ShouldQueue
/**
* Execute the job.
*/
public function handle(): void
public function handle(array $params): void
{
//
$oPlatformNotifyService = new PlatformNotifyService();
$oPlatformNotifyService->notifyToPlatform(new QueueNotifyToPlatformBean($params));
}
public static function putToQueue(QueueNotifyToPlatformBean $bean): \Illuminate\Foundation\Bus\PendingDispatch
public static function putToQueue(QueueNotifyToPlatformBean $bean, $delaySec = null): \Illuminate\Foundation\Bus\PendingDispatch
{
return self::dispatch($bean->toArrayNotNull())->onQueue(QueueNotifyToPlatformBean::QUEUE_NAME);
$queue = self::dispatch($bean->toArrayNotNull())->onQueue(QueueNotifyToPlatformBean::QUEUE_NAME);
if(!empty($delaySec)){
$queue->delay(now()->addSeconds($delaySec));
}
return $queue;
}
}