BuddhistController.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Laravel框架 [ Laravel ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 Laravel研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: wesmiler <12345678@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Http\Controllers\v1;
  12. use App\Http\Controllers\Api\BaseController;
  13. use App\Services\BuddhistCatesService;
  14. use App\Services\BuddhistPagesService;
  15. use App\Services\BuddhistService;
  16. /**
  17. * 佛经管理-控制器
  18. * @author wesmiler
  19. * @since 2020/11/11
  20. * Class BuddhistController
  21. * @package App\Http\Controllers
  22. */
  23. class BuddhistController extends BaseController
  24. {
  25. /**
  26. * 构造函数
  27. * @author wesmiler
  28. * @since 2020/11/11
  29. * BuddhistController constructor.
  30. */
  31. public function __construct()
  32. {
  33. parent::__construct();
  34. $this->service = new BuddhistService();
  35. $this->cateService = new BuddhistCatesService();
  36. $this->pageService = new BuddhistPagesService();
  37. }
  38. /**
  39. * 书单
  40. * @return array|mixed
  41. */
  42. public function index(){
  43. $params = request()->all();
  44. return $this->service->getDataList($params);
  45. }
  46. /**
  47. * 分类
  48. * @return array
  49. */
  50. public function cates(){
  51. return $this->cateService->getOptions();
  52. }
  53. /**
  54. * 获取章节内容
  55. */
  56. public function page(){
  57. $id = request()->get('id', 0);
  58. return $this->pageService->getNext($id);
  59. }
  60. }