示例#1
0
$app->get($basePath . '/users/parade', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, 'parade');
    if ($errorMessage) {
        return Utils::formatErrorMessage(ERROR_BAD_MODEL, $errorMessage);
    } else {
        return $UsersController->parade($params);
    }
});
$app->post($basePath . '/users/parade/update', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, 'paradeUpdate');
    if ($errorMessage) {
        return Utils::formatErrorMessage(ERROR_BAD_MODEL, $errorMessage);
    } else {
        return $UsersController->paradeUpdate($params);
    }
});
$app->get($basePath . '/users/ftue', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, 'ftue');
    if ($errorMessage) {
        return Utils::formatErrorMessage(ERROR_BAD_MODEL, $errorMessage);
    } else {
        return $UsersController->ftue($params);
    }
});
$app->post($basePath . '/users/ftue/complet', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, 'ftueComplet');
    if ($errorMessage) {