api.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. $api->group(['middleware' => 'chxq_sign'], function ($api) {
  20. //内容预览
  21. $api->post('/templateSet/preview', 'CmsContentTemplateSetController@preview');
  22. //获取首页模板名称
  23. $api->get('/templateSet/templateName', 'CmsContentTemplateSetController@template');
  24. //首页商品列表
  25. $api->get('/templateSet/productList', 'CmsContentTemplateSetController@productList');
  26. });
  27. $api->group(['middleware' => 'chxq_jwt_auth'], function ($api) {
  28. });
  29. //兑换商城首页
  30. $api->get('/template/exchange', 'CmsContentTemplateSetController@exchangeMall');
  31. //获取左一右二/上一下三专题下的商品
  32. $api->get('/subject/products', 'CmsContentTemplateSetController@getProducts');
  33. });
  34. $api->version('v1', [
  35. 'namespace' => 'App\Http\Controllers\V2',
  36. ], function ($api) {
  37. $api->group([
  38. 'prefix' => 'v2'
  39. ], function ($api) {
  40. //获取楼层信息
  41. $api->get('/floor/info', 'FloorController@info');
  42. //热门视频ids
  43. $api->get('/floor/hotVideoIds', 'FloorController@hotVideoIds');
  44. $api->group(['middleware' => 'chxq_jwt_auth'], function ($api) {
  45. //楼层列表
  46. $api->get('/floor/index', 'FloorController@index');
  47. //获取推荐用户组内容
  48. $api->get('memberList', 'MemberGroupController@memberList');
  49. });
  50. });
  51. });