FoxiangController.php 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Http\Controllers\Api\v1;
  3. use App\Http\Controllers\Api\BaseController;
  4. use App\Services\FoxiangCatesService;
  5. use App\Services\FoxiangService;
  6. use Illuminate\Http\Request;
  7. /**
  8. * 佛像控制器类
  9. * @author wesmiler
  10. * @since 2020/11/10
  11. * Class FoxiangController
  12. * @package App\Http\Controllers
  13. */
  14. class FoxiangController extends BaseController
  15. {
  16. /**
  17. * 构造函数
  18. * @author wesmiler
  19. * @since 2020/11/11
  20. * FoxiangController constructor.
  21. */
  22. public function __construct()
  23. {
  24. parent::__construct();
  25. $this->service = new FoxiangService();
  26. $this->cateService = new FoxiangCatesService();
  27. }
  28. /**
  29. * 列表
  30. * @return array
  31. */
  32. public function index(){
  33. $params = request()->all();
  34. return $this->service->getDataList($params);
  35. }
  36. /**
  37. * 获取分类
  38. * @return mixed
  39. */
  40. public function cates(){
  41. return $this->cateService->getOptions();
  42. }
  43. }