51 lines
3.2 KiB
PHP
51 lines
3.2 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Modules\Taxi\App\Http\Controllers as TaxiControllers;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register API routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| is assigned the "api" middleware group. Enjoy building your API!
|
|
|
|
|
*/
|
|
|
|
// Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () {
|
|
// Route::get('taxi', fn (Request $request) => $request->user())->name('taxi');
|
|
// });
|
|
|
|
Route::group([
|
|
'prefix' => 'taxi',
|
|
'middleware' => 'checkAppAccess'
|
|
],
|
|
function() {
|
|
Route::group(
|
|
['middleware' => \Modules\Taxi\App\Http\Middleware\CheckTimeRqstAvailability::class],
|
|
function() {
|
|
//Route::post('/createOrder', [TaxiControllers\TaxiController::class, 'createTaxiOrder']);
|
|
//TODO. Какая будет ошибка, если регулярка не сможет проверить переданные параметр? Можно ли ввести какую-то проверку на уровне роутинга с возвратом конкретной ошибки?
|
|
// Route::post('/editOrder/{orderId}', [TaxiControllers\TaxiController::class, 'updateTaxiOrder'])->where('orderId', '^[0-9]+$');
|
|
Route::get('/cancelRqst/{rqstId}', [TaxiControllers\TaxiController::class, 'cancelRqst'])->where('rqstId', '^[0-9]+$');
|
|
Route::post('/createRqst', [TaxiControllers\TaxiController::class, 'createTaxiOrder']);
|
|
Route::patch('/editOrder/{orderId}', [TaxiControllers\TaxiController::class, 'updateTaxiOrder'])->where('orderId', '^[0-9]+$');
|
|
});
|
|
Route::get('/getActiveOrders', [TaxiControllers\TaxiController::class, 'getActiveOrders']);
|
|
Route::post('/getFilterOrders', [TaxiControllers\TaxiController::class, 'getFilterOrders']);
|
|
Route::get('/getEmpInfo/{userLogin}', [TaxiControllers\TaxiController::class, 'getUserInfoByLogin'])->where('userLogin', '^[a-zA-Z_]+[0-9]*$');
|
|
Route::get('/getOfficeAddress/', [TaxiControllers\TaxiController::class, 'getOfficeAddress']);
|
|
#Гаврилов
|
|
//ВЫНЕСТИ ЭТОТ ЕНДПОИНТ ИЗ ГРУППЫ ТАКСИ И ВЫНЕСТИ МЕТОД ПОЛУЧЕНИЯ ВСЕХ ПОЛЬЗОВАТЕЛЕЙ ИЗ СТАРОГО МЭДЖИКА КАКИМ-ТО ОБЩИМ КОНТРОЛЛЕРОМ, СЕРВИСОМ?
|
|
Route::get('/getEmpInfo/', [TaxiControllers\TaxiController::class, 'getActiveUsersInfo']);
|
|
//Получаем временные промежутки для заказа такси
|
|
Route::get('/getTimePeriods/', [TaxiControllers\TaxiController::class, 'getTimePeriods']);
|
|
//Получаем данные по существующему заказу такси
|
|
Route::get('/getOrderById/{orderId}', [TaxiControllers\TaxiController::class, 'getOrderById'])->where('orderId', '^[0-9]+$');
|
|
}
|
|
);
|