mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-09 20:57:21 +08:00
chore: 优化部分代码
This commit is contained in:
@@ -85,7 +85,7 @@ public class GeneratorServiceImpl implements GeneratorService {
|
||||
List<Table> tableList = MetaUtils.getTables(dataSource);
|
||||
String tableName = query.getTableName();
|
||||
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
|
||||
.getExcludeTables()));
|
||||
|
@@ -146,7 +146,7 @@ public class FileServiceImpl extends BaseServiceImpl<FileMapper, FileDO, FileRes
|
||||
super.fill(obj);
|
||||
if (obj instanceof FileResp fileResp && !URLUtils.isHttpUrl(fileResp.getUrl())) {
|
||||
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());
|
||||
fileResp.setUrl(url);
|
||||
String thumbnailUrl = StrUtils.blankToDefault(fileResp.getThumbnailUrl(), url, thUrl -> URLUtil
|
||||
|
@@ -27,14 +27,14 @@ spring.datasource:
|
||||
password: ${DB_PWD:123456}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: ${spring.datasource.type}
|
||||
# 从库配置(可配多个,构成多从)
|
||||
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
|
||||
username:
|
||||
password:
|
||||
lazy: true
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: ${spring.datasource.type}
|
||||
# # 从库配置(可配多个,构成多从)
|
||||
# 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
|
||||
# username:
|
||||
# password:
|
||||
# lazy: true
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# type: ${spring.datasource.type}
|
||||
# # 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
|
||||
|
@@ -29,14 +29,14 @@ spring.datasource:
|
||||
password: ${DB_PWD:123456}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: ${spring.datasource.type}
|
||||
# 从库配置(可配多个,构成多从)
|
||||
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
|
||||
username:
|
||||
password:
|
||||
lazy: true
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: ${spring.datasource.type}
|
||||
# # 从库配置(可配多个,构成多从)
|
||||
# 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
|
||||
# username:
|
||||
# password:
|
||||
# lazy: true
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# type: ${spring.datasource.type}
|
||||
# # 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
|
||||
|
Reference in New Issue
Block a user