api.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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\V1',
  15. ], function ($api) {
  16. //根据行为标识查询行为
  17. $api->get('getBehaviorByIdentify', 'BehaviorController@getBehaviorByIdentify');
  18. $api->get('getVodUploadAuth', 'AliYunVodController@getVodUploadAuth');
  19. $api->get('vod/upload/image', 'AliYunVodController@getImgUploadAuth');
  20. $api->get('getPlayUrlByVideoId', 'AliYunVodController@getPlayUrlByVideoId');
  21. //下载量
  22. $api->put('download_count', 'PostController@downloadCount');
  23. //获取所有行为
  24. $api->get('getAllBehavior', 'BehaviorController@getAllBehavior');
  25. $api->group(['middleware' => ['chxq_sign']], function ($api) {
  26. //查询帖子内容详情
  27. $api->get('post/info', 'PostController@find');
  28. });
  29. //登录
  30. $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
  31. //获取热门分类下音乐列表
  32. $api->get('musicList', 'MusicListController@index');
  33. //音乐分类列表
  34. $api->get('category/list', 'MusicListController@categoryList');
  35. //获取某分类下所有音乐
  36. $api->get('music', 'MusicListController@postMusicList');
  37. //用户上传音乐
  38. $api->post('music/upload', 'MusicListController@addMusic');
  39. });
  40. //内容列表
  41. $api->get('post', 'PostController@index');
  42. //视频列表
  43. $api->get('post/video', 'PostController@video');
  44. //推荐内容
  45. $api->get('post/suggest', 'PostController@suggestPost');
  46. //内容详情
  47. $api->get('post/detail', 'PostController@detail');
  48. //话题内容列表
  49. $api->get('post/topic', 'PostController@topicPost');
  50. //话题详情
  51. $api->get('topic/detail', 'PostController@topicDetail');
  52. //评价列表
  53. $api->get('post/comment', 'PostController@commentList');
  54. //回复列表
  55. $api->get('post/reply', 'PostController@replyList');
  56. //获取内容视频组
  57. $api->get('post/video/group', 'PostController@getPostVideo');
  58. //获取话题
  59. $api->get('topic/group', 'PostController@getTopic');
  60. //分类列表(推荐内容首页用)
  61. $api->get('post/category', 'CategoryController@suggest');
  62. //图片验证
  63. $api->get('post/checkImage', 'PostController@checkImage');
  64. //圈子相关
  65. //圈子检测
  66. $api->get('circle/valid', 'CircleController@valid');
  67. //圈子首页
  68. $api->get('circle', 'CircleController@index');
  69. //圈子问题
  70. $api->get('circle/question', 'CircleController@getQuestion');
  71. //圈子精华文章列表
  72. $api->get('circle/articles', 'CircleController@articleList');
  73. //圈子提问列表
  74. $api->get('circle/messages', 'CircleController@messageList');
  75. //圈子提问评论列表
  76. $api->get('circle/comments', 'CircleController@commentList');
  77. //圈子提问回复列表
  78. $api->get('circle/replys', 'CircleController@replyList');
  79. //相册列表
  80. $api->get('circle/pictures', 'CircleController@pictureList');
  81. //圈子成员
  82. $api->get('circle/members', 'CircleController@memberList');
  83. //登录+验签
  84. $api->group(['middleware' => ['chxq_jwt_auth','chxq_sign']], function ($api) {
  85. //发布内容
  86. $api->post('post', 'PostController@create');
  87. //删除内容
  88. $api->delete('post', 'PostController@delete');
  89. //个人中心内容
  90. $api->get('post/my', 'PostController@myPost');
  91. //评价&回复
  92. $api->post('post/comment', 'PostController@comment');
  93. //评价&回复删除
  94. $api->delete('post/comment', 'PostController@commentDelete');
  95. //话题分类
  96. $api->get('topicCategory', 'CategoryController@index');
  97. //获取话题
  98. $api->get('topicCategory/getTopics', 'CategoryController@getTopics');
  99. //话题列表
  100. $api->get('topic', 'PostController@topicList');
  101. //关注推荐话题
  102. $api->post('memberFollowTopic', 'MemberFollowTopic@memberFollowTopic');
  103. //关注单个话题
  104. $api->post('memberFollowTopic/follow', 'MemberFollowTopic@followTopic');
  105. //取消关注
  106. $api->delete('memberFollowTopic/cancel', 'MemberFollowTopic@cancelFollowTopic');
  107. //获取用户关注话题
  108. $api->get('memberFollowTopic/getMemberTopic', 'MemberFollowTopic@getMemberTopics');
  109. //关注话题列表
  110. $api->get('memberFollowTopic', 'MemberFollowTopic@index');
  111. //收藏列表
  112. $api->get('postCollect', 'PostCollectController@index');
  113. //用户发布数,收藏数,转发数
  114. $api->get('post/memberPostStatistics', 'PostController@memberPostStatistics');
  115. //关注feed流
  116. $api->get('feed', 'FeedController@index');
  117. //优秀居民信息获取
  118. $api->get('excellentResidents', 'BeanDetailController@excellentResidents');
  119. //排行榜
  120. $api->get('rankingList', 'BeanDetailController@rankingList');
  121. //后院首页
  122. $api->get('starHome', 'BeanDetailController@starHome');
  123. //加入圈子
  124. $api->post('circle/join', 'CircleController@joinCircle');
  125. //退出圈子
  126. $api->delete('circle/join', 'CircleController@exitCircle');
  127. //创建提问
  128. $api->post('circle/message', 'CircleController@messageCreate');
  129. //创建提问评论
  130. $api->post('circle/comment', 'CircleController@comment');
  131. //提问顶踩
  132. $api->post('circle/message/action', 'CircleController@messageAction');
  133. //删除提问
  134. $api->delete('circle/message', 'CircleController@deleteMessage');
  135. //删除评论
  136. $api->delete('circle/comment', 'CircleController@deleteComment');
  137. //删除相册
  138. $api->delete('circle/picture', 'CircleController@deletePicture');
  139. //创建相册
  140. $api->post('circle/picture', 'CircleController@createPictures');
  141. });
  142. //分享/邀请首页
  143. $api->get('starDetail', 'BeanDetailController@starDetail');
  144. //不登录单独返回每日新闻、小贴士
  145. $api->get('/starHome/lists', 'BeanDetailController@lists');
  146. });