feat(tournament): remove dynamic server add/remove endpoints
Build & Test (NowChessSystems) TeamCity build failed
Build & Test (NowChessSystems) TeamCity build failed
Servers are now configured via TOURNAMENT_EXTERNAL_SERVERS env var.
POST /api/tournament/servers and DELETE /api/tournament/servers/{id}
are removed; only GET (list) remains for the bot's fetchRemoteServers call.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
-1
@@ -33,7 +33,6 @@ import io.quarkus.runtime.annotations.RegisterForReflection
|
||||
classOf[CoreGameResponse],
|
||||
classOf[GameWritebackEventDto],
|
||||
classOf[ExternalTournamentServer],
|
||||
classOf[RegisterServerRequest],
|
||||
classOf[ExternalTournamentServerList],
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package de.nowchess.tournament.dto
|
||||
|
||||
case class ExternalTournamentServer(id: String, label: String, url: String)
|
||||
case class RegisterServerRequest(label: String, url: String)
|
||||
case class ExternalTournamentServerList(servers: List[ExternalTournamentServer])
|
||||
|
||||
+1
-11
@@ -1,6 +1,6 @@
|
||||
package de.nowchess.tournament.resource
|
||||
|
||||
import de.nowchess.tournament.dto.{ErrorDto, ExternalTournamentServerList, RegisterServerRequest}
|
||||
import de.nowchess.tournament.dto.ExternalTournamentServerList
|
||||
import de.nowchess.tournament.service.TournamentServerRegistry
|
||||
import jakarta.annotation.security.RolesAllowed
|
||||
import jakarta.enterprise.context.ApplicationScoped
|
||||
@@ -23,13 +23,3 @@ class TournamentServerResource:
|
||||
@GET
|
||||
def list(): Response =
|
||||
Response.ok(ExternalTournamentServerList(registry.list())).build()
|
||||
|
||||
@POST
|
||||
def register(req: RegisterServerRequest): Response =
|
||||
Response.status(201).entity(registry.register(req.label, req.url)).build()
|
||||
|
||||
@DELETE
|
||||
@Path("/{id}")
|
||||
def remove(@PathParam("id") id: String): Response =
|
||||
if registry.remove(id) then Response.noContent().build()
|
||||
else Response.status(Response.Status.NOT_FOUND).entity(ErrorDto(s"Server $id not found")).build()
|
||||
|
||||
Reference in New Issue
Block a user