|
|
@@ -3,20 +3,22 @@
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
use Illuminate\Console\Command;
|
|
|
+use Illuminate\Support\Str;
|
|
|
|
|
|
use App\Http\Api\Mq;
|
|
|
use App\Models\Discussion;
|
|
|
use App\Http\Resources\DiscussionResource;
|
|
|
-use Illuminate\Support\Str;
|
|
|
+use App\Models\SentPr;
|
|
|
+use App\Http\Resources\SentPrResource;
|
|
|
|
|
|
class TestMq extends Command
|
|
|
{
|
|
|
/**
|
|
|
* The name and signature of the console command.
|
|
|
- *
|
|
|
+ * php artisan test:mq
|
|
|
* @var string
|
|
|
*/
|
|
|
- protected $signature = 'test:mq {--discussion=}';
|
|
|
+ protected $signature = 'test:mq {--discussion=} {--pr=}';
|
|
|
|
|
|
/**
|
|
|
* The console command description.
|
|
|
@@ -51,6 +53,11 @@ class TestMq extends Command
|
|
|
Mq::publish('discussion',new DiscussionResource(Discussion::find($discussion)));
|
|
|
}
|
|
|
|
|
|
+ $pr = $this->option('pr');
|
|
|
+ if($pr && Str::isUuid($pr)){
|
|
|
+ Mq::publish('suggestion',new SentPrResource(SentPr::where('uid',$pr)->first()));
|
|
|
+ }
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
}
|