Files
Backend/src/main/java/cc/fascinated/controller/MojangController.java
Liam 811ea348cf
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 27s
add mojang api status endpoint
2024-04-13 15:34:19 +01:00

24 lines
867 B
Java

package cc.fascinated.controller;
import cc.fascinated.model.cache.CachedEndpointStatus;
import cc.fascinated.service.MojangService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@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;
@RequestMapping(value = "/status")
public CachedEndpointStatus getStatus() {
return mojangService.getMojangApiStatus();
}
}