api.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. //登录+验签
  19. $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
  20. $api->post('post', 'PostController@create');
  21. $api->get('post', 'PostController@index');
  22. $api->get('post/detail', 'PostController@detail');
  23. $api->get('post/suggest', 'PostController@suggestPost');
  24. $api->post('post/comment', 'PostController@comment');
  25. $api->get('post/comment', 'PostController@commentList');
  26. $api->get('post/reply', 'PostController@replyList');
  27. $api->get('topicCategory', 'CategoryController@index');
  28. $api->get('topicCategory/getTopics', 'CategoryController@getTopics');
  29. $api->get('post/topic', 'PostController@topicPost');
  30. $api->get('topic/detail', 'PostController@topicDetail');
  31. //关注推荐话题
  32. $api->post('memberFollowTopic', 'MemberFollowTopic@memberFollowTopic');
  33. //关注话题
  34. $api->post('memberFollowTopic/follow', 'MemberFollowTopic@followTopic');
  35. //取消关注
  36. $api->delete('memberFollowTopic/cancel', 'MemberFollowTopic@cancelFollowTopic');
  37. //关注话题列表
  38. $api->get('memberFollowTopic', 'MemberFollowTopic@index');
  39. });
  40. });