Browse Source

fix: 修正 UserController 变量重复声明

iwt 1 month ago
parent
commit
393f72de88

+ 1 - 14
cfc-backend/src/main/java/com/etotem/cfc/controller/UserController.java

@@ -208,20 +208,7 @@ public class UserController {
         Map<String, Object> stats = new HashMap<>();
 
         // 1. 总积分
-        Integer totalPoints = 0;
-        try {
-            Integer totalPoints = user.getTotalPoints() != null ? user.getTotalPoints() : 0;
-            if (points != null) {
-                if (points instanceof Map) {
-                    Object v = ((Map<?, ?>) points).get("totalPoints");
-                    if (v != null) totalPoints = ((Number) v).intValue();
-                } else if (points instanceof Number) {
-                    totalPoints = ((Number) points).intValue();
-                }
-            }
-        } catch (Exception e) {
-            log.warn("获取积分失败: userId={}", userId, e);
-        }
+        Integer totalPoints = user.getTotalPoints() != null ? user.getTotalPoints() : 0;
         stats.put("totalPoints", totalPoints);
 
         // 2. 连续打卡天数(取所有孩子中最高值)