|
@@ -32,13 +32,27 @@ public function odds(): JsonResponse
|
|
|
]);
|
|
]);
|
|
|
$dataId = request()->input('data_id');
|
|
$dataId = request()->input('data_id');
|
|
|
$res = FixtureService::odds($dataId);
|
|
$res = FixtureService::odds($dataId);
|
|
|
- }catch (ValidationException $e) {
|
|
|
|
|
|
|
+ } catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
return $this->error($e->getCode());
|
|
return $this->error($e->getCode());
|
|
|
}
|
|
}
|
|
|
|
|
+ return $this->success($res);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ public function oddsLive(): JsonResponse
|
|
|
|
|
+ {
|
|
|
|
|
+ try {
|
|
|
|
|
+ request()->validate([
|
|
|
|
|
+ 'data_id' => ['required', 'string', 'min:1'],
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $dataId = request()->input('data_id');
|
|
|
|
|
+ $res = FixtureService::oddsLive($dataId);
|
|
|
|
|
+ } catch (ValidationException $e) {
|
|
|
|
|
+ return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ return $this->error($e->getCode());
|
|
|
|
|
+ }
|
|
|
return $this->success($res);
|
|
return $this->success($res);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|