$requests = new Requests($db, $user); $response = $requests->vote($params[1], (int) $postdata["reward"]); httpResponse($response); break; case validateRoute('GET', 'mailbox'): $mailbox = new Mailbox($db, $user); list($result, $totalCount) = $mailbox->query((int) $_GET["location"] ?: 0, (int) $_GET["limit"] ?: 10, (int) $_GET["index"] ?: 0); httpResponse($result, $totalCount); break; case validateRoute('PATCH', 'mailbox/\\d+'): $mailbox = new Mailbox($db, $user); httpResponse($mailbox->update((int) $params[1], $postdata)); break; case validateRoute('POST', 'mailbox'): $mailbox = new Mailbox($db, $user); httpResponse($mailbox->create($postdata)); break; case validateRoute('DELETE', 'mailbox/\\d+'): $mailbox = new Mailbox($db, $user); httpResponse($mailbox->delete((int) $params[1])); break; case validateRoute('GET', 'moviedata/\\d+'): $movieData = new MovieData($db); httpResponse($movieData->getData($params[1])); break; case validateRoute('GET', 'moviedata/\\d+/refresh'): $movieData = new MovieData($db); httpResponse($movieData->updateImdbInfo($params[1])); break; case validateRoute('GET', 'moviedata/search'): $movieData = new MovieData($db);