oparl-service/oparl-server/src/main/java/de/twomartens/oparlservice/control/OParlController.java

46 lines
1.8 KiB
Java
Raw Normal View History

2020-07-08 00:06:57 +02:00
package de.twomartens.oparlservice.control;
import de.twomartens.oparlservice.configs.OParlServiceProperties;
import de.twomartens.oparlservice.entity.System;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.time.ZonedDateTime;
@Slf4j
@RestController
@RequestMapping(path = "/oparl")
public class OParlController {
private final OParlServiceProperties properties;
OParlController(OParlServiceProperties properties) {
this.properties = properties;
}
@GetMapping("system/v1.1")
@Operation(summary = "System information", description = "returns information about the OParl system")
@ResponseBody
public System system() {
log.info("method invoked /oparl/system/v1.1");
return System.builder()
.id(properties.getTemplate().getUrl() + "/oparl/system/v1.1")
.type("https://schema.oparl.org/1.1/System")
.license("https://www.govdata.de/dl-de/by-2-0")
.created(ZonedDateTime.now())
.modified(ZonedDateTime.now())
.oparlVersion("https://schema.oparl.org/1.1/")
.name("OParl interface for ALLRIS of Hamburg Eimsbüttel")
.contactEmail("github@2martens.de")
.contactName("Jim Martens")
.website("https://sitzungsdienst-eimsbuettel.hamburg.de/bi/")
.vendor("https://2martens.de")
.product("https://git.2martens.de/2martens/oparl-service")
.body(properties.getTemplate().getUrl() + "/oparl/listBodies/v1.1")
.build();
}
}