From 7820a282d9ebf9079724550c8fc93072aaa91357 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 18 Sep 2025 18:31:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor(pc):=20=E4=BC=98=E5=8C=96=E4=BA=BA?= =?UTF-8?q?=E8=84=B8=E6=9C=8D=E5=8A=A1=E4=B8=AD=E7=9A=84=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在获取 re_match_mode 配置时,添加默认值 0,避免潜在的 NullPointerException - 优化了 switch 表达式中的条件判断,提高代码可读性 --- .../java/com/ycwl/basic/service/pc/impl/FaceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ycwl/basic/service/pc/impl/FaceServiceImpl.java b/src/main/java/com/ycwl/basic/service/pc/impl/FaceServiceImpl.java index 95eccb81..dc15300b 100644 --- a/src/main/java/com/ycwl/basic/service/pc/impl/FaceServiceImpl.java +++ b/src/main/java/com/ycwl/basic/service/pc/impl/FaceServiceImpl.java @@ -963,7 +963,7 @@ public class FaceServiceImpl implements FaceService { // 查询是否触发过低阈值检测 String lowThresholdKey = FACE_LOW_THRESHOLD_PFX + faceId; boolean hasLowThreshold = redisTemplate.hasKey(lowThresholdKey); - Integer mode = scenicConfig.getInteger("re_match_mode"); + Integer mode = scenicConfig.getInteger("re_match_mode", 0); return switch (mode) { case 1 -> tourMatch || recognitionCount > 1 || hasLowThreshold; case 5 -> hasLowThreshold || (ruleMatched >= 2);