فهرست منبع

feat(model): add FoodRecommendIndex and FoodRecommendIdxLog entities with mappers

Xiaogang Liao 2 ماه پیش
والد
کامیت
16b4072d8d

+ 31 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/FoodRecommendIdxLog.java

@@ -0,0 +1,31 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("food_recommend_idx_log")
+public class FoodRecommendIdxLog implements Serializable {
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /** 用户ID */
+    private Long userId;
+    /** 食材ID */
+    private Long foodId;
+    /** 食材名称 */
+    private String foodName;
+    /** 变更前推荐指数 */
+    private Integer previousIndex;
+    /** 变更后推荐指数 */
+    private Integer newIndex;
+    /** 触发的健康报告ID */
+    private Long healthReportId;
+    /** 变更原因 */
+    private String changeReason;
+    /** 变更时间 */
+    private Date changedAt;
+}

+ 29 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/FoodRecommendIndex.java

@@ -0,0 +1,29 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("food_recommend_idx")
+public class FoodRecommendIndex implements Serializable {
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /** 用户ID */
+    private Long userId;
+    /** 食材ID */
+    private Long foodId;
+    /** 食材名称 */
+    private String foodName;
+    /** 推荐指数(0-100, 来自菌群检测报告) */
+    private Integer indexScore;
+    /** 关联健康报告ID */
+    private Long healthReportId;
+    /** 计算时间 */
+    private Date calculatedAt;
+    /** 创建时间 */
+    private Date createdAt;
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/FoodRecommendIdxLogMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.FoodRecommendIdxLog;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface FoodRecommendIdxLogMapper extends BaseMapper<FoodRecommendIdxLog> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/FoodRecommendIndexMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.FoodRecommendIndex;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface FoodRecommendIndexMapper extends BaseMapper<FoodRecommendIndex> {
+}