From e97642c88916d3a210f8643840ac60f66c7fd843 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Sun, 7 Apr 2024 23:44:28 -0400 Subject: [PATCH] Update docs --- .../me/braydon/mc/controller/ServerController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/braydon/mc/controller/ServerController.java b/src/main/java/me/braydon/mc/controller/ServerController.java index 2cb59a5..673cfc1 100644 --- a/src/main/java/me/braydon/mc/controller/ServerController.java +++ b/src/main/java/me/braydon/mc/controller/ServerController.java @@ -678,6 +678,9 @@ package me.braydon.mc.controller; import lombok.NonNull; import lombok.extern.log4j.Log4j2; +import me.braydon.mc.exception.impl.BadRequestException; +import me.braydon.mc.exception.impl.InvalidMinecraftServerPlatform; +import me.braydon.mc.exception.impl.ResourceNotFoundException; import me.braydon.mc.model.MinecraftServer; import me.braydon.mc.model.cache.CachedMinecraftServer; import me.braydon.mc.service.MojangService; @@ -712,10 +715,15 @@ public final class ServerController { * @param platform the platform of the server * @param hostname the hostname of the server * @return the server + * @throws BadRequestException if the hostname is unknown + * @throws InvalidMinecraftServerPlatform if the platform is invalid + * @throws ResourceNotFoundException if the server isn't found */ @GetMapping("/{platform}/{hostname}") @ResponseBody - public ResponseEntity getServer(@PathVariable @NonNull String platform, @PathVariable @NonNull String hostname) { + public ResponseEntity getServer(@PathVariable @NonNull String platform,@PathVariable @NonNull String hostname) + throws BadRequestException, InvalidMinecraftServerPlatform, ResourceNotFoundException + { return ResponseEntity.ofNullable(mojangService.getMinecraftServer(platform, hostname)); }