コード例 #1
0
});
$app->get('/validateemail/:email', function ($email) {
    $authService = new AuthenticationService();
    echo json_encode($authService->validateEmail($email));
});
$app->post('/signin', function () {
    $request = \Slim\Slim::getInstance()->request();
    $user = json_decode($request->getBody());
    $authService = new AuthenticationService();
    echo json_encode($authService->signIn($user));
});
$app->post('/signup', function () {
    $request = \Slim\Slim::getInstance()->request();
    $user = json_decode($request->getBody());
    $authService = new AuthenticationService();
    echo json_encode($authService->signUp($user));
});
$app->get('/avatar', function () {
    if (accessIsOK()) {
        $request = \Slim\Slim::getInstance()->request();
        $userAuth = json_decode($request->headers->get('Authorization'));
        $avatarService = new AvatarService();
        echo json_encode($avatarService->recover($userAuth->id));
    }
});
$app->post('/avatar', function () {
    if (accessIsOK()) {
        $request = \Slim\Slim::getInstance()->request();
        $userAuth = json_decode($request->headers->get('Authorization'));
        $avatar = json_decode($request->getBody());
        $avatarService = new AvatarService();