123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?php
- /*
- * This file is part of the Jiannei/lumen-api-starter.
- *
- * (c) Jiannei <longjian.huang@foxmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- use Illuminate\Support\Facades\Hash;
- use Illuminate\Support\Facades\Http;
- use Illuminate\Support\Facades\Route;
- use Jiannei\Response\Laravel\Support\Facades\Response;
- /*
- |--------------------------------------------------------------------------
- | Application Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register all of the routes for an application.
- | It is a breeze. Simply tell Lumen the URIs it should respond to
- | and give it the Closure to call when that URI is requested.
- |
- */
- /**
- * 基础业务模块
- */
- Route::group(['namespace' => 'Base', 'prefix' => 'base'], function () {
- //登录
- Route::post('/auth/login', 'AuthController@login');
- //上传文件
- Route::post('/common/upload', 'ResourceController@upload');
- Route::get('/common/enums', 'CommonController@enums');
- Route::group([
- 'middleware' => 'auth:admins'
- ], function () {
- Route::get('/auth/me', 'AuthController@me');
- Route::put('/auth/me', 'AuthController@update');
- Route::get('/auth/logout', 'AuthController@logout');
- //部门管理
- Route::get('department', 'DepartmentController@index');
- Route::get('department/{id}', 'DepartmentController@show');
- Route::post('department', 'DepartmentController@store');
- Route::post('department/delete', 'DepartmentController@delete');
- Route::put('department/{id}', 'DepartmentController@update');
- Route::delete('department/{id}', 'DepartmentController@destroy');
- Route::get('department-tree', 'DepartmentController@tree');
- //管理员
- Route::get('/admin', 'AdminController@index');
- Route::get('admin/{id}', 'AdminController@show');
- Route::post('admin', 'AdminController@store');
- Route::put('admin/{id}', 'AdminController@update');
- Route::delete('admin/{id}', 'AdminController@destroy');
- //角色
- Route::get('/role', 'RoleController@index');
- Route::get('role/{id}', 'RoleController@show');
- Route::post('role', 'RoleController@store');
- Route::put('role/{id}', 'RoleController@update');
- Route::delete('role/{id}', 'RoleController@destroy');
- Route::get('role-lists', 'RoleController@lists');
- //菜单
- Route::get('/menu', 'MenuController@index');
- Route::get('/menu-icons', 'MenuController@icons');
- Route::get('menu/{id}', 'MenuController@show');
- Route::post('menu', 'MenuController@store');
- Route::put('menu/{id}', 'MenuController@update');
- Route::delete('menu/{id}', 'MenuController@destroy');
- Route::get('menu-tree', 'MenuController@tree');
- Route::get('menu-user', 'MenuController@menus');
- });
- });
- Route::group([
- 'middleware' => 'auth:admins'
- ], function () {
- // 首页
- Route::get('/home', 'HomeController@index');
- //财务
- Route::group(['prefix' => 'finance', 'namespace' => 'Finance'], function () {
- //店铺
- Route::get('shop', 'ShopsController@index');
- Route::post('shop', 'ShopsController@store');
- Route::get('shop/{id}', 'ShopsController@show');
- Route::put('shop/{id}', 'ShopsController@update');
- Route::delete('shop/{id}', 'ShopsController@destroy');
- Route::post('shop-delete', 'ShopsController@delete');
- Route::get('shop-select-options', 'ShopsController@getSelectOptions');
- //参数配置
- Route::get('/category', 'CategoriesController@index');
- Route::get('category-tree', 'CategoriesController@tree');
- Route::post('category', 'CategoriesController@store');
- Route::put('category/{id}', 'CategoriesController@update');
- Route::delete('category/{id}', 'CategoriesController@destroy');
- //订单
- Route::get('order', 'OrdersController@index');
- Route::get('order-lists', 'OrdersController@lists');
- Route::post('order', 'OrdersController@store');
- Route::get('order/{id}', 'OrdersController@show');
- Route::put('order/{id}', 'OrdersController@update');
- Route::delete('order/{id}', 'OrdersController@destroy');
- Route::post('order-check', 'OrdersController@check');
- Route::put('order-update-refund/{id}', 'OrdersController@updateRefund');
- Route::post('order-import', 'OrdersController@import');
- //店铺流水
- Route::get('bill', 'BillsController@index');
- Route::get('bill-statistical', 'BillsController@indexWithStatistical');
- Route::post('bill', 'BillsController@store');
- Route::get('bill/{id}', 'BillsController@show');
- Route::put('bill/{id}', 'BillsController@update');
- Route::delete('bill/{id}', 'BillsController@destroy');
- Route::post('bill-check', 'BillsController@check');
- // Route::get('statistical', 'StatisticalsController@index');
- Route::get('statistical', 'StatisticalsController@statistical');
- Route::get('statistical-shop', 'StatisticalsController@statisticalShop');
- });
- });
- //附件下载
- //Route::get('/view/attach-download/{id}', 'Course\AttachController@download');
- Route::get('/', function () {
- return Response::success(app()->version());
- });
- //开发环境接口
- Route::group(['prefix' => 'develop'], function () {
- //响应状态
- // Route::get('/http-status', 'DevelopController@httpStatus');
- Route::post('/t', 'ExampleController@test');
- Route::get('/init', 'ExampleController@init');
- });
|