}); $app->group('/user', function () use($app) { $app->get('/level', function () { if (accessIsOK()) { $request = \Slim\Slim::getInstance()->request(); $userAuth = json_decode($request->headers->get('Authorization')); $profileService = new ProfileService(); echo json_encode($profileService->getUserLevel($userAuth->id)); } }); $app->get('/score', function () { if (accessIsOK()) { $request = \Slim\Slim::getInstance()->request(); $userAuth = json_decode($request->headers->get('Authorization')); $profileService = new ProfileService(); echo json_encode($profileService->getTotalScore($userAuth->id)); } }); $app->get('/maxlevel', function () { if (accessIsOK()) { $profileService = new ProfileService(); echo json_encode($profileService->getMaxLevel()); } }); }); $app->get('/activities', function () { if (accessIsOK()) { $request = \Slim\Slim::getInstance()->request(); $userAuth = json_decode($request->headers->get('Authorization')); $activityService = new ActivityLogService(); echo json_encode($activityService->findAll($userAuth->id));