ArticleCategoryController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Services\Common\ArticleCategoryService;
  4. /**
  5. * 文章分类控制器
  6. */
  7. class ArticleCategoryController extends Backend
  8. {
  9. public function __construct()
  10. {
  11. parent::__construct();
  12. $this->service = new ArticleCategoryService();
  13. }
  14. /**
  15. * 列表
  16. */
  17. public function index()
  18. {
  19. $params = request()->all();
  20. $pageSize = isset($params['limit']) ? intval($params['limit']) : PERPAGE;
  21. return $this->service->getDataList($params, $pageSize);
  22. }
  23. /**
  24. * 添加/编辑
  25. */
  26. public function edit()
  27. {
  28. return $this->service->edit();
  29. }
  30. /**
  31. * 删除
  32. */
  33. public function delete()
  34. {
  35. return $this->service->delete();
  36. }
  37. /**
  38. * 修改状态
  39. */
  40. public function status()
  41. {
  42. return $this->service->status();
  43. }
  44. /**
  45. * 获取分类选项
  46. */
  47. public function options()
  48. {
  49. $list = $this->service->options();
  50. return ['code' => 0, 'data' => $list];
  51. }
  52. }