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
37 changed files with 52 additions and 40 deletions

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