Browse Source
* feat: add schema_name * feat: support database, schema config * feat: add more detail info in databaseTypes * feat: add permission control to databaseType api * feat: update frontend resourcesmaster
vran
3 years ago
committed by
GitHub
65 changed files with 351 additions and 171 deletions
@ -1,23 +1,24 @@ |
|||
package com.databasir.api.validator; |
|||
|
|||
import com.databasir.core.domain.DomainErrors; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import static com.databasir.core.domain.DomainErrors.INVALID_DATABASE_TYPE_URL_PATTERN; |
|||
|
|||
@Component |
|||
public class DatabaseTypeValidator { |
|||
|
|||
public void isValidUrlPattern(String urlPattern) { |
|||
if (urlPattern == null) { |
|||
throw DomainErrors.INVALID_DATABASE_TYPE_URL_PATTERN.exception("url pattern 不能为空"); |
|||
throw INVALID_DATABASE_TYPE_URL_PATTERN.exception("url pattern 不能为空"); |
|||
} |
|||
if (!urlPattern.contains("{{jdbc.protocol}}")) { |
|||
throw DomainErrors.INVALID_DATABASE_TYPE_URL_PATTERN.exception("必须包含变量{{jdbc.protocol}}"); |
|||
throw INVALID_DATABASE_TYPE_URL_PATTERN.exception("必须包含变量{{jdbc.protocol}}"); |
|||
} |
|||
if (!urlPattern.contains("{{db.url}}")) { |
|||
throw DomainErrors.INVALID_DATABASE_TYPE_URL_PATTERN.exception("必须包含变量{{db.url}}不能为空"); |
|||
throw INVALID_DATABASE_TYPE_URL_PATTERN.exception("必须包含变量{{db.url}}不能为空"); |
|||
} |
|||
if (!urlPattern.contains("{{db.name}}")) { |
|||
throw DomainErrors.INVALID_DATABASE_TYPE_URL_PATTERN.exception("必须包含变量{{db.name}}不能为空"); |
|||
if (!urlPattern.contains("{{db.schema}}") && !urlPattern.contains("{{db.name}}")) { |
|||
throw INVALID_DATABASE_TYPE_URL_PATTERN.exception("{{db.schema}} 和 {{db.name}} 至少设置一个"); |
|||
} |
|||
} |
|||
} |
|||
|
@ -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-frontend</title><script defer="defer" type="module" src="/js/chunk-vendors.45746587.js"></script><script defer="defer" type="module" src="/js/app.21cfd672.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.54c3660b.js" nomodule></script><script defer="defer" src="/js/app-legacy.f867641a.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir-frontend 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-frontend</title><script defer="defer" type="module" src="/js/chunk-vendors.45746587.js"></script><script defer="defer" type="module" src="/js/app.a4b9bb20.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.54c3660b.js" nomodule></script><script defer="defer" src="/js/app-legacy.2527a373.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir-frontend 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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,15 @@ |
|||
package com.databasir.core.domain.database.data; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class DatabaseTypeSimpleResponse { |
|||
|
|||
private String databaseType; |
|||
|
|||
private String description; |
|||
|
|||
private String urlPattern; |
|||
|
|||
private String jdbcProtocol; |
|||
} |
Loading…
Reference in new issue