Files
usedcar/config/route.php
T
2025-06-06 10:38:31 +08:00

221 lines
12 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Webman\Route;
// ****** ****** ****** 生成文件({模块}/{名称}) ****** ****** ******
Route::any('/cf/{module}/{name}', [\app\mzl\MzlController::class, 'createFile']);
// ****** ****** ****** 生成文件({模块}/{名称}) ****** ****** ******
// ====== ====== ====== 网站 ====== ====== ======
Route::group('/apis', function() {
// 车辆列表
Route::any('/vehicle/list', [\app\apis\controller\VehicleDataController::class, 'index']);
// 车辆详情
Route::any('/vehicle/detail', [\app\apis\controller\VehicleDataController::class, 'show']);
// 联系方式
Route::any('/contact/add', [\app\apis\controller\ContactsController::class, 'store']);
// 搜索项
Route::any('/search/options', [\app\apis\controller\DictTypeController::class, 'options']);
// 搜索项 - 型号
Route::any('/get/models', [\app\apis\controller\DictTypeController::class, 'getModels']);
// 油箱订阅
Route::any('/email/subscribe', [\app\apis\controller\SubscribeController::class, 'store']);
// 车辆类型
Route::any('/vehicle/types', [\app\apis\controller\TypesController::class, 'all']);
// 品牌下车辆的能源类型
Route::any('/vehicle/energy', [\app\apis\controller\VehicleNewController::class, 'enegry']);
// 车辆随机
Route::any('/vehicle/random', [\app\apis\controller\VehicleDataController::class, 'random']);
// 隐私协议
Route::any('/agt/privacy', [\app\apis\controller\AgreementController::class, 'one']);
// 品牌按字母查询
Route::any('/brand/letterAll', [\app\apis\controller\BrandController::class, 'letterAll']);
// 品牌详情
Route::any('/brand/detail/{id}', [\app\apis\controller\BrandController::class, 'detail']);
// 新车管理
Route::any('/vehicle/new/list', [\app\apis\controller\VehicleNewController::class, 'index']);
Route::any('/vehicle/new/{id}/detail', [\app\apis\controller\VehicleNewController::class, 'detail']);
// 能源列表
Route::any('/energy/preset', [\app\console\controller\EnergyController::class, 'presets']);
});
// ====== ====== ====== 网站 ====== ====== ======
// ====== ====== ====== 小程序 ====== ====== ======
Route::group('/applet', function() {
// 品牌
Route::get('/brand', [\app\applet\controller\BrandController::class, 'all']);
// 类型
Route::get('/types', [\app\applet\controller\TypesController::class, 'all']);
// 能源
Route::get('/energy', [\app\applet\controller\EnergyController::class, 'all']);
// 型号
Route::get('/models', [\app\applet\controller\ModelController::class, 'all']);
// 协议
Route::get('/agreement/{agt}', [\app\applet\controller\AgreementController::class, 'getOne']);
// 登录
Route::post('/miniapp/login', [\app\applet\controller\UsersController::class, 'miniappLogin']);
// 手机号
Route::post('/miniapp/phone', [\app\applet\controller\UsersController::class, 'miniappPhoneNumber'])->middleware([
\app\mzl\modules\jwt\middleware\JwtMiddleware::class
]);
// 上传
Route::any('/upload/image', [\app\mzl\modules\upload\controller\UploadController::class, 'uploadImage']);
// // 用户 - 信息
// Route::post('/user/info', [\app\applet\controller\UsersController::class, 'one'])->middleware([
// \app\mzl\modules\jwt\middleware\JwtMiddleware::class
// ]);
// 授权
Route::group('/', function() {
// 用户 - 信息
Route::post('user/info', [\app\applet\controller\UsersController::class, 'one']);
// 用户 - 更新
Route::post('user/update', [\app\applet\controller\UsersController::class, 'updateData']);
// 车辆 - 添加
Route::post('vehicle/add', [\app\applet\controller\VehicleDataController::class, 'add']);
// 车辆 - 更新
Route::post('vehicle/update/{id}', [\app\applet\controller\VehicleDataController::class, 'edit']);
// 车辆 - 详情
Route::get('vehicle/detail/{id}', [\app\applet\controller\VehicleDataController::class, 'show']);
// 车辆 - 列表
Route::get('vehicle/list', [\app\applet\controller\VehicleDataController::class, 'index']);
// 车辆 - 删除
Route::post('vehicle/delete/{id}', [\app\applet\controller\VehicleDataController::class, 'destroy']);
// // 车辆 - 申请
// Route::post('vehicle/apply/status', [\app\applet\controller\VehicleApplyController::class, 'getOne']);
// // 草稿 - 添加
Route::post('draft/add', [\app\applet\controller\DraftsDataController::class, 'add']);
// // 草稿 - 更新
Route::post('draft/update/{id}', [\app\applet\controller\DraftsDataController::class, 'edit']);
// // 草稿 - 详情
Route::get('draft/detail/{id}', [\app\applet\controller\DraftsDataController::class, 'show']);
// // 草稿 - 列表
// Route::get('draft/list', [\app\applet\controller\DraftsController::class, 'pageLists']);
// // 草稿 - 删除
// Route::post('draft/delete', [\app\applet\controller\DraftsDataController::class, 'destroy']);
})->middleware([
\app\mzl\modules\jwt\middleware\JwtMiddleware::class
]);
});
// ====== ====== ====== 小程序 ====== ====== ======
// ====== ====== ====== 后台管理 ====== ====== ======
Route::group('/console', function() {
// 协议管理
Route::any('/user/login', [\app\console\controller\AdminsController::class, 'login']);
// 协议管理
Route::any('/agt/list', [\app\console\controller\AgreementController::class, 'index']);
Route::any('/agt/add', [\app\console\controller\AgreementController::class, 'add']);
Route::any('/agt/{id}/update', [\app\console\controller\AgreementController::class, 'edit']);
Route::any('/agt/{id}/delete', [\app\console\controller\AgreementController::class, 'destroy']);
Route::any('/agt/{id}/detail', [\app\console\controller\AgreementController::class, 'show']);
// 品牌管理
Route::any('/brand/list', [\app\console\controller\BrandController::class, 'index']);
Route::any('/brand/add', [\app\console\controller\BrandController::class, 'add']);
Route::any('/brand/{id}/update', [\app\console\controller\BrandController::class, 'edit']);
Route::any('/brand/{id}/delete', [\app\console\controller\BrandController::class, 'destroy']);
Route::any('/brand/{id}/detail', [\app\console\controller\BrandController::class, 'show']);
Route::any('/brand/preset', [\app\console\controller\BrandController::class, 'presets']);
// 品牌轮播
Route::any('/brandbanner/add', [\app\console\controller\BrandBannerController::class, 'add']);
Route::any('/brandbanner/update/{id}', [\app\console\controller\BrandBannerController::class, 'edit']);
Route::any('/brandbanner/list', [\app\console\controller\BrandBannerController::class, 'index']);
Route::any('/brandbanner/delete/{id}', [\app\console\controller\BrandBannerController::class, 'destroy']);
// 品牌特性
Route::any('/brandtrait/add', [\app\console\controller\BrandTraitController::class, 'add']);
Route::any('/brandtrait/update/{id}', [\app\console\controller\BrandTraitController::class, 'edit']);
Route::any('/brandtrait/list', [\app\console\controller\BrandTraitController::class, 'index']);
Route::any('/brandtrait/delete/{id}', [\app\console\controller\BrandTraitController::class, 'destroy']);
// 能源管理
Route::any('/energy/list', [\app\console\controller\EnergyController::class, 'index']);
Route::any('/energy/add', [\app\console\controller\EnergyController::class, 'add']);
Route::any('/energy/{id}/update', [\app\console\controller\EnergyController::class, 'edit']);
Route::any('/energy/{id}/delete', [\app\console\controller\EnergyController::class, 'destroy']);
Route::any('/energy/{id}/detail', [\app\console\controller\EnergyController::class, 'show']);
Route::any('/energy/preset', [\app\console\controller\EnergyController::class, 'presets']);
// 类型管理
Route::any('/types/list', [\app\console\controller\TypesController::class, 'index']);
Route::any('/types/add', [\app\console\controller\TypesController::class, 'add']);
Route::any('/types/{id}/update', [\app\console\controller\TypesController::class, 'edit']);
Route::any('/types/{id}/delete', [\app\console\controller\TypesController::class, 'destroy']);
Route::any('/types/{id}/detail', [\app\console\controller\TypesController::class, 'show']);
Route::any('/types/preset', [\app\console\controller\TypesController::class, 'presets']);
// 用户管理
Route::any('/users/list', [\app\console\controller\UsersController::class, 'index']);
Route::any('/users/{id}/update', [\app\console\controller\UsersController::class, 'update']);
Route::any('/users/{id}/delete', [\app\console\controller\UsersController::class, 'destroy']);
Route::any('/users/{id}/detail', [\app\console\controller\UsersController::class, 'show']);
// 车辆信息管理
Route::any('/vehicle/data/list', [\app\console\controller\VehicleDataController::class, 'index']);
Route::any('/vehicle/add', [\app\console\controller\VehicleDataController::class, 'add']);
Route::any('/vehicle/{id}/update', [\app\console\controller\VehicleDataController::class, 'edit']);
Route::any('/vehicle/data/{id}/do', [\app\console\controller\VehicleDataController::class, 'doSaled']);
Route::any('/vehicle/data/{id}/delete', [\app\console\controller\VehicleDataController::class, 'destroy']);
Route::any('/vehicle/data/{id}/detail', [\app\console\controller\VehicleDataController::class, 'detail']);
// 新车管理
Route::any('/vehicle/new/list', [\app\console\controller\VehicleNewController::class, 'index']);
Route::any('/vehicle/new/add', [\app\console\controller\VehicleNewController::class, 'add']);
Route::any('/vehicle/new/{id}/update', [\app\console\controller\VehicleNewController::class, 'edit']);
Route::any('/vehicle/new/{id}/delete', [\app\console\controller\VehicleNewController::class, 'destroy']);
Route::any('/vehicle/new/{id}/detail', [\app\console\controller\VehicleNewController::class, 'detail']);
// 上传
Route::any('/upload/image', [\app\mzl\modules\upload\controller\UploadController::class, 'uploadImage']);
// 型号管理
Route::any('/models/list', [\app\console\controller\ModelController::class, 'index']);
Route::any('/models/add', [\app\console\controller\ModelController::class, 'add']);
Route::any('/models/{id}/update', [\app\console\controller\ModelController::class, 'edit']);
Route::any('/models/{id}/delete', [\app\console\controller\ModelController::class, 'destroy']);
Route::any('/models/{id}/detail', [\app\console\controller\ModelController::class, 'show']);
Route::any('/models/preset', [\app\console\controller\ModelController::class, 'presets']);
// 审核管理
Route::any('/apply/list', [\app\console\controller\VehicleApplyController::class, 'index']);
Route::any('/apply/{id}/do', [\app\console\controller\VehicleApplyController::class, 'doApply']);
Route::any('/apply/{id}/delete', [\app\console\controller\VehicleApplyController::class, 'destroy']);
Route::any('/apply/{id}/detail', [\app\console\controller\VehicleApplyController::class, 'show']);
// 首页统计
Route::any('/counts', [\app\console\controller\HomeController::class, 'datas']);
// 位置管理
Route::any('/location/list', [\app\console\controller\LocationController::class, 'index']);
Route::any('/location/add', [\app\console\controller\LocationController::class, 'add']);
Route::any('/location/{id}/update', [\app\console\controller\LocationController::class, 'edit']);
Route::any('/location/{id}/delete', [\app\console\controller\LocationController::class, 'destroy']);
Route::any('/location/{id}/detail', [\app\console\controller\LocationController::class, 'show']);
Route::any('/location/preset', [\app\console\controller\LocationController::class, 'presets']);
// 邮箱列表
Route::any('/email/subscribe', [\app\console\controller\SubscribeController::class, 'index']);
});
// ====== ====== ====== 后台管理 ====== ====== ======