diff --git a/src/Requests/EventRequest.php b/src/Requests/EventRequest.php index af9f912..8a75398 100644 --- a/src/Requests/EventRequest.php +++ b/src/Requests/EventRequest.php @@ -27,6 +27,6 @@ public function getParams(): array final public function getMethod(): string { - return 'GetEvent'; + return 'events/' . $this->eventId; } } diff --git a/src/Requests/ParticipantsRequest.php b/src/Requests/ParticipantsRequest.php new file mode 100644 index 0000000..ebbc39e --- /dev/null +++ b/src/Requests/ParticipantsRequest.php @@ -0,0 +1,32 @@ +eventId = $eventId; + } + + public function getMethod(): string + { + return 'events/' . $this->eventId . '/participants'; + } + + public function getParams(): array + { + return [ + 'eventId' => $this->eventId, + ]; + } + + public function getCacheKey(): string + { + return sprintf('participant-list.%d', $this->eventId); + } +} diff --git a/src/Requests/StatsRequest.php b/src/Requests/StatsRequest.php index d884d04..4fbf24e 100644 --- a/src/Requests/StatsRequest.php +++ b/src/Requests/StatsRequest.php @@ -17,7 +17,7 @@ public function __construct(int $contestId, int $year) public function getMethod(): string { - return 'GetStats'; + return 'contests/' . $this->contestId . '/years/' . $this->year . '/stats'; } public function getParams(): array @@ -30,6 +30,6 @@ public function getParams(): array public function getCacheKey(): string { - return sprintf('task.stats.%s.%s', $this->contestId, $this->year); + return sprintf('task-stats.%s.%s', $this->contestId, $this->year); } } diff --git a/src/Requests/TeamsRequest.php b/src/Requests/TeamsRequest.php new file mode 100644 index 0000000..2fed2b9 --- /dev/null +++ b/src/Requests/TeamsRequest.php @@ -0,0 +1,32 @@ +eventId = $eventId; + } + + public function getMethod(): string + { + return 'events/' . $this->eventId . '/teams'; + } + + public function getParams(): array + { + return [ + 'eventId' => $this->eventId, + ]; + } + + public function getCacheKey(): string + { + return sprintf('team-list.%d', $this->eventId); + } +}