add mojang api status endpoint
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 27s

This commit is contained in:
Lee
2024-04-13 15:34:19 +01:00
parent 0c8f769ee7
commit 811ea348cf
10 changed files with 205 additions and 21 deletions

View File

@ -0,0 +1,23 @@
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();
}
}