refactor(biz): 优化代码中的条件判断逻辑

- 将 Integer 类型的比较改为 Boolean 类型的比较,提高代码可读性和性能
- 修改涉及 scenicConfig 的条件判断,使用 Boolean.TRUE进行比较
- 优化部分代码结构,保持逻辑一致性
This commit is contained in:
2025-08-27 16:40:32 +08:00
parent f2ac6aaea0
commit 98bbaccb3a
3 changed files with 7 additions and 7 deletions

View File

@@ -139,9 +139,9 @@ public class GoodsServiceImpl implements GoodsService {
List<SourceRespVO> goods = faceEntry.getValue();
return goods.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).keySet().stream().filter(type -> {
if (Integer.valueOf(1).equals(type)) {
return !Integer.valueOf(1).equals(scenicConfig.getDisableSourceVideo());
return !Boolean.TRUE.equals(scenicConfig.getDisableSourceVideo());
} else if (Integer.valueOf(2).equals(type)) {
return !Integer.valueOf(1).equals(scenicConfig.getDisableSourceImage());
return !Boolean.TRUE.equals(scenicConfig.getDisableSourceImage());
}
return true;
}).map(type -> {