feature: optimize ui and doc (#87)
* feat: add live api * feat: update jackson config * feat:update frontend resources
This commit is contained in:
parent
85826321b5
commit
89f215a775
|
@ -1,3 +1,5 @@
|
|||
    
|
||||
|
||||
## 简介
|
||||
|
||||
**Databasir** 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
package com.databasir.api;
|
||||
|
||||
import com.databasir.common.JsonData;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Controller
|
||||
public class IndexController {
|
||||
|
||||
@GetMapping("/live")
|
||||
@ResponseBody
|
||||
public JsonData<String> live() {
|
||||
return JsonData.ok("ok");
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
public String index() {
|
||||
return "index.html";
|
||||
|
|
|
@ -51,7 +51,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||
.antMatchers("/oauth2/apps", "/oauth2/authorization/*", "/oauth2/login/*")
|
||||
.permitAll()
|
||||
// 静态资源无需鉴权
|
||||
.antMatchers("/", "/*.html", "/js/**", "/css/**", "/img/**", "/*.ico")
|
||||
.antMatchers("/", "/*.html", "/js/**", "/css/**", "/img/**", "/*.ico", "/live")
|
||||
.permitAll()
|
||||
// api 请求需要授权
|
||||
.antMatchers("/api/**").authenticated()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.databasir.api.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
|
@ -41,6 +42,7 @@ public class WebConfig extends WebMvcConfigurerAdapter {
|
|||
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
|
||||
final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
return builder -> {
|
||||
builder.serializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
builder.simpleDateFormat(dateTimeFormat);
|
||||
builder.serializers(new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(dateTimeFormat)));
|
||||
builder.deserializers(new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(dateTimeFormat)));
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
server.port=8080
|
||||
logging.level.org.jooq=INFO
|
||||
spring.jooq.sql-dialect=mysql
|
||||
# flyway
|
||||
|
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.34b8254e.js"></script><script defer="defer" type="module" src="/js/app.db861658.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.ca7b1117.js" nomodule></script><script defer="defer" src="/js/app-legacy.f44ddca8.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.34b8254e.js"></script><script defer="defer" type="module" src="/js/app.eb91167e.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.ca7b1117.js" nomodule></script><script defer="defer" src="/js/app-legacy.9533bbab.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,6 +7,13 @@
|
|||
1. Docker
|
||||
2. Mysql
|
||||
|
||||
## 测活接口
|
||||
|
||||
```shell
|
||||
GET /live
|
||||
```
|
||||
返回 200 即表示启动成功
|
||||
|
||||
## 部署流程
|
||||
|
||||
1. 拉取最新版镜像,当然你也可以将 latest 替换成你想要得版本号,具体有哪些镜像版本可以拉取可以在[这里](https://registry.hub.docker.com/r/vrantt/databasir)查看
|
||||
|
|
|
@ -24,14 +24,6 @@ public class JdbcForeignKeyMetaRepository implements ForeignKeyMetaRepository {
|
|||
ResultSet keyResult = null;
|
||||
try {
|
||||
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()) {
|
||||
String fkTableName = keyResult.getString("FKTABLE_NAME");
|
||||
String fkColumnName = keyResult.getString("FKCOLUMN_NAME");
|
||||
|
|
Loading…
Reference in New Issue