-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new api endpoint and enable regular match creations
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/src/main/java/fi/sundae/bot/api/ActiveMatchesHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package fi.sundae.bot.api; | ||
|
||
import fi.sundae.bot.tournament.Matchmaker; | ||
import io.javalin.http.Context; | ||
import io.javalin.http.Handler; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class ActiveMatchesHandler implements Handler { | ||
|
||
private final Matchmaker MATCHMAKER; | ||
|
||
public ActiveMatchesHandler(Matchmaker matchmaker) { | ||
this.MATCHMAKER = matchmaker; | ||
} | ||
|
||
@Override | ||
public void handle(@NotNull Context ctx) throws Exception { | ||
ctx.json(MATCHMAKER.getActiveMatches()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters