change code in some code

This commit is contained in:
2025-09-27 15:14:12 +03:30
parent 3ba0e6a717
commit 971036e48f
2 changed files with 4 additions and 5 deletions

View File

@@ -29,7 +29,7 @@ class SendDataToFMSListener implements ShouldQueue
$mission = $event->mission; $mission = $event->mission;
$this->getErrorRateService->setInputParameters([ $this->getErrorRateService->setInputParameters([
'url' => config('fms_web_services.Error_Rate.url'), 'username' => config('fms_web_services.Error_Rate.username'),
'password' => config('fms_web_services.Error_Rate.password'), 'password' => config('fms_web_services.Error_Rate.password'),
'missionArea' => $mission->area['coordinates'], 'missionArea' => $mission->area['coordinates'],
'missionStartDT' => $mission->start_time->format('Y-m-d\TH:i:s'), 'missionStartDT' => $mission->start_time->format('Y-m-d\TH:i:s'),

View File

@@ -10,13 +10,11 @@ class GetErrorRateService
{ {
protected string $url; protected string $url;
protected string $channelName; protected string $channelName;
protected string $password;
protected string $username;
protected array $inputParameters; protected array $inputParameters;
public function __construct() public function __construct()
{ {
$this->username = config('fms_web_services.Error_Rate.username'); $this->url = config('fms_web_services.Error_Rate.url');
$this->channelName = 'fms_error_rate'; $this->channelName = 'fms_error_rate';
} }
@@ -48,9 +46,10 @@ class GetErrorRateService
public function sendRequest(): array public function sendRequest(): array
{ {
return Http::withHeaders(['Content-Type' => 'application/json']) return Http::withHeaders(['Content-Type' => 'application/json'])
->withBody(json_encode($this->inputParameters))
->throw() ->throw()
->withoutVerifying() ->withoutVerifying()
->post($this->url, $this->inputParameters) ->post($this->url)
->json(); ->json();
} }
} }