SignController.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. namespace App\Http\Controllers\User;
  3. use App\Http\Controllers\Controller;
  4. use App\Http\Controllers\Core\Auth;
  5. use App\Services\User\SignService;
  6. use Illuminate\Http\Request;
  7. /**
  8. * Class SignController
  9. * @package App\Http\Controllers\User
  10. */
  11. class SignController extends Controller
  12. {
  13. /**
  14. * 今日签到情况
  15. */
  16. public function today()
  17. {
  18. $uid = Auth::auth();
  19. $ss = new SignService();
  20. $data = $ss->today($uid);
  21. return response([
  22. 'code' => 200,
  23. 'message' => 'success',
  24. 'data' => $data
  25. ]);
  26. }
  27. /**
  28. * 签到
  29. * @throws \App\Exceptions\AlertException
  30. */
  31. public function sign(Request $request)
  32. {
  33. $uid = Auth::auth();
  34. $platform = $request->header('platform');
  35. $signService = new SignService();
  36. $signService->sign($uid, $platform);
  37. return response([
  38. 'code' => 200,
  39. 'message' => 'success'
  40. ]);
  41. }
  42. /**
  43. * 领取小花奖励
  44. * @throws \App\Exceptions\AlertException
  45. */
  46. public function rewardFlower()
  47. {
  48. $uid = Auth::auth();
  49. $signService = new SignService();
  50. $flower = $signService->rewardFlower($uid);
  51. return response([
  52. 'code' => 200,
  53. 'message' => 'success',
  54. 'data' => compact("flower")
  55. ]);
  56. }
  57. /**
  58. * 领取人气值奖励
  59. * @throws \App\Exceptions\AlertException
  60. */
  61. public function rewardPopularity()
  62. {
  63. $uid = Auth::auth();
  64. $signService = new SignService();
  65. $popularity = $signService->rewardPopularity($uid);
  66. return response([
  67. 'code' => 200,
  68. 'message' => 'success',
  69. 'data' => compact("popularity")
  70. ]);
  71. }
  72. /**
  73. * 领取解锁次数
  74. * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
  75. * @throws \App\Exceptions\AlertException
  76. * @throws \Tymon\JWTAuth\Exceptions\JWTException
  77. */
  78. public function rewardUnLookCard()
  79. {
  80. $uid = Auth::auth();
  81. $signService = new SignService();
  82. $signService->rewardUnLookCard($uid);
  83. return response([
  84. 'code' => 200,
  85. 'message' => 'OK'
  86. ]);
  87. }
  88. /**
  89. * 领取72h卡券满减券
  90. * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
  91. * @throws \App\Exceptions\AlertException
  92. * @throws \Tymon\JWTAuth\Exceptions\JWTException
  93. */
  94. public function rewardCouponSuperVip()
  95. {
  96. $uid = Auth::auth();
  97. $signService = new SignService();
  98. $couponSuperVip = $signService->rewardCouponSuperVip($uid);
  99. return response([
  100. 'code' => 200,
  101. 'message' => 'success',
  102. 'data' => compact("couponSuperVip")
  103. ]);
  104. }
  105. /**
  106. * 72小时折扣券
  107. * @throws \App\Exceptions\AlertException
  108. */
  109. public function rewardCoupon72Dis()
  110. {
  111. $uid = Auth::auth();
  112. $signService = new SignService();
  113. $coupon72dis = $signService->rewardCoupon72Dis($uid);
  114. return response([
  115. 'code' => 200,
  116. 'message' => 'success',
  117. 'data' => compact("coupon72dis")
  118. ]);
  119. }
  120. /**
  121. * 72h报名入场券
  122. * @throws \App\Exceptions\AlertException
  123. */
  124. public function rewardCoupon72Pair()
  125. {
  126. $uid = Auth::auth();
  127. $signService = new SignService();
  128. $coupon72pair = $signService->rewardCoupon72Pair($uid);
  129. return response([
  130. 'code' => 200,
  131. 'message' => 'success',
  132. 'data' => compact("coupon72pair")
  133. ]);
  134. }
  135. }