api.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Application Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register all of the routes for an application.
  8. | It is a breeze. Simply tell Lumen the URIs it should respond to
  9. | and give it the Closure to call when that URI is requested.
  10. |
  11. */
  12. $api = app('Dingo\Api\Routing\Router');
  13. $api->version('v1', [
  14. 'namespace' => 'App\Http\Controllers',
  15. ], function ($api) {
  16. //登录+验签
  17. $api->group(['middleware' => ['chxq_jwt_auth','chxq_sign']], function ($api) {
  18. });
  19. //仅验签
  20. $api->group(['middleware' => 'chxq_sign'], function ($api) {
  21. //内容预览
  22. $api->post('/templateSet/preview', 'CmsContentTemplateSetController@preview');
  23. //获取首页模板名称
  24. $api->get('/templateSet/templateName', 'CmsContentTemplateSetController@template');
  25. //首页商品列表
  26. $api->get('/templateSet/productList', 'CmsContentTemplateSetController@productList');
  27. });
  28. });
  29. $api->version('v1', [
  30. 'namespace' => 'App\Http\Controllers\V2',
  31. ], function ($api) {
  32. $api->group([
  33. 'prefix' => 'v2'
  34. ], function ($api) {
  35. $api->group(['middleware' => 'chxq_jwt_auth'], function ($api) {
  36. //楼层列表
  37. $api->get('/floor/index', 'FloorController@index');
  38. //获取楼层信息
  39. $api->get('/floor/info', 'FloorController@info');
  40. //热门视频ids
  41. $api->get('/floor/hotVideoIds', 'FloorController@hotVideoIds');
  42. //获取推荐用户组内容
  43. $api->get('memberList', 'MemberGroupController@memberList');
  44. });
  45. });
  46. });