Browse Source

feature: optimize ui and doc (#87)

* feat: add live api

* feat: update jackson config

* feat:update frontend resources
master
vran 3 years ago
committed by GitHub
parent
commit
89f215a775
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md
  2. 8
      api/src/main/java/com/databasir/api/IndexController.java
  3. 2
      api/src/main/java/com/databasir/api/config/SecurityConfig.java
  4. 2
      api/src/main/java/com/databasir/api/config/WebConfig.java
  5. 1
      api/src/main/resources/application-local.properties
  6. 0
      api/src/main/resources/static/css/342.9911c11a.css
  7. 2
      api/src/main/resources/static/index.html
  8. 1
      api/src/main/resources/static/js/146-legacy.ba4f1d2b.js.map
  9. 1
      api/src/main/resources/static/js/146.dc9458dc.js.map
  10. 6
      api/src/main/resources/static/js/342-legacy.f6565f05.js
  11. 1
      api/src/main/resources/static/js/342-legacy.f6565f05.js.map
  12. 6
      api/src/main/resources/static/js/342.ea3fd33f.js
  13. 1
      api/src/main/resources/static/js/342.ea3fd33f.js.map
  14. 2
      api/src/main/resources/static/js/492-legacy.4e70196c.js
  15. 2
      api/src/main/resources/static/js/492-legacy.4e70196c.js.map
  16. 2
      api/src/main/resources/static/js/492.3c92832b.js
  17. 2
      api/src/main/resources/static/js/492.3c92832b.js.map
  18. 2
      api/src/main/resources/static/js/513.eddf3feb.js
  19. 2
      api/src/main/resources/static/js/513.eddf3feb.js.map
  20. 2
      api/src/main/resources/static/js/564.d209a2a0.js
  21. 4
      api/src/main/resources/static/js/732-legacy.494cbbfc.js
  22. 2
      api/src/main/resources/static/js/732-legacy.494cbbfc.js.map
  23. 2
      api/src/main/resources/static/js/850-legacy.b484ff9b.js
  24. 1
      api/src/main/resources/static/js/850-legacy.b484ff9b.js.map
  25. 2
      api/src/main/resources/static/js/850.6048a74c.js
  26. 1
      api/src/main/resources/static/js/850.6048a74c.js.map
  27. 2
      api/src/main/resources/static/js/979-legacy.d00e6a4c.js
  28. 1
      api/src/main/resources/static/js/979-legacy.d00e6a4c.js.map
  29. 2
      api/src/main/resources/static/js/979.917cb604.js
  30. 1
      api/src/main/resources/static/js/979.917cb604.js.map
  31. 4
      api/src/main/resources/static/js/app-legacy.9533bbab.js
  32. 2
      api/src/main/resources/static/js/app-legacy.9533bbab.js.map
  33. 2
      api/src/main/resources/static/js/app.db861658.js
  34. 2
      api/src/main/resources/static/js/app.eb91167e.js
  35. 2
      api/src/main/resources/static/js/app.eb91167e.js.map
  36. 7
      docs/README/deploy/docker-deploy.md
  37. 8
      plugin/src/main/java/com/databasir/core/meta/repository/impl/jdbc/JdbcForeignKeyMetaRepository.java

2
README.md

@ -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** 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。

8
api/src/main/java/com/databasir/api/IndexController.java

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

2
api/src/main/java/com/databasir/api/config/SecurityConfig.java

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

2
api/src/main/java/com/databasir/api/config/WebConfig.java

@ -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
api/src/main/resources/application-local.properties

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

0
api/src/main/resources/static/css/146.9911c11a.css → api/src/main/resources/static/css/342.9911c11a.css

2
api/src/main/resources/static/index.html

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

1
api/src/main/resources/static/js/146-legacy.ba4f1d2b.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/146.dc9458dc.js.map

File diff suppressed because one or more lines are too long

6
api/src/main/resources/static/js/146-legacy.ba4f1d2b.js → api/src/main/resources/static/js/342-legacy.f6565f05.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/342-legacy.f6565f05.js.map

File diff suppressed because one or more lines are too long

6
api/src/main/resources/static/js/146.dc9458dc.js → api/src/main/resources/static/js/342.ea3fd33f.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/342.ea3fd33f.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/492-legacy.972f740c.js → api/src/main/resources/static/js/492-legacy.4e70196c.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/492-legacy.972f740c.js.map → api/src/main/resources/static/js/492-legacy.4e70196c.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/492.de54c0ea.js → api/src/main/resources/static/js/492.3c92832b.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/492.de54c0ea.js.map → api/src/main/resources/static/js/492.3c92832b.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/513.eddf3feb.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/564.d209a2a0.js.map → api/src/main/resources/static/js/513.eddf3feb.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/564.d209a2a0.js

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/117-legacy.5a8a817f.js → api/src/main/resources/static/js/732-legacy.494cbbfc.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/117-legacy.5a8a817f.js.map → api/src/main/resources/static/js/732-legacy.494cbbfc.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/850-legacy.b484ff9b.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/850-legacy.b484ff9b.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/850.6048a74c.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/850.6048a74c.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/979-legacy.d00e6a4c.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/979-legacy.d00e6a4c.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/979.917cb604.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/979.917cb604.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/app-legacy.f44ddca8.js → api/src/main/resources/static/js/app-legacy.9533bbab.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app-legacy.f44ddca8.js.map → api/src/main/resources/static/js/app-legacy.9533bbab.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app.db861658.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app.eb91167e.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app.db861658.js.map → api/src/main/resources/static/js/app.eb91167e.js.map

File diff suppressed because one or more lines are too long

7
docs/README/deploy/docker-deploy.md

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

8
plugin/src/main/java/com/databasir/core/meta/repository/impl/jdbc/JdbcForeignKeyMetaRepository.java

@ -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…
Cancel
Save