|
|
@ -16,11 +16,6 @@ use Psr\SimpleCache\InvalidArgumentException; |
|
|
|
|
|
|
|
|
class FloorController extends BaseController |
|
|
class FloorController extends BaseController |
|
|
{ |
|
|
{ |
|
|
/** |
|
|
|
|
|
* @var ApiResponseService |
|
|
|
|
|
*/ |
|
|
|
|
|
protected ApiResponseService $responseService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @var AdminFloorService |
|
|
* @var AdminFloorService |
|
|
*/ |
|
|
*/ |
|
|
@ -33,9 +28,9 @@ class FloorController extends BaseController |
|
|
*/ |
|
|
*/ |
|
|
public function __construct( |
|
|
public function __construct( |
|
|
ApiResponseService $responseService, |
|
|
ApiResponseService $responseService, |
|
|
AdminFloorService $AdminFloorService, |
|
|
AdminFloorService $AdminFloorService |
|
|
) { |
|
|
) { |
|
|
$this->responseService = $responseService; |
|
|
parent::__construct($responseService); |
|
|
$this->AdminFloorService = $AdminFloorService; |
|
|
$this->AdminFloorService = $AdminFloorService; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -90,8 +85,8 @@ class FloorController extends BaseController |
|
|
throw $e; |
|
|
throw $e; |
|
|
} catch (Exception $e) { |
|
|
} catch (Exception $e) { |
|
|
return $this->responseService->systemError( |
|
|
return $this->responseService->systemError( |
|
|
__('exception.admin_floor.create_failed') . ':' . $e->getMessage( |
|
|
__('exception.admin_floor.create_failed') . ':' |
|
|
) |
|
|
. $e->getMessage() |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -102,7 +97,7 @@ class FloorController extends BaseController |
|
|
* @return void |
|
|
* @return void |
|
|
* @throws ValidationException |
|
|
* @throws ValidationException |
|
|
*/ |
|
|
*/ |
|
|
public function saveValidator(array $data, int $id = 0): void |
|
|
protected function saveValidator(array $data, int $id = 0): void |
|
|
{ |
|
|
{ |
|
|
$rules = [ |
|
|
$rules = [ |
|
|
'name' => 'required|max:50', |
|
|
'name' => 'required|max:50', |
|
|
@ -124,7 +119,8 @@ class FloorController extends BaseController |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Show the form for editing the specified resource. |
|
|
* @param string $id |
|
|
|
|
|
* @return JsonResponse |
|
|
*/ |
|
|
*/ |
|
|
public function edit(string $id): JsonResponse |
|
|
public function edit(string $id): JsonResponse |
|
|
{ |
|
|
{ |
|
|
@ -165,8 +161,8 @@ class FloorController extends BaseController |
|
|
throw $e; |
|
|
throw $e; |
|
|
} catch (Exception $e) { |
|
|
} catch (Exception $e) { |
|
|
return $this->responseService->systemError( |
|
|
return $this->responseService->systemError( |
|
|
__('exception.admin_floor.update_failed') . ':' . $e->getMessage( |
|
|
__('exception.admin_floor.update_failed') . ':' |
|
|
) |
|
|
. $e->getMessage() |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|