admin.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. use Illuminate\Support\Facades\Hash;
  11. use Illuminate\Support\Facades\Http;
  12. use Illuminate\Support\Facades\Route;
  13. use Jiannei\Response\Laravel\Support\Facades\Response;
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Application Routes
  17. |--------------------------------------------------------------------------
  18. |
  19. | Here is where you can register all of the routes for an application.
  20. | It is a breeze. Simply tell Lumen the URIs it should respond to
  21. | and give it the Closure to call when that URI is requested.
  22. |
  23. */
  24. /**
  25. * 基础业务模块
  26. */
  27. Route::group(['namespace' => 'Base', 'prefix' => 'base'], function () {
  28. //登录
  29. Route::post('/auth/login', 'AuthController@login');
  30. //上传文件
  31. Route::post('/common/upload', 'ResourceController@upload');
  32. Route::get('/common/enums', 'CommonController@enums');
  33. Route::group([
  34. 'middleware' => 'auth:admins'
  35. ], function () {
  36. Route::get('/auth/me', 'AuthController@me');
  37. Route::put('/auth/me', 'AuthController@update');
  38. Route::get('/auth/logout', 'AuthController@logout');
  39. //部门管理
  40. Route::get('department', 'DepartmentController@index');
  41. Route::get('department/{id}', 'DepartmentController@show');
  42. Route::post('department', 'DepartmentController@store');
  43. Route::post('department/delete', 'DepartmentController@delete');
  44. Route::put('department/{id}', 'DepartmentController@update');
  45. Route::delete('department/{id}', 'DepartmentController@destroy');
  46. Route::get('department-tree', 'DepartmentController@tree');
  47. //管理员
  48. Route::get('/admin', 'AdminController@index');
  49. Route::get('admin/{id}', 'AdminController@show');
  50. Route::post('admin', 'AdminController@store');
  51. Route::put('admin/{id}', 'AdminController@update');
  52. Route::delete('admin/{id}', 'AdminController@destroy');
  53. //角色
  54. Route::get('/role', 'RoleController@index');
  55. Route::get('role/{id}', 'RoleController@show');
  56. Route::post('role', 'RoleController@store');
  57. Route::put('role/{id}', 'RoleController@update');
  58. Route::delete('role/{id}', 'RoleController@destroy');
  59. Route::get('role-lists', 'RoleController@lists');
  60. //菜单
  61. Route::get('/menu', 'MenuController@index');
  62. Route::get('/menu-icons', 'MenuController@icons');
  63. Route::get('menu/{id}', 'MenuController@show');
  64. Route::post('menu', 'MenuController@store');
  65. Route::put('menu/{id}', 'MenuController@update');
  66. Route::delete('menu/{id}', 'MenuController@destroy');
  67. Route::get('menu-tree', 'MenuController@tree');
  68. Route::get('menu-user', 'MenuController@menus');
  69. });
  70. });
  71. Route::group([
  72. 'middleware' => 'auth:admins'
  73. ], function () {
  74. // 首页
  75. Route::get('/home', 'HomeController@index');
  76. //财务
  77. Route::group(['prefix' => 'finance', 'namespace' => 'Finance'], function () {
  78. //店铺
  79. Route::get('shop', 'ShopsController@index');
  80. Route::post('shop', 'ShopsController@store');
  81. Route::get('shop/{id}', 'ShopsController@show');
  82. Route::put('shop/{id}', 'ShopsController@update');
  83. Route::delete('shop/{id}', 'ShopsController@destroy');
  84. Route::post('shop-delete', 'ShopsController@delete');
  85. Route::get('shop-select-options', 'ShopsController@getSelectOptions');
  86. //参数配置
  87. Route::get('/category', 'CategoriesController@index');
  88. Route::get('category-tree', 'CategoriesController@tree');
  89. Route::post('category', 'CategoriesController@store');
  90. Route::put('category/{id}', 'CategoriesController@update');
  91. Route::delete('category/{id}', 'CategoriesController@destroy');
  92. //订单
  93. Route::get('order', 'OrdersController@index');
  94. Route::get('order-lists', 'OrdersController@lists');
  95. Route::post('order', 'OrdersController@store');
  96. Route::get('order/{id}', 'OrdersController@show');
  97. Route::put('order/{id}', 'OrdersController@update');
  98. Route::delete('order/{id}', 'OrdersController@destroy');
  99. Route::post('order-check', 'OrdersController@check');
  100. Route::put('order-update-refund/{id}', 'OrdersController@updateRefund');
  101. Route::post('order-import', 'OrdersController@import');
  102. //店铺流水
  103. Route::get('bill', 'BillsController@index');
  104. Route::get('bill-statistical', 'BillsController@indexWithStatistical');
  105. Route::post('bill', 'BillsController@store');
  106. Route::get('bill/{id}', 'BillsController@show');
  107. Route::put('bill/{id}', 'BillsController@update');
  108. Route::delete('bill/{id}', 'BillsController@destroy');
  109. Route::post('bill-check', 'BillsController@check');
  110. // Route::get('statistical', 'StatisticalsController@index');
  111. Route::get('statistical', 'StatisticalsController@statistical');
  112. Route::get('statistical-shop', 'StatisticalsController@statisticalShop');
  113. });
  114. });
  115. //附件下载
  116. //Route::get('/view/attach-download/{id}', 'Course\AttachController@download');
  117. Route::get('/', function () {
  118. return Response::success(app()->version());
  119. });
  120. //开发环境接口
  121. Route::group(['prefix' => 'develop'], function () {
  122. //响应状态
  123. // Route::get('/http-status', 'DevelopController@httpStatus');
  124. Route::post('/t', 'ExampleController@test');
  125. Route::get('/init', 'ExampleController@init');
  126. });