示例#1
0
})->add($auth);
$app->put('/groups', function ($request, $response, $args) {
    $member = new \Models\Group();
    $response->write($member->updateGroupDetails($request->getParsedBody(), \Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);
$app->get('/users', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->getDetailsMembersInGroups(\Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);
$app->get('/user/{uid}/details', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->getMemberDetails($args['uid'], \Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);
$app->put('/user/{uid}/details', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->updateMemberDetails($args['uid'], $request->getParsedBody(), \Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);
$app->put('/user/{uid}/pass', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->updatePassword($args['uid'], $request->getParsedBody(), \Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);