api.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
  17. //配置
  18. $api->get('config', 'ConfigController@index');
  19. //下载列表
  20. $api->get('download', 'DownloadController@index');
  21. //新增下载
  22. $api->post('download', 'DownloadController@create');
  23. //测试用户统计
  24. $api->get('memberStatistics', 'MemberStatisticsController@index');
  25. //详情
  26. $api->get('memberStatistics/view', 'MemberStatisticsController@view');
  27. //获取上传凭证和地址
  28. $api->get('getVodUploadAuth', 'AliYunVodController@getVodUploadAuth');
  29. //根据videoId获取播放地址
  30. $api->get('getPlayUrlByVideoId', 'AliYunVodController@getPlayUrlByVideoId');
  31. $api->group(['namespace' => 'Post'], function ($api) {
  32. $api->get('statistics', 'PostController@statistics');
  33. //发布内容
  34. $api->post('post', 'PostController@create');
  35. //内容列表
  36. $api->get('post', 'PostController@index');
  37. //内容详情
  38. $api->get('post/detail', 'PostController@detail');
  39. //推荐内容
  40. $api->put('post/suggest', 'PostController@suggest');
  41. //删除内容
  42. $api->delete('post/delete', 'PostController@delete');
  43. //隐藏内容
  44. $api->put('post/hide', 'PostController@hide');
  45. //增加数据
  46. $api->put('post/addData', 'PostController@addData');
  47. //评论列表
  48. $api->get('post/comment', 'PostController@commentList');
  49. //评论&回复
  50. $api->post('post/comment', 'PostController@comment');
  51. //删除评论
  52. $api->delete('post/comment/delete', 'PostController@commentDelete');
  53. //回收站列表
  54. $api->get('post/waste', 'PostController@waste');
  55. //回收站复原
  56. $api->put('post/waste', 'PostController@restore');
  57. //日志列表
  58. $api->get('post/log', 'PostController@log');
  59. });
  60. $api->group(['namespace' => 'Topic'], function ($api) {
  61. //重置话题redis
  62. $api->put('topic/resetRedis', 'TopicController@resetRedis');
  63. //新增话题分类
  64. $api->post('topic/categoryCreate', 'CategoryController@create');
  65. //话题分类列表
  66. $api->get('topic/categoryIndex', 'CategoryController@index');
  67. //话题分类详情
  68. $api->get('topic/categoryView', 'CategoryController@view');
  69. //推荐分类
  70. $api->put('topic/categoryIsSuggest', 'CategoryController@isSuggest');
  71. //编辑话题
  72. $api->put('topic/categoryEdit', 'CategoryController@edit');
  73. //新增话题
  74. $api->post('topic/topicCreate', 'TopicController@create');
  75. //编辑话题
  76. $api->put('topic/topicEdit', 'TopicController@edit');
  77. //列表
  78. $api->get('topic/topicIndex', 'TopicController@index');
  79. //详情
  80. $api->get('topic/topicView', 'TopicController@view');
  81. //开启话题
  82. $api->put('topic/topicIsOpen', 'TopicController@isOpen');
  83. //设置推荐 &热门话题
  84. $api->put('topic/topicSetStatus', 'TopicController@setStatus');
  85. //获取多个话题
  86. $api->get('topic/getTopic', 'TopicController@getTopic');
  87. });
  88. //行为
  89. $api->group(['namespace' => 'Behavior'], function ($api) {
  90. //行为列表
  91. $api->get('behavior/list', 'BehaviorController@index');
  92. //登记/注册行为
  93. $api->post('behavior/create', 'BehaviorController@create');
  94. //编辑行为
  95. $api->put('behavior/edit', 'BehaviorController@edit');
  96. //列表修改行为状态(行为管理)
  97. $api->post('behavior/editStatus', 'BehaviorController@editStatus');
  98. //行为数据列表
  99. $api->get('behavior/behaviorData', 'BehaviorController@behaviorData');
  100. //行为日志列表
  101. $api->get('behavior/log', 'LogController@index');
  102. //用户注册账单列表
  103. $api->get('registeredRecord/list', 'RegisteredRecordController@index');
  104. //评论账本列表
  105. $api->get('CommentRecord/list', 'CommentRecordController@index');
  106. //发布账本列表
  107. $api->get('ReleaseRecord/list', 'ReleaseRecordController@index');
  108. //阅读/分享/收藏等普通行为账单
  109. $api->get('generalRecord/list', 'GeneralRecordController@index');
  110. });
  111. });
  112. });