api.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. //新增话题分类
  52. $api->post('categoryCreate', 'CategoryController@create');
  53. //话题分类列表
  54. $api->get('categoryIndex', 'CategoryController@index');
  55. //话题分类详情
  56. $api->get('categoryView', 'CategoryController@view');
  57. //推荐分类
  58. $api->put('categoryIsSuggest', 'CategoryController@isSuggest');
  59. //编辑话题
  60. $api->put('categoryEdit', 'CategoryController@edit');
  61. //新增话题
  62. $api->post('topicCreate', 'TopicController@create');
  63. //列表
  64. $api->get('topicIndex', 'TopicController@index');
  65. });
  66. });