Browse Source

异常占用-搜索接口

master
wanghongjun 2 weeks ago
parent
commit
b3bfdf57b1
  1. 25
      app/Http/Controllers/Admin/ParkingAbnormalController.php
  2. 1
      routes/admin/api.php

25
app/Http/Controllers/Admin/ParkingAbnormalController.php

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Admin;
use App\Exceptions\CustomException;
use App\Models\Parking;
use App\Models\ParkingAbnormal;
use App\Services\ApiResponseService;
use App\Services\ParkingAbnormalService;
@ -128,6 +129,30 @@ class ParkingAbnormalController extends BaseController
}
}
public function search(): JsonResponse
{
try {
$data = [
'parking_list' => Parking::getData(),
'date_list' => get_select_data(
$this->service->getDateArr()
),
'status_list' => get_select_data(
$this->service->getStatus()
),
'operation_list' => get_select_data(
$this->service->getOperationType()
)
];
return $this->responseService->success($data);
} catch (Exception $e) {
$m_prefix = __('exception.exception_handler.resource');
return $this->responseService->systemError(
$m_prefix . ':' . $e->getMessage()
);
}
}
public function handle(Request $request): JsonResponse
{
try {

1
routes/admin/api.php

@ -189,6 +189,7 @@ Route::group(['prefix' => 'admin'], function () {
Route::get('/notice/show/{id}', [NoticeController::class, 'show']);
// 异常占用
Route::get('/abnormalResourceUsage', [ParkingAbnormalController::class, 'index']);
Route::get('/abnormalResourceUsage/search', [ParkingAbnormalController::class, 'search']);
Route::post('/abnormalResourceUsage/handle', [ParkingAbnormalController::class, 'handle']);
Route::post('/abnormalResourceUsage/ignore', [ParkingAbnormalController::class, 'ignore']);
// 车牌识别率

Loading…
Cancel
Save