Kaynağa Gözat

素材新增阅读指标

luojunhui 1 gün önce
ebeveyn
işleme
7c575e4a3c

+ 6 - 0
core/src/main/java/com/tzld/videoVector/model/vo/RecallMaterialScoreVO.java

@@ -40,6 +40,8 @@ public class RecallMaterialScoreVO {
         private String cover;           // 素材封面(第一张图片)
         private List<String> imageList; // 素材图片列表
         private Map<String, Object> deconstruct; // 解构信息
+        private Short sourceType;       // 来源类型:1=外部合作, 2=内部素材
+        private String source;          // 来源中文标签
 
         // 评分
         private Double sim;             // 余弦相似度 [0, 1]
@@ -102,6 +104,10 @@ public class RecallMaterialScoreVO {
         public void setImageList(List<String> imageList) { this.imageList = imageList; }
         public Map<String, Object> getDeconstruct() { return deconstruct; }
         public void setDeconstruct(Map<String, Object> deconstruct) { this.deconstruct = deconstruct; }
+        public Short getSourceType() { return sourceType; }
+        public void setSourceType(Short sourceType) { this.sourceType = sourceType; }
+        public String getSource() { return source; }
+        public void setSource(String source) { this.source = source; }
         public Double getSim() { return sim; }
         public void setSim(Double sim) { this.sim = sim; }
         public Double getQualityScore() { return qualityScore; }

+ 9 - 0
core/src/main/java/com/tzld/videoVector/service/impl/MaterialSearchServiceImpl.java

@@ -426,6 +426,8 @@ public class MaterialSearchServiceImpl implements MaterialSearchService {
             item.setModality("MATERIAL");
             item.setMaterialId(m.getMaterialId());
             item.setConfigCode(configCode);
+            item.setSourceType(m.getSourceType());
+            item.setSource(mapSourceTypeLabel(m.getSourceType()));
             item.setText(m.getText());
             item.setSim(round4(sim));
             item.setQualityScore(round4(qualityScore));
@@ -741,6 +743,13 @@ public class MaterialSearchServiceImpl implements MaterialSearchService {
         return Math.round(v * 10000.0) / 10000.0;
     }
 
+    private static String mapSourceTypeLabel(Short sourceType) {
+        if (sourceType == null) return null;
+        if (sourceType == 1) return "外部合作";
+        if (sourceType == 2) return "内部素材";
+        return null;
+    }
+
     /**
      * 解析查询向量
      * 优先级:queryVector > channelContentId 历史向量 > queryText embedding