فهرست منبع

feat(recommend): 新增推荐功能配置 RecommendProperties

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jintao.geng 1 ماه پیش
والد
کامیت
b64f338d7a

+ 32 - 0
mango-application/src/main/java/com/mangoo/rating/recommend/config/RecommendProperties.java

@@ -0,0 +1,32 @@
+package com.mangoo.rating.recommend.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * 评级时效推荐相关配置
+ *
+ * @author gengjintao
+ * @date 2026/06/24
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "recommend")
+public class RecommendProperties {
+
+    /** 兜底默认时效档(EvaluateEfficiencyEnum.code,默认 1=普通) */
+    private int defaultEfficiency = 1;
+
+    /** 单次请求卡数量上限 */
+    private int batchMax = 50;
+
+    /**
+     * 服务等级时效字符串 → 时效 code 映射(报价用,订单服务返回的 timeLimit 是字符串)。
+     * 例:「普通: 1」「快速: 2」「闪评: 3」「7个工作日: 1」「1个工作日: 3」
+     */
+    private Map<String, Integer> timeLimitMapping = new LinkedHashMap<>();
+}

+ 9 - 0
mango-application/src/main/resources/application.yml

@@ -345,3 +345,12 @@ ai:
 # ratingApp 业务服务地址(AI 助手通过 Feign 远程调其订单/物流接口)
 rating-app:
   url: ${RATING_APP_URL:192.168.31.111:8091}
+
+# 评级时效推荐功能配置
+recommend:
+  default-efficiency: 1
+  batch-max: 50
+  time-limit-mapping:
+    "普通": 1
+    "快速": 2
+    "闪评": 3