This commit is contained in:
Lee 2024-07-30 22:00:07 +01:00
parent b7834ab389
commit 2e326bb7be

View File

@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
import xyz.mcutils.backend.model.cache.CachedEndpointStatus; import xyz.mcutils.backend.model.cache.CachedEndpointStatus;
import xyz.mcutils.backend.service.MojangService; import xyz.mcutils.backend.service.MojangService;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@RestController @RestController
@ -27,6 +28,6 @@ public class MojangController {
public ResponseEntity<?> getStatus() { public ResponseEntity<?> getStatus() {
return ResponseEntity.ok() return ResponseEntity.ok()
.cacheControl(CacheControl.maxAge(1, TimeUnit.MINUTES).cachePublic()) .cacheControl(CacheControl.maxAge(1, TimeUnit.MINUTES).cachePublic())
.body(mojangService.getMojangServerStatus()); .body(Map.of("endpoints", mojangService.getMojangServerStatus()));
} }
} }