feat: add live api
This commit is contained in:
parent
85826321b5
commit
e24e710255
|
@ -1,3 +1,5 @@
|
||||||
|
    
|
||||||
|
|
||||||
## 简介
|
## 简介
|
||||||
|
|
||||||
**Databasir** 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。
|
**Databasir** 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。
|
||||||
|
|
|
@ -1,13 +1,21 @@
|
||||||
package com.databasir.api;
|
package com.databasir.api;
|
||||||
|
|
||||||
|
import com.databasir.common.JsonData;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class IndexController {
|
public class IndexController {
|
||||||
|
|
||||||
|
@GetMapping("/live")
|
||||||
|
@ResponseBody
|
||||||
|
public JsonData<String> live() {
|
||||||
|
return JsonData.ok("ok");
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
public String index() {
|
public String index() {
|
||||||
return "index.html";
|
return "index.html";
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
server.port=8080
|
||||||
logging.level.org.jooq=INFO
|
logging.level.org.jooq=INFO
|
||||||
spring.jooq.sql-dialect=mysql
|
spring.jooq.sql-dialect=mysql
|
||||||
# flyway
|
# flyway
|
||||||
|
|
|
@ -24,14 +24,6 @@ public class JdbcForeignKeyMetaRepository implements ForeignKeyMetaRepository {
|
||||||
ResultSet keyResult = null;
|
ResultSet keyResult = null;
|
||||||
try {
|
try {
|
||||||
keyResult = connection.getMetaData().getImportedKeys(databaseName, schemaName, tableName);
|
keyResult = connection.getMetaData().getImportedKeys(databaseName, schemaName, tableName);
|
||||||
} catch (SQLException e) {
|
|
||||||
log.warn("warn: ignore foreign keys in " + databaseName + "." + tableName + ", " + e.getMessage());
|
|
||||||
return foreignKeys;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
keyResult = connection.getMetaData()
|
|
||||||
.getImportedKeys(databaseName, schemaName, tableName);
|
|
||||||
while (keyResult.next()) {
|
while (keyResult.next()) {
|
||||||
String fkTableName = keyResult.getString("FKTABLE_NAME");
|
String fkTableName = keyResult.getString("FKTABLE_NAME");
|
||||||
String fkColumnName = keyResult.getString("FKCOLUMN_NAME");
|
String fkColumnName = keyResult.getString("FKCOLUMN_NAME");
|
||||||
|
|
Loading…
Reference in New Issue