refactor: 优化部分代码

修复 Sonar、Codacy 扫描问题:补充部分泛型、调整部分 Boolean 类型判断、将部分不必要的(无集合长度变动) collect(Collectors.toList()); 转换为 toList()
This commit is contained in:
2024-02-03 11:43:05 +08:00
parent 3d77aa91ee
commit 6d959f5e3e
17 changed files with 93 additions and 104 deletions

View File

@@ -40,7 +40,6 @@ import top.charles7c.continew.starter.extension.crud.model.resp.PageResp;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 系统日志业务实现
@@ -64,7 +63,7 @@ public class LogServiceImpl implements LogService {
List<String> columnNameList = fieldNameList.stream()
.filter(n -> !n.endsWith(SysConstants.DESCRIPTION_FIELD_SUFFIX))
.map(StrUtil::toUnderlineCase)
.collect(Collectors.toList());
.toList();
queryWrapper.select(columnNameList);
// 分页查询
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
@@ -81,7 +80,7 @@ public class LogServiceImpl implements LogService {
List<String> columnNameList = fieldNameList.stream()
.filter(n -> !n.endsWith(SysConstants.DESCRIPTION_FIELD_SUFFIX))
.map(StrUtil::toUnderlineCase)
.collect(Collectors.toList());
.toList();
queryWrapper.select(columnNameList);
// 分页查询
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);
@@ -97,7 +96,7 @@ public class LogServiceImpl implements LogService {
List<String> columnNameList = fieldNameList.stream()
.filter(n -> !n.endsWith(SysConstants.DESCRIPTION_FIELD_SUFFIX))
.map(StrUtil::toUnderlineCase)
.collect(Collectors.toList());
.toList();
queryWrapper.select(columnNameList);
// 分页查询
IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper);