mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-10-28 04:57:17 +08:00
chore: 优化部分代码
This commit is contained in:
@@ -85,7 +85,7 @@ public class GeneratorServiceImpl implements GeneratorService {
|
|||||||
List<Table> tableList = MetaUtils.getTables(dataSource);
|
List<Table> tableList = MetaUtils.getTables(dataSource);
|
||||||
String tableName = query.getTableName();
|
String tableName = query.getTableName();
|
||||||
if (StrUtil.isNotBlank(tableName)) {
|
if (StrUtil.isNotBlank(tableName)) {
|
||||||
tableList.removeIf(table -> !StrUtil.containsAny(table.getTableName(), tableName));
|
tableList.removeIf(table -> !StrUtil.containsAnyIgnoreCase(table.getTableName(), tableName));
|
||||||
}
|
}
|
||||||
tableList.removeIf(table -> StrUtil.equalsAnyIgnoreCase(table.getTableName(), generatorProperties
|
tableList.removeIf(table -> StrUtil.equalsAnyIgnoreCase(table.getTableName(), generatorProperties
|
||||||
.getExcludeTables()));
|
.getExcludeTables()));
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ public class FileServiceImpl extends BaseServiceImpl<FileMapper, FileDO, FileRes
|
|||||||
super.fill(obj);
|
super.fill(obj);
|
||||||
if (obj instanceof FileResp fileResp && !URLUtils.isHttpUrl(fileResp.getUrl())) {
|
if (obj instanceof FileResp fileResp && !URLUtils.isHttpUrl(fileResp.getUrl())) {
|
||||||
StorageDO storage = storageService.getById(fileResp.getStorageId());
|
StorageDO storage = storageService.getById(fileResp.getStorageId());
|
||||||
String prefix = storage.getDomain() + StringConstants.SLASH;
|
String prefix = StrUtil.appendIfMissing(storage.getDomain(), StringConstants.SLASH);
|
||||||
String url = URLUtil.normalize(prefix + fileResp.getUrl());
|
String url = URLUtil.normalize(prefix + fileResp.getUrl());
|
||||||
fileResp.setUrl(url);
|
fileResp.setUrl(url);
|
||||||
String thumbnailUrl = StrUtils.blankToDefault(fileResp.getThumbnailUrl(), url, thUrl -> URLUtil
|
String thumbnailUrl = StrUtils.blankToDefault(fileResp.getThumbnailUrl(), url, thUrl -> URLUtil
|
||||||
|
|||||||
@@ -27,14 +27,14 @@ spring.datasource:
|
|||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
type: ${spring.datasource.type}
|
type: ${spring.datasource.type}
|
||||||
# 从库配置(可配多个,构成多从)
|
# # 从库配置(可配多个,构成多从)
|
||||||
slave_1:
|
# slave_1:
|
||||||
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
# url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
||||||
username:
|
# username:
|
||||||
password:
|
# password:
|
||||||
lazy: true
|
# lazy: true
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# # PostgreSQL 库配置
|
# # PostgreSQL 库配置
|
||||||
# postgresql:
|
# postgresql:
|
||||||
# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ spring.datasource:
|
|||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
type: ${spring.datasource.type}
|
type: ${spring.datasource.type}
|
||||||
# 从库配置(可配多个,构成多从)
|
# # 从库配置(可配多个,构成多从)
|
||||||
slave_1:
|
# slave_1:
|
||||||
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
# url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
||||||
username:
|
# username:
|
||||||
password:
|
# password:
|
||||||
lazy: true
|
# lazy: true
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# # PostgreSQL 库配置
|
# # PostgreSQL 库配置
|
||||||
# postgresql:
|
# postgresql:
|
||||||
# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
||||||
|
|||||||
Reference in New Issue
Block a user