web.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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::get('/home', 'HomeController@index');
  28. Route::group(['namespace' => 'Base'], function () {
  29. //登录
  30. Route::post('/auth/login', 'AuthController@login');
  31. Route::post('/auth/register', 'AuthController@store');
  32. //上传文件
  33. Route::post('/common/upload', 'ResourceController@upload');
  34. Route::group([
  35. 'middleware' => 'auth:api'
  36. ], function () {
  37. Route::get('/auth/me', 'AuthController@me');
  38. Route::put('/auth/me', 'AuthController@update');
  39. Route::get('/auth/logout', 'AuthController@logout');
  40. });
  41. });
  42. /**
  43. * 观看视频接口
  44. */
  45. //Route::group(['namespace' => 'Course'], function () {
  46. //
  47. // Route::get('/home', 'HomeController@index');
  48. //
  49. // //分类
  50. // Route::get('/course/categories', 'CategoryController@index');
  51. // //视频列表
  52. // Route::get('/courses', 'CourseController@index');
  53. // //视频详情
  54. // Route::get('/course/{slug}', 'CourseController@show');
  55. //
  56. // Route::group([
  57. // 'prefix' => 'course',
  58. // 'middleware' => 'auth:api'
  59. // ], function () {
  60. // //订阅
  61. // Route::post('/course-subscribe', 'CourseController@subscribe');
  62. // //评价
  63. // Route::post('/comment', 'CommentController@store');
  64. // //视频
  65. // Route::get('/video/{id}', 'VideoController@viewShow');
  66. // Route::post('/video-look-record', 'VideoController@lookRecord');
  67. //
  68. // Route::get('/attach-download/{id}', 'AttachController@download');
  69. //
  70. // Route::get('/video/{video_id}/comments', 'CommentController@videoComments');
  71. // Route::get('/course/{course_id}/comments', 'CommentController@courseComments');
  72. // });
  73. //});
  74. //Route::group(['prefix' => 'inform', 'namespace' => 'Inform'], function () {
  75. // //分类
  76. // Route::get('category', 'CategoryController@index');
  77. // Route::post('category', 'CategoryController@store');
  78. // Route::get('category/{id}', 'CategoryController@show');
  79. // Route::put('category/{id}', 'CategoryController@update');
  80. // Route::delete('category/{id}', 'CategoryController@destroy');
  81. // Route::post('category/delete', 'CategoryController@delete');
  82. // Route::get('category-tree', 'CategoryController@tree');
  83. // Route::get('category-user-tree', 'CategoryController@lists');
  84. //
  85. // //信息
  86. // Route::get('information', 'InformationController@index');
  87. // Route::post('information', 'InformationController@store');
  88. // Route::get('information/{id}', 'InformationController@show');
  89. // Route::put('information/{id}', 'InformationController@update');
  90. // Route::delete('information/{id}', 'InformationController@destroy');
  91. // Route::post('information/delete', 'InformationController@delete');
  92. // Route::get('information-user-messages', 'InformationController@userMessages');
  93. // Route::post('information-read-messages', 'InformationController@readMessages');
  94. // Route::post('information-good', 'InformationController@good');
  95. //});
  96. Route::get('/', function () {
  97. return Response::success(app()->version());
  98. });
  99. //开发环境接口
  100. Route::group(['prefix' => 'develop'], function () {
  101. //响应状态
  102. // Route::get('/http-status', 'DevelopController@httpStatus');
  103. Route::post('/t', 'ExampleController@test');
  104. Route::get('/init', 'ExampleController@init');
  105. });