api.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. //获取关注分类用户uids
  17. $api->get('post/getCategoryUids', 'Post\PostController@getCategoryUids');
  18. $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
  19. //配置
  20. $api->get('config', 'ConfigController@index');
  21. //下载列表
  22. $api->get('download', 'DownloadController@index');
  23. //新增下载
  24. $api->post('download', 'DownloadController@create');
  25. //测试用户统计
  26. $api->get('memberStatistics', 'MemberStatisticsController@index');
  27. //详情
  28. $api->get('memberStatistics/view', 'MemberStatisticsController@view');
  29. //获取上传凭证和地址
  30. $api->get('getVodUploadAuth', 'AliYunVodController@getVodUploadAuth');
  31. //根据videoId获取播放地址
  32. $api->get('getPlayUrlByVideoId', 'AliYunVodController@getPlayUrlByVideoId');
  33. $api->group(['namespace' => 'Post'], function ($api) {
  34. $api->get('statistics', 'PostController@statistics');
  35. //发布内容
  36. $api->post('post', 'PostController@create');
  37. //编辑发布内容话题
  38. $api->put('post/topic', 'PostController@updateTopic');
  39. //内容列表
  40. $api->get('post', 'PostController@index');
  41. //内容详情
  42. $api->get('post/detail', 'PostController@detail');
  43. //内容类型
  44. $api->get('post/getType', 'PostController@getType');
  45. //推荐内容
  46. $api->put('post/suggest', 'PostController@suggest');
  47. //删除内容
  48. $api->delete('post/delete', 'PostController@delete');
  49. //隐藏内容
  50. $api->put('post/hide', 'PostController@hide');
  51. //增加数据
  52. $api->put('post/addData', 'PostController@addData');
  53. //评论列表
  54. $api->get('post/comment', 'PostController@commentList');
  55. //评论&回复
  56. $api->post('post/comment', 'PostController@comment');
  57. //删除评论
  58. $api->delete('post/comment/delete', 'PostController@commentDelete');
  59. //回收站列表
  60. $api->get('post/waste', 'PostController@waste');
  61. //回收站复原
  62. $api->put('post/waste', 'PostController@restore');
  63. //日志列表
  64. $api->get('post/log', 'PostController@log');
  65. //添加网站内容
  66. $api->post('post/store', 'PostController@createStore');
  67. //获取网站内容
  68. $api->get('post/store', 'PostController@getStore');
  69. //网站内容详情
  70. $api->get('post/store/detail', 'PostController@getStoreDetail');
  71. });
  72. $api->group(['namespace' => 'Topic'], function ($api) {
  73. //重置话题redis
  74. $api->put('topic/resetRedis', 'TopicController@resetRedis');
  75. //新增话题分类
  76. $api->post('topic/categoryCreate', 'CategoryController@create');
  77. //话题分类列表
  78. $api->get('topic/categoryIndex', 'CategoryController@index');
  79. //话题分类详情
  80. $api->get('topic/categoryView', 'CategoryController@view');
  81. //推荐分类
  82. $api->put('topic/categoryIsSuggest', 'CategoryController@isSuggest');
  83. //开启分类
  84. $api->put('topic/category/is_open', 'CategoryController@isOpen');
  85. //编辑话题
  86. $api->put('topic/categoryEdit', 'CategoryController@edit');
  87. //话题分类详情(推荐内容首页用)
  88. $api->get('topic/category_suggest', 'CategoryController@suggestDetail');
  89. //编辑话题分类(推荐内容首页用)
  90. $api->put('topic/category_suggest', 'CategoryController@suggestEdit');
  91. //新增话题
  92. $api->post('topic/topicCreate', 'TopicController@create');
  93. //编辑话题
  94. $api->put('topic/topicEdit', 'TopicController@edit');
  95. //列表
  96. $api->get('topic/topicIndex', 'TopicController@index');
  97. //详情
  98. $api->get('topic/topicView', 'TopicController@view');
  99. //开启话题
  100. $api->put('topic/topicIsOpen', 'TopicController@isOpen');
  101. //设置推荐 &热门话题
  102. $api->put('topic/topicSetStatus', 'TopicController@setStatus');
  103. //获取多个话题
  104. $api->get('topic/getTopic', 'TopicController@getTopic');
  105. //获取用户关注话题
  106. $api->get('topic/getMemberTopic', 'TopicController@getMemberTopic');
  107. });
  108. //行为
  109. $api->group(['namespace' => 'Behavior'], function ($api) {
  110. //行为列表
  111. $api->get('behavior/list', 'BehaviorController@index');
  112. //登记/注册行为
  113. $api->post('behavior/create', 'BehaviorController@create');
  114. //编辑行为
  115. $api->put('behavior/edit', 'BehaviorController@edit');
  116. //列表修改行为状态(行为管理)
  117. $api->post('behavior/editStatus', 'BehaviorController@editStatus');
  118. //行为数据列表
  119. $api->get('behavior/behaviorData', 'BehaviorController@behaviorData');
  120. //行为日志列表
  121. $api->get('behavior/log', 'LogController@index');
  122. //用户注册账单列表
  123. $api->get('registeredRecord/list', 'RegisteredRecordController@index');
  124. //评论账本列表
  125. $api->get('CommentRecord/list', 'CommentRecordController@index');
  126. //发布账本列表
  127. $api->get('ReleaseRecord/list', 'ReleaseRecordController@index');
  128. //阅读/分享/收藏等普通行为账单
  129. $api->get('generalRecord/list', 'GeneralRecordController@index');
  130. });
  131. //音乐分类列表
  132. $api->get('music/category/list', 'MusicController@categoryList');
  133. //新增音乐分类
  134. $api->post('music/category/create', 'MusicController@categoryCreate');
  135. //编辑音乐分类
  136. $api->put('music/category/create', 'MusicController@categoryEdit');
  137. //修改音乐分类状态
  138. $api->put('music/category/status', 'MusicController@editStatus');
  139. //删除音乐分类
  140. $api->delete('music/category/delete', 'MusicController@categoryDelete');
  141. //音乐列表
  142. $api->get('music/list', 'MusicController@musicList');
  143. //新建音乐
  144. $api->post('music/create', 'MusicController@musicCreate');
  145. //修改音乐
  146. $api->put('music/create', 'MusicController@musicEdit');
  147. //删除音乐
  148. $api->delete('music/delete', 'MusicController@musicDelete');
  149. //用户上传音乐列表
  150. $api->get('music/upload/list', 'MusicController@userMusic');
  151. });
  152. });