|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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::namespace('App\Http\Controllers\Api')->group(function(){
|
|
|
|
Route::post('auth/login', 'AuthController@login');
|
|
|
|
Route::post('auth/refresh', 'AuthController@refresh');
|
|
|
|
Route::post('tool/upload', 'CommonController@upload');
|
|
|
|
|
|
|
|
Route::middleware('auth:api')->group(function(){
|
|
|
|
Route::prefix('auth')->group(function(){
|
|
|
|
Route::get('scanNode', 'AuthController@scanNode');
|
|
|
|
Route::post('logout', 'AuthController@logout');
|
|
|
|
Route::put('modify-password/{id}', 'AuthController@modifyPassword');
|
|
|
|
Route::put('reset-password/{id}', 'AuthController@resetPassword');
|
|
|
|
Route::put('employee-auth/{id}', 'AuthController@EmployeeAuth');
|
|
|
|
Route::put('employee-group-auth/{id}', 'AuthController@EmployeeGroupAuth');
|
|
|
|
});
|
|
|
|
|
|
|
|
Route::apiResources([
|
|
|
|
'employee-reward-punishment' => EmployeeRewardPunishmentController::class,
|
|
|
|
'employee-social-items' => EmployeeSocialItemsController::class,
|
|
|
|
'employee-group' => EmployeeGroupController::class,
|
|
|
|
'employee-bank' => EmployeeBankController::class,
|
|
|
|
'sys-setting' => SystemSettingController::class,
|
|
|
|
'car-info' => CarInfoController::class,
|
|
|
|
'dictionary' => DictionaryController::class,
|
|
|
|
'employee' => EmployeeController::class,
|
|
|
|
'company' => CompanyController::class,
|
|
|
|
'auth' => AuthController::class,
|
|
|
|
], ['parameters' => [
|
|
|
|
'employee-reward-punishment' => 'id',
|
|
|
|
'employee-social-items' => 'id',
|
|
|
|
'employee-group' => 'id',
|
|
|
|
'employee-bank' => 'id',
|
|
|
|
'sys-setting' => 'id',
|
|
|
|
'car-info' => 'id',
|
|
|
|
'dictionary' => 'id',
|
|
|
|
'employee' => 'id',
|
|
|
|
'company' => 'id',
|
|
|
|
'auth' => 'id',
|
|
|
|
]]);
|
|
|
|
|
|
|
|
Route::resources([
|
|
|
|
'car-brand' => CarBrandController::class,
|
|
|
|
'car-sub-brand' => CarSubBrandController::class,
|
|
|
|
'car-man' => CarManController::class,
|
|
|
|
], [
|
|
|
|
'only' => ['index', 'store', 'update'],
|
|
|
|
'parameters' => [
|
|
|
|
'car-brand' => 'id',
|
|
|
|
'car-sub-brand' => 'id',
|
|
|
|
'car-man' => 'id',
|
|
|
|
]
|
|
|
|
]);
|
|
|
|
|
|
|
|
Route::resources([
|
|
|
|
'car-series' => CarSeriesController::class,
|
|
|
|
'car-model' => CarModelController::class,
|
|
|
|
], [
|
|
|
|
'except' => ['delete'],
|
|
|
|
'parameters' => [
|
|
|
|
'car-series' => 'id',
|
|
|
|
'car-model' => 'id',
|
|
|
|
]
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|