feature: optimize ui and doc (#87)

* feat: add live api

* feat: update jackson config

* feat:update frontend resources
This commit is contained in:
vran 2022-04-12 18:56:38 +08:00 committed by GitHub
parent 85826321b5
commit 89f215a775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 52 additions and 40 deletions

View File

@ -1,3 +1,5 @@
![release-version](https://img.shields.io/github/v/release/vran-dev/databasir?include_prereleases&style=for-the-badge) ![downloads](https://img.shields.io/github/downloads/vran-dev/databasir/total?style=for-the-badge) ![language](https://img.shields.io/github/languages/top/vran-dev/databasir?style=for-the-badge) ![licence](https://img.shields.io/github/license/vran-dev/databasir?style=for-the-badge) ![stars](https://img.shields.io/github/stars/vran-dev/databasir?style=for-the-badge)
## 简介
**Databasir** 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。

View File

@ -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";

View File

@ -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()

View File

@ -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)));

View File

@ -1,3 +1,4 @@
server.port=8080
logging.level.org.jooq=INFO
spring.jooq.sql-dialect=mysql
# flyway

View File

@ -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

View File

@ -7,6 +7,13 @@
1. Docker
2. Mysql
## 测活接口
```shell
GET /live
```
返回 200 即表示启动成功
## 部署流程
1. 拉取最新版镜像,当然你也可以将 latest 替换成你想要得版本号,具体有哪些镜像版本可以拉取可以在[这里](https://registry.hub.docker.com/r/vrantt/databasir)查看

View File

@ -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");