EnshrineController.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. namespace App\Http\Controllers\Api\v1;
  3. use App\Http\Controllers\Api\BaseController;
  4. use App\Http\Validator\EnshrineNoticeValidator;
  5. use App\Http\Validator\EnshrineValidator;
  6. use App\Services\EnshrineNoticeService;
  7. use App\Services\EnshrineService;
  8. use Illuminate\Http\Request;
  9. /**
  10. * 供奉控制器类
  11. * @author wesmiler
  12. * @since 2020/11/10
  13. * Class EnshrineController
  14. * @package App\Http\Controllers
  15. */
  16. class EnshrineController extends BaseController
  17. {
  18. /**
  19. * 构造函数
  20. * @author wesmiler
  21. * @since 2020/11/11
  22. * EnshrineController constructor.
  23. */
  24. public function __construct()
  25. {
  26. parent::__construct();
  27. $this->service = new EnshrineService();
  28. $this->noticeService = new EnshrineNoticeService();
  29. }
  30. /**
  31. * 供奉记录
  32. * @return array
  33. */
  34. public function index(){
  35. return $this->service->getDataList($this->userId);
  36. }
  37. /**
  38. * 供奉物品
  39. * @return array
  40. */
  41. public function goods(){
  42. return $this->service->goods();
  43. }
  44. /**
  45. * 选择佛像
  46. * @return mixed
  47. */
  48. public function select(){
  49. return $this->service->select($this->userId);
  50. }
  51. /**
  52. * 送圣
  53. * @return array
  54. */
  55. public function packoff(){
  56. return $this->service->packoff($this->userId);
  57. }
  58. /**
  59. * 超度牌位
  60. * @return mixed
  61. */
  62. public function chaodu(Request $request, EnshrineValidator $validator){
  63. $params = $validator->check($request->all(),'chaodu');
  64. if(!is_array($params)){
  65. return message($params, false);
  66. }
  67. return $this->service->chaodu($this->userId);
  68. }
  69. /**
  70. * 保存供奉操作记录
  71. * @return array
  72. */
  73. public function actionRecord(){
  74. return $this->service->actionRecord($this->userId);
  75. }
  76. /**
  77. * 供奉操作记录
  78. * @return array
  79. */
  80. public function xinyuan(){
  81. return $this->service->actionList($this->userId);
  82. }
  83. /**
  84. * 供奉操作记录处理
  85. * @return array
  86. */
  87. public function catchXuyuan(){
  88. return $this->service->catchXuyuan($this->userId);
  89. }
  90. /**
  91. * 购买物品
  92. * @return array
  93. */
  94. public function buy(){
  95. return $this->service->buy($this->userId);
  96. }
  97. /**
  98. * 贡品购买记录
  99. * @return array
  100. */
  101. public function orderList(){
  102. return $this->service->orderList($this->userId);
  103. }
  104. /**
  105. * 发布忏悔/回向记录
  106. * @return mixed
  107. */
  108. public function noticePublish(Request $request, EnshrineNoticeValidator $validator){
  109. $params = $validator->check($request->all(),'publish');
  110. if(!is_array($params)){
  111. return message($params, false);
  112. }
  113. return $this->noticeService->publish($this->userId);
  114. }
  115. /**
  116. * 忏悔回向记录
  117. * @return mixed
  118. */
  119. public function notice(){
  120. return $this->noticeService->getDataList($this->userId);
  121. }
  122. /**
  123. * 忏悔回向记录删除
  124. * @return mixed
  125. */
  126. public function noticeDel(){
  127. return $this->noticeService->del($this->userId);
  128. }
  129. }