|
@@ -2,11 +2,15 @@ package org.dbsyncer.web.controller.index;
|
|
|
|
|
|
import org.dbsyncer.biz.ConnectorService;
|
|
import org.dbsyncer.biz.ConnectorService;
|
|
import org.dbsyncer.biz.MappingService;
|
|
import org.dbsyncer.biz.MappingService;
|
|
|
|
+import org.dbsyncer.biz.vo.RestResult;
|
|
|
|
+import org.dbsyncer.biz.vo.VersionVo;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
@@ -20,6 +24,12 @@ public class IndexController {
|
|
@Autowired
|
|
@Autowired
|
|
private MappingService mappingService;
|
|
private MappingService mappingService;
|
|
|
|
|
|
|
|
+ @Value(value = "${info.app.name}")
|
|
|
|
+ private String appName;
|
|
|
|
+
|
|
|
|
+ @Value(value = "${info.app.copyright}")
|
|
|
|
+ private String appCopyRight;
|
|
|
|
+
|
|
@GetMapping("")
|
|
@GetMapping("")
|
|
public String index(HttpServletRequest request, ModelMap model) {
|
|
public String index(HttpServletRequest request, ModelMap model) {
|
|
model.put("connectors", connectorService.getConnectorAll());
|
|
model.put("connectors", connectorService.getConnectorAll());
|
|
@@ -27,4 +37,10 @@ public class IndexController {
|
|
return "index/index.html";
|
|
return "index/index.html";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping("/version.json")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public RestResult version() {
|
|
|
|
+ return RestResult.restSuccess(new VersionVo(appName, appCopyRight));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|