Просмотр исходного кода

feat(mind): add fine-grained emotion fields to DTOs and VO

Extend EmotionCheckinDTO with moodScore, arousalLevel, emotionType, energyLevel, stressLevel, sleep fields. Add matching fields to EmotionCheckinVO. Update EmotionTrendVO with moodScoreAvg, moodTrend, scatterData references.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Xiaogang Liao 2 месяцев назад
Родитель
Сommit
f81ddafc5b

+ 13 - 2
cfc-backend/src/main/java/com/etotem/cfc/dto/EmotionCheckinDTO.java

@@ -7,8 +7,19 @@ import java.io.Serializable;
 @Data
 public class EmotionCheckinDTO implements Serializable {
     private Long childId;
-    private String moodWeather;
-    private String emotionTags;
+    private String moodWeather;          // 保留兼容(旧版天气字段)
+    private String emotionTags;           // 保留兼容(旧版标签 JSON)
     private String photoUrl;
     private String note;
+
+    // === 情绪精细度字段 (Phase 1.1) ===
+    private Integer moodScore;            // 效价评分 1-10(1=极差, 10=极好)
+    private String emotionType;           // 情绪大类: joy/sadness/anger/fear/disgust/surprise/trust/anticipation
+    private Integer stressLevel;          // 压力水平 1-10
+    private Integer arousalLevel;         // 激活度 1-10(1=平静, 10=激动)
+    private Integer energyLevel;          // 精力水平 1-10
+
+    // === 睡眠字段 (Phase 3.1, 预埋) ===
+    private Float sleepHours;             // 睡眠时长
+    private Integer sleepQuality;         // 睡眠质量 1-5
 }

+ 11 - 0
cfc-backend/src/main/java/com/etotem/cfc/dto/EmotionCheckinVO.java

@@ -17,4 +17,15 @@ public class EmotionCheckinVO implements Serializable {
     private Integer energyAwarded;
     private Date checkinDate;
     private Date createdAt;
+
+    // === 情绪精细度字段 ===
+    private Integer moodScore;
+    private String emotionType;
+    private Integer stressLevel;
+    private Integer arousalLevel;
+    private Integer energyLevel;
+
+    // === 睡眠字段 ===
+    private Float sleepHours;
+    private Integer sleepQuality;
 }

+ 5 - 0
cfc-backend/src/main/java/com/etotem/cfc/dto/EmotionTrendVO.java

@@ -13,4 +13,9 @@ public class EmotionTrendVO implements Serializable {
     private List<Map<String, Object>> dailyData;
     private Integer totalCheckins;
     private Integer totalEnergy;
+
+    // === Phase 1.1 精细趋势 ===
+    private Double moodScoreAvg;           // 平均情绪评分
+    private List<MoodTrendPoint> moodTrend; // 情绪得分时间序列(折线图数据)
+    private List<AffectPoint> scatterData;  // 效价-激活度散点
 }