2024-04-13 20:53:31 +01:00
|
|
|
package xyz.mcutils.backend.controller;
|
2024-04-13 15:34:19 +01:00
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.http.MediaType;
|
2024-04-13 17:40:03 +01:00
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
2024-04-13 15:34:19 +01:00
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
2024-04-13 16:42:21 +01:00
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
2024-04-13 15:34:19 +01:00
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
2024-04-13 20:53:31 +01:00
|
|
|
import xyz.mcutils.backend.model.cache.CachedEndpointStatus;
|
|
|
|
import xyz.mcutils.backend.service.MojangService;
|
2024-04-13 15:34:19 +01:00
|
|
|
|
|
|
|
@RestController
|
|
|
|
@Tag(name = "Mojang Controller", description = "The Mojang Controller is used to get information about the Mojang APIs.")
|
|
|
|
@RequestMapping(value = "/mojang/", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
public class MojangController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private MojangService mojangService;
|
|
|
|
|
2024-04-13 16:42:21 +01:00
|
|
|
@ResponseBody
|
2024-04-13 17:40:03 +01:00
|
|
|
@GetMapping(value = "/status")
|
2024-04-13 15:34:19 +01:00
|
|
|
public CachedEndpointStatus getStatus() {
|
|
|
|
return mojangService.getMojangApiStatus();
|
|
|
|
}
|
|
|
|
}
|