api.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. $api->group(['namespace' => 'Post'], function ($api) {
  24. //发布内容
  25. $api->post('post', 'PostController@create');
  26. //内容列表
  27. $api->get('post', 'PostController@index');
  28. //内容详情
  29. $api->get('post/detail', 'PostController@detail');
  30. //推荐内容
  31. $api->put('post/suggest', 'PostController@suggest');
  32. //删除内容
  33. $api->delete('post/delete', 'PostController@delete');
  34. //隐藏内容
  35. $api->put('post/hide', 'PostController@hide');
  36. //增加数据
  37. $api->put('post/addData', 'PostController@addData');
  38. //评论列表
  39. $api->get('post/comment', 'PostController@commentList');
  40. //评论&回复
  41. $api->post('post/comment', 'PostController@comment');
  42. //删除评论
  43. $api->delete('post/comment/delete', 'PostController@commentDelete');
  44. //回收站列表
  45. $api->get('post/waste', 'PostController@waste');
  46. //回收站复原
  47. $api->put('post/waste', 'PostController@restore');
  48. //日志列表
  49. $api->get('post/log', 'PostController@log');
  50. });
  51. $api->group(['namespace' => 'Topic'], function ($api) {
  52. //新增话题分类
  53. $api->post('topic/categoryCreate', 'CategoryController@create');
  54. //话题分类列表
  55. $api->get('topic/categoryIndex', 'CategoryController@index');
  56. //话题分类详情
  57. $api->get('topic/categoryView', 'CategoryController@view');
  58. //推荐分类
  59. $api->put('topic/categoryIsSuggest', 'CategoryController@isSuggest');
  60. //编辑话题
  61. $api->put('topic/categoryEdit', 'CategoryController@edit');
  62. //新增话题
  63. $api->post('topic/topicCreate', 'TopicController@create');
  64. //编辑话题
  65. $api->put('topic/topicEdit', 'TopicController@edit');
  66. //列表
  67. $api->get('topic/topicIndex', 'TopicController@index');
  68. //详情
  69. $api->get('topic/topicView', 'TopicController@view');
  70. //开启话题
  71. $api->put('topic/topicIsOpen', 'TopicController@isOpen');
  72. //设置推荐 &热门话题
  73. $api->put('topic/topicSetStatus', 'TopicController@setStatus');
  74. });
  75. });
  76. //行为
  77. $api->group(['namespace' => 'Behavior'], function ($api) {
  78. //行为列表
  79. $api->get('behavior/list', 'BehaviorController@index');
  80. });
  81. });