private function processPingAction() { $sessionId = $this->equipmentLogRepository->findActiveUserSession($this->user->id, $this->deviceKey); if ($sessionId !== false) { $this->equipmentLogRepository->recordActivity($sessionId); } else { //We don't have an active session, there could have been a network failure so start now $this->equipmentLogRepository->recordStartCloseExisting($this->user->id, $this->keyFob->id, $this->deviceKey, 'inaccurate start'); } }
/** * Update an ongoing activity * * @return \Illuminate\Http\Response * * @SWG\Put( * path="/acs/activity/{activityId}", * tags={"activity"}, * description="Record a heartbeat message for a period of activity, used to ensure activity periods are correctly recorded", * @SWG\Parameter(name="activityId", in="path", type="string", required=true), * @SWG\Response(response="200", description="Activity Heartbeat recorded"), * security={{"api_key": {}}} * ) */ public function update(Request $request, $activityId) { $keyFob = $this->fobAccess->extendedKeyFobLookup($request->get('tagId')); $this->equipmentLogRepository->recordActivity($activityId); return response()->json([], 200); }