LockController.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace App\Http\Controllers\Share;
  3. use App\Http\Controllers\Controller;
  4. use App\Http\Controllers\Core\Auth;
  5. use App\Services\Share\LockService;
  6. use Illuminate\Http\Request;
  7. class LockController extends Controller
  8. {
  9. public function succlist(Request $request)
  10. {
  11. $uid = Auth::auth();
  12. $page = $request->get('page') ?? 1;
  13. $pages = array(
  14. 'limit' => 20,
  15. 'page' => $page
  16. );
  17. $ls = new LockService();
  18. $data = $ls->succlist($uid, $pages);
  19. return array(
  20. 'code' => 200,
  21. 'message' => 'success',
  22. 'data' => $data
  23. );
  24. }
  25. public function faillist(Request $request)
  26. {
  27. $uid = Auth::auth();
  28. $page = $request->get('page') ?? 1;
  29. $pages = array(
  30. 'limit' => 20,
  31. 'page' => $page
  32. );
  33. $ls = new LockService();
  34. $data = $ls->faillist($uid, $pages);
  35. return array(
  36. 'code' => 200,
  37. 'message' => 'success',
  38. 'data' => $data
  39. );
  40. }
  41. /**
  42. * 创建解锁卡片分享链接
  43. * @param int $partner_id
  44. * @return array
  45. * @throws \App\Exceptions\AlertException
  46. * @throws \App\Exceptions\DBException
  47. * @throws \Tymon\JWTAuth\Exceptions\JWTException
  48. */
  49. public function store(int $partner_id)
  50. {
  51. $uid = Auth::auth();
  52. $ls = new LockService();
  53. $data = $ls->store($uid, $partner_id);
  54. return array(
  55. 'code' => 200,
  56. 'message' => 'success',
  57. 'data' => [
  58. 'list_id' => $data['id']
  59. ]
  60. );
  61. }
  62. }