Select Git revision
RootController.java
-
Jan Zickermann authoredJan Zickermann authored
RootController.java 840 B
package de.ozgcloud.admin;
import org.springframework.boot.info.BuildProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.RequiredArgsConstructor;
@RestController
@RequiredArgsConstructor
@RequestMapping(RootController.PATH)
public class RootController {
static final String PATH = "/api"; // NOSONAR
private final BuildProperties buildProperties;
@GetMapping
public Root getRoot() {
return buildRoot();
}
private Root buildRoot() {
return Root.builder()
.javaVersion(System.getProperty("java.version"))
.buildTime(buildProperties.getTime())
.buildVersion(buildProperties.getVersion())
.buildNumber(buildProperties.get("number"))
.build();
}
}