123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- namespace App\Http\Controllers\Share;
- use App\Http\Controllers\Controller;
- use App\Http\Controllers\Core\Auth;
- use App\Services\Share\GteamService;
- class GteamController extends Controller
- {
- /**
- * 检验邀请
- * @param int $invite_id
- * @return array
- * @throws \App\Exceptions\AlertException
- * @throws \Tymon\JWTAuth\Exceptions\JWTException
- */
- public function check(int $invite_id)
- {
- $uid = Auth::auth();
- $gs = new GteamService();
- $data = $gs->check($uid, $invite_id);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * vip邀请助力
- * @param int $invite_id
- * @return array
- * @throws \App\Exceptions\AlertException
- * @throws \Tymon\JWTAuth\Exceptions\JWTException
- */
- public function vipCheck(int $invite_id)
- {
- $uid = Auth::auth();
- $gs = new GteamService();
- $data = $gs->vipCheck($uid, $invite_id);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 获取助力的气泡
- * @param int $activity_id
- * @return array
- */
- public function lastInvite(int $activity_id)
- {
- $gs = new GteamService();
- $data = $gs->lastInvite($activity_id);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 获取最近的助力记录
- * @param int $invite_id
- * @return array
- */
- public function history(int $invite_id)
- {
- $gs = new GteamService();
- $data = $gs->history($invite_id);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 匹配成功率分享完成列表
- * @param Request $request
- * @return array
- * @throws \Tymon\JWTAuth\Exceptions\JWTException
- */
- public function succlist(Request $request)
- {
- $uid = Auth::auth();
- $page = $request->get('page') ?? 1;
- $pages = array(
- 'limit' => 20,
- 'page' => $page
- );
- $gs = new GteamService();
- $data = $gs->succlist($uid, $pages);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- }
|