FoxiangController.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. /**
  52. * 供奉记录
  53. * @return array
  54. */
  55. public function enshrineList(){
  56. return $this->service->getEnshrineList($this->userId);
  57. }
  58. /**
  59. * 送圣
  60. * @return array
  61. */
  62. public function packoff(){
  63. return $this->service->packoff($this->userId);
  64. }
  65. }