FoxiangController.php 1.2 KB

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