api.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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->post('login', 'AuthController@authenticate');
  18. $api->group(['middleware' => 'auth:api'], function ($api) {
  19. //注册
  20. $api->post('reg', 'AuthController@register');
  21. //登出
  22. $api->post('logout', 'AuthController@logout');
  23. //刷新身份令牌
  24. $api->post('refresh', 'AuthController@refresh');
  25. });
  26. $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
  27. //用户列表
  28. $api->get('user', 'UserController@index');
  29. //用户列表
  30. $api->get('memberList', 'MemberController@memberList');
  31. //用户详情
  32. $api->post('memberView', 'MemberController@view');
  33. //修改状态
  34. $api->put('updateStatus', 'MemberController@updateStatus');
  35. //设置属性
  36. $api->post('setAttr', 'MemberController@setAttr');
  37. //公共配置
  38. $api->post('configIndex', 'ConfigController@index');
  39. //专题列表
  40. $api->get('/subject/index', 'CmsSubjectController@index');
  41. //新增专题
  42. $api->post('/subject/create', 'CmsSubjectController@create');
  43. //查看某专题
  44. $api->get('/subject/view', 'CmsSubjectController@view');
  45. //编辑专题
  46. $api->put('/subject/edit', 'CmsSubjectController@edit');
  47. //删除专题
  48. $api->delete('/subject/delete', 'CmsSubjectController@delete');
  49. //列表修改专题状态
  50. $api->post('/subject/editStatus', 'CmsSubjectController@editStatus');
  51. //模板列表
  52. $api->get('/template/index', 'CmsContentTemplateController@index');
  53. //新建模板
  54. $api->post('/template/create', 'CmsContentTemplateController@create');
  55. //列表修改模板状态
  56. $api->put('/template/edit', 'CmsContentTemplateController@edit');
  57. //列表修改模板名称
  58. $api->put('/template/editName', 'CmsContentTemplateController@editTemplateName');
  59. //banner设置
  60. $api->post('/templateSet/bannerSet', 'CmsContentTemplateSetController@bannerSet');
  61. //专题广告设置
  62. $api->post('/templateSet/advertisement', 'CmsContentTemplateSetController@advertisement');
  63. //商品楼层设置
  64. $api->post('/templateSet/floorSet', 'CmsContentTemplateSetController@floorSet');
  65. //分类专题设置
  66. $api->post('/templateSet/categorySet', 'CmsContentTemplateSetController@categorySet');
  67. //模板内容删除
  68. $api->delete('/templateSetDelete', 'CmsContentTemplateSetController@templateSetDelete');
  69. //内容发布
  70. $api->post('/templateSet/release', 'CmsContentTemplateSetController@release');
  71. //内容预览
  72. $api->post('/templateSet/preview', 'CmsContentTemplateSetController@preview');
  73. //点击内容配置
  74. $api->post('/templateSet/set', 'CmsContentTemplateSetController@set');
  75. //获取对应城市模板名称
  76. $api->get('templateName', 'CmsContentTemplateSetController@templateName');
  77. });
  78. });
  79. $api->version('v1', [
  80. 'namespace' => 'App\Http\Controllers\V2',
  81. ], function ($api) {
  82. $api->group([
  83. 'prefix' => 'v2'
  84. ], function ($api) {
  85. $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
  86. });
  87. //banner专题计数
  88. $api->post('countSubject', 'CmsContentTemplateSetController@countSubject');
  89. //楼层列表
  90. $api->get('/floor/index', 'FloorController@index');
  91. //新增楼层
  92. $api->post('/floor/create', 'FloorController@create');
  93. //编辑楼层
  94. $api->put('/floor/edit', 'FloorController@edit');
  95. //修改楼层状态
  96. $api->put('/floor/editStatus', 'FloorController@editStatus');
  97. //关闭banner修改楼层状态
  98. $api->put('floorBind', 'FloorController@floorBind');
  99. });
  100. });