增加版本信息

This commit is contained in:
zhou-hao 2020-06-23 14:08:38 +08:00
parent eb9a002f6f
commit 5a81d815c0
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,13 @@
package org.jetlinks.community;
import lombok.Getter;
@Getter
public class Version {
public static Version current = new Version();
private final String edition = "community";
private final String version = "1.3.0-SNAPSHOT";
}

View File

@ -0,0 +1,20 @@
package org.jetlinks.community.standalone.web;
import org.hswebframework.web.authorization.annotation.Authorize;
import org.jetlinks.community.Version;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
@RequestMapping("/system")
@RestController
public class SystemInfoController {
@GetMapping("/version")
@Authorize(ignore = true)
public Mono<Version> getVersion() {
return Mono.just(Version.current);
}
}