47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Jobs\Wallet;
|
|
|
|
use App\Bean\Queue\Wallet\QueueEventBean;
|
|
use App\Service\Wallet\Coin\Tron\UsdtTrx20Service;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class WalletAddressTransactionQueue implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//钱包地址交易账变处理队列
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*/
|
|
public function handle(array $params): void
|
|
{
|
|
$oQueueEventBean = new QueueEventBean($params);
|
|
$oUsdtTrx20Service = new UsdtTrx20Service();
|
|
try {
|
|
$oUsdtTrx20Service->walletAddressTransactionConsumer($oQueueEventBean);
|
|
} catch (\Exception $e) {
|
|
}
|
|
}
|
|
|
|
public static function putToQueue(QueueEventBean $bean,$delaySec = null): \Illuminate\Foundation\Bus\PendingDispatch
|
|
{
|
|
$queue = self::dispatch($bean->toArrayNotNull())->onQueue(QueueEventBean::QUEUE_NAME);
|
|
if(!empty($delaySec)){
|
|
$queue->delay(now()->addSeconds($delaySec));
|
|
}
|
|
return $queue;
|
|
}
|
|
}
|