admin.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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\Route;
  11. /*
  12. |--------------------------------------------------------------------------
  13. | Application Routes
  14. |--------------------------------------------------------------------------
  15. |
  16. | Here is where you can register all of the routes for an application.
  17. | It is a breeze. Simply tell Lumen the URIs it should respond to
  18. | and give it the Closure to call when that URI is requested.
  19. |
  20. */
  21. /**
  22. * 基础业务模块
  23. */
  24. Route::group(['namespace' => 'Base'], function () {
  25. //登录
  26. Route::post('/auth/login', 'AuthController@login');
  27. //上传文件
  28. Route::post('/common/upload', 'ResourceController@upload');
  29. //枚举
  30. Route::get('/common/enums', 'CommonController@enums');
  31. Route::group([
  32. 'middleware' => 'auth:admins'
  33. ], function () {
  34. Route::get('/auth/me', 'AuthController@me');
  35. Route::put('/auth/me', 'AuthController@update');
  36. Route::get('/auth/logout', 'AuthController@logout');
  37. Route::group(['prefix' => 'base'], function () {
  38. //部门管理
  39. Route::get('department', 'DepartmentController@index');
  40. Route::get('department/{id}', 'DepartmentController@show');
  41. Route::post('department', 'DepartmentController@store');
  42. Route::post('department/delete', 'DepartmentController@delete');
  43. Route::put('department/{id}', 'DepartmentController@update');
  44. Route::delete('department/{id}', 'DepartmentController@destroy');
  45. Route::get('department-tree', 'DepartmentController@tree');
  46. //管理员
  47. Route::get('/admin', 'AdminController@index');
  48. Route::get('admin/{id}', 'AdminController@show');
  49. Route::post('admin', 'AdminController@store');
  50. Route::put('admin/{id}', 'AdminController@update');
  51. Route::delete('admin/{id}', 'AdminController@destroy');
  52. //角色
  53. Route::get('/role', 'RoleController@index');
  54. Route::get('role/{id}', 'RoleController@show');
  55. Route::post('role', 'RoleController@store');
  56. Route::put('role/{id}', 'RoleController@update');
  57. Route::delete('role/{id}', 'RoleController@destroy');
  58. Route::get('role-lists', 'RoleController@lists');
  59. //菜单
  60. Route::get('/menu', 'MenuController@index');
  61. Route::get('/menu-icons', 'MenuController@icons');
  62. Route::get('menu/{id}', 'MenuController@show');
  63. Route::post('menu', 'MenuController@store');
  64. Route::put('menu/{id}', 'MenuController@update');
  65. Route::delete('menu/{id}', 'MenuController@destroy');
  66. Route::get('menu-tree', 'MenuController@tree');
  67. Route::get('menu-user', 'MenuController@menus');
  68. //轮播图管理
  69. Route::get('banner', 'BannersController@index');
  70. Route::get('banner/{id}', 'BannersController@show');
  71. Route::post('banner', 'BannersController@store');
  72. Route::post('banner/delete', 'BannersController@delete');
  73. Route::put('banner/{id}', 'BannersController@update');
  74. Route::delete('banner/{id}', 'BannersController@destroy');
  75. //商户
  76. Route::get('/shop', 'ShopsController@index');
  77. Route::post('/shop', 'ShopsController@store');
  78. Route::get('/shop/{id}', 'ShopsController@show');
  79. Route::put('/shop/{id}', 'ShopsController@update');
  80. Route::delete('/shop/{id}', 'ShopsController@destroy');
  81. Route::get('/shop-select-options', 'ShopsController@SelectOptions');
  82. });
  83. });
  84. });
  85. Route::group([
  86. 'middleware' => 'auth:admins'
  87. ], function () {
  88. // 首页
  89. Route::get('/home', 'HomeController@index');
  90. //区域
  91. Route::group(['prefix' => 'area'], function () {
  92. //项目
  93. // Route::group(['prefix' => 'project', 'namespace' => 'Area'], function () {
  94. // Route::get('/', 'ProjectsController@index');
  95. // Route::post('/', 'ProjectsController@store');
  96. // Route::get('/info/{id}', 'ProjectsController@show');
  97. // Route::put('/{id}', 'ProjectsController@update');
  98. // Route::delete('/{id}', 'ProjectsController@destroy');
  99. // Route::get('/select-options', 'ProjectsController@SelectOptions');
  100. // });
  101. Route::group(['namespace' => 'Area'], function () {
  102. Route::get('/', 'AreasController@index');
  103. Route::get('/no-page', 'AreasController@indexNoPage');
  104. Route::get('/trees', 'AreasController@trees');
  105. Route::get('/select-options', 'AreasController@selectOptions');
  106. Route::post('/', 'AreasController@store');
  107. Route::get('/info/{id}', 'AreasController@show');
  108. Route::put('/{id}', 'AreasController@update');
  109. Route::delete('/{id}', 'AreasController@destroy');
  110. Route::post('/delete', 'AreasController@delete');
  111. Route::get('/select-options-trees', 'AreasController@selectOptionTrees');
  112. Route::group(['prefix' => 'project'], function () {
  113. Route::get('/', 'ProjectsController@index');
  114. Route::post('/', 'ProjectsController@store');
  115. Route::get('/info/{id}', 'ProjectsController@show');
  116. Route::put('/{id}', 'ProjectsController@update');
  117. Route::delete('/{id}', 'ProjectsController@destroy');
  118. Route::get('/select-options', 'ProjectsController@SelectOptions');
  119. Route::get('/areas', 'ProjectsController@project');
  120. Route::get('/areas-tree', 'ProjectsController@projectTree');
  121. });
  122. Route::group(['prefix' => 'point'], function () {
  123. Route::get('/', 'PointsController@index');
  124. Route::post('/', 'PointsController@store');
  125. Route::get('/info/{id}', 'PointsController@show');
  126. Route::put('/{id}', 'PointsController@update');
  127. Route::delete('/{id}', 'PointsController@destroy');
  128. Route::get('/select-options', 'PointsController@SelectOptions');
  129. Route::get('/areas', 'PointsController@project');
  130. Route::get('/select-options-trees', 'PointsController@selectOptionTrees');
  131. });
  132. });
  133. });
  134. });
  135. //附件下载
  136. //Route::get('/view/attach-download/{id}', 'Course\AttachController@download');
  137. Route::get('/', function () {
  138. return app()->version();
  139. });
  140. //开发环境接口
  141. Route::group(['prefix' => 'develop'], function () {
  142. //响应状态
  143. // Route::get('/http-status', 'DevelopController@httpStatus');
  144. Route::post('/t', 'ExampleController@test');
  145. Route::get('/init', 'ExampleController@init');
  146. });