|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Http\Controllers\Admin; |
|
|
|
|
|
|
|
use App\Exceptions\CustomException; |
|
|
|
use App\Services\AdminFloorService; |
|
|
|
use App\Services\ApiResponseService; |
|
|
|
use App\Services\ParkingElectronicMapService; |
|
|
|
@ -87,6 +88,8 @@ class ParkingElectronicMapController extends BaseController |
|
|
|
'parking_space_list' => $list |
|
|
|
]; |
|
|
|
return $this->responseService->success($data); |
|
|
|
} catch (ValidationException $e) { |
|
|
|
throw $e; |
|
|
|
} catch (Exception $e) { |
|
|
|
$m_prefix = __('exception.exception_handler.resource'); |
|
|
|
return $this->responseService->systemError( |
|
|
|
@ -128,13 +131,15 @@ class ParkingElectronicMapController extends BaseController |
|
|
|
$data = $request->all(); |
|
|
|
$saveData = $data['saveData'] ?? []; |
|
|
|
if (empty($saveData)) { |
|
|
|
throw new Exception(__('validation.map.d_empty')); |
|
|
|
throw new CustomException(__('validation.map.d_empty')); |
|
|
|
} |
|
|
|
foreach ($saveData as $item) { |
|
|
|
$this->saveValidator($item, 1); |
|
|
|
} |
|
|
|
$this->service->saveModel($saveData); |
|
|
|
return $this->responseService->success([], __('admin.save_succeeded')); |
|
|
|
} catch (CustomException|ValidationException $e) { |
|
|
|
throw $e; |
|
|
|
} catch (Exception $e) { |
|
|
|
$m_prefix = __('admin.save_failed'); |
|
|
|
return $this->responseService->systemError( |
|
|
|
@ -151,6 +156,8 @@ class ParkingElectronicMapController extends BaseController |
|
|
|
$this->saveValidator($data); |
|
|
|
$list = $this->service->getList($data); |
|
|
|
return $this->responseService->success($list); |
|
|
|
} catch (ValidationException $e) { |
|
|
|
throw $e; |
|
|
|
} catch (Exception $e) { |
|
|
|
$m_prefix = __('exception.exception_handler.resource'); |
|
|
|
return $this->responseService->systemError( |
|
|
|
|