api.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. //重置话题redis
  53. $api->put('topic/resetRedis', 'TopicController@resetRedis');
  54. //新增话题分类
  55. $api->post('topic/categoryCreate', 'CategoryController@create');
  56. //话题分类列表
  57. $api->get('topic/categoryIndex', 'CategoryController@index');
  58. //话题分类详情
  59. $api->get('topic/categoryView', 'CategoryController@view');
  60. //推荐分类
  61. $api->put('topic/categoryIsSuggest', 'CategoryController@isSuggest');
  62. //编辑话题
  63. $api->put('topic/categoryEdit', 'CategoryController@edit');
  64. //新增话题
  65. $api->post('topic/topicCreate', 'TopicController@create');
  66. //编辑话题
  67. $api->put('topic/topicEdit', 'TopicController@edit');
  68. //列表
  69. $api->get('topic/topicIndex', 'TopicController@index');
  70. //详情
  71. $api->get('topic/topicView', 'TopicController@view');
  72. //开启话题
  73. $api->put('topic/topicIsOpen', 'TopicController@isOpen');
  74. //设置推荐 &热门话题
  75. $api->put('topic/topicSetStatus', 'TopicController@setStatus');
  76. //获取多个话题
  77. $api->get('topic/getTopic', 'TopicController@getTopic');
  78. });
  79. //行为
  80. $api->group(['namespace' => 'Behavior'], function ($api) {
  81. //行为列表
  82. $api->get('behavior/list', 'BehaviorController@index');
  83. //登记/注册行为
  84. $api->post('behavior/create', 'BehaviorController@create');
  85. //编辑行为
  86. $api->put('behavior/edit', 'BehaviorController@edit');
  87. //列表修改行为状态(行为管理)
  88. $api->post('behavior/editStatus', 'BehaviorController@editStatus');
  89. //行为数据列表
  90. $api->get('behavior/behaviorData', 'BehaviorController@behaviorData');
  91. //行为日志列表
  92. $api->get('behavior/log', 'LogController@index');
  93. //用户注册账单列表
  94. $api->get('registeredRecord/list', 'RegisteredRecordController@index');
  95. //评论账本列表
  96. $api->get('CommentRecord/list', 'CommentRecordController@index');
  97. //发布账本列表
  98. $api->get('ReleaseRecord/list', 'ReleaseRecordController@index');
  99. //阅读/分享/收藏等普通行为账单
  100. $api->get('generalRecord/list', 'GeneralRecordController@index');
  101. });
  102. });
  103. });