api.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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('getPlayUrlByVideoId', 'AliYunVodController@getPlayUrlByVideoId');
  20. //获取所有行为
  21. $api->get('getAllBehavior', 'BehaviorController@getAllBehavior');
  22. $api->group(['middleware' => ['chxq_sign']], function ($api) {
  23. //查询帖子内容详情
  24. $api->get('post/info', 'PostController@find');
  25. });
  26. //登录
  27. $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
  28. //内容详情
  29. $api->get('post/detail', 'PostController@detail');
  30. //获取热门分类下音乐列表
  31. $api->get('musicList', 'MusicListController@index');
  32. //音乐分类列表
  33. $api->get('category/list', 'MusicListController@categoryList');
  34. //获取某分类下所有音乐
  35. $api->get('music', 'MusicListController@postMusicList');
  36. //用户上传音乐
  37. $api->post('music/upload', 'MusicListController@addMusic');
  38. });
  39. $api->get('post/suggest2', 'PostController@suggestPost');
  40. //登录+验签
  41. $api->group(['middleware' => ['chxq_jwt_auth','chxq_sign']], function ($api) {
  42. //发布内容
  43. $api->post('post', 'PostController@create');
  44. //删除内容
  45. $api->delete('post', 'PostController@delete');
  46. //个人中心内容
  47. $api->get('post/my', 'PostController@myPost');
  48. //内容列表
  49. $api->get('post', 'PostController@index');
  50. //视频列表
  51. $api->get('post/video', 'PostController@video');
  52. //推荐内容
  53. $api->get('post/suggest', 'PostController@suggestPost');
  54. //评价&回复
  55. $api->post('post/comment', 'PostController@comment');
  56. //评价列表
  57. $api->get('post/comment', 'PostController@commentList');
  58. //回复列表
  59. $api->get('post/reply', 'PostController@replyList');
  60. //话题分类
  61. $api->get('topicCategory', 'CategoryController@index');
  62. //获取话题
  63. $api->get('topicCategory/getTopics', 'CategoryController@getTopics');
  64. //获取话题
  65. $api->get('topic/group', 'PostController@getTopic');
  66. //话题内容列表
  67. $api->get('post/topic', 'PostController@topicPost');
  68. //话题列表
  69. $api->get('topic', 'PostController@topicList');
  70. //获取内容视频组
  71. $api->get('post/video/group', 'PostController@getPostVideo');
  72. //话题详情
  73. $api->get('topic/detail', 'PostController@topicDetail');
  74. //关注推荐话题
  75. $api->post('memberFollowTopic', 'MemberFollowTopic@memberFollowTopic');
  76. //关注单个话题
  77. $api->post('memberFollowTopic/follow', 'MemberFollowTopic@followTopic');
  78. //取消关注
  79. $api->delete('memberFollowTopic/cancel', 'MemberFollowTopic@cancelFollowTopic');
  80. //获取用户关注话题
  81. $api->get('memberFollowTopic/getMemberTopic', 'MemberFollowTopic@getMemberTopics');
  82. //关注话题列表
  83. $api->get('memberFollowTopic', 'MemberFollowTopic@index');
  84. //收藏列表
  85. $api->get('postCollect', 'PostCollectController@index');
  86. //用户发布数,收藏数,转发数
  87. $api->get('post/memberPostStatistics', 'PostController@memberPostStatistics');
  88. //关注feed流
  89. $api->get('feed', 'FeedController@index');
  90. //优秀居民信息获取
  91. $api->get('excellentResidents', 'BeanDetailController@excellentResidents');
  92. //排行榜
  93. $api->get('rankingList', 'BeanDetailController@rankingList');
  94. //星球首页
  95. $api->get('starHome', 'BeanDetailController@starHome');
  96. });
  97. //分享/邀请首页
  98. $api->get('starDetail', 'BeanDetailController@starDetail');
  99. });