add mojang api status endpoint
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 27s
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 27s
This commit is contained in:
23
src/main/java/cc/fascinated/controller/MojangController.java
Normal file
23
src/main/java/cc/fascinated/controller/MojangController.java
Normal 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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user