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

增加新匹配流程 向量匹配视频 优先向量匹配的视频

wangyunpeng 5 дней назад
Родитель
Сommit
2b331b4a5d
14 измененных файлов с 1641 добавлено и 56 удалено
  1. 3 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/component/ThreadPools.java
  2. 5 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/controller/JobController.java
  3. 5 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/longarticle/LongArticlesTextMapper.java
  4. 30 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/longarticle/VectorMatchVideoMapper.java
  5. 11 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/NewMatchVideoJob.java
  6. 125 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/VectorMatchVideo.java
  7. 862 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/VectorMatchVideoExample.java
  8. 2 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/NewMatchVideoService.java
  9. 178 35
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java
  10. 95 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/NewMatchVideoServiceImpl.java
  11. 1 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/VideoVectorServiceImpl.java
  12. 12 0
      long-article-server/src/main/resources/mapper/longarticle/LongArticlesTextMapper.xml
  13. 294 0
      long-article-server/src/main/resources/mapper/longarticle/VectorMatchVideoMapper.xml
  14. 18 20
      long-article-server/src/main/resources/mybatis-generator-config.xml

+ 3 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/component/ThreadPools.java

@@ -16,4 +16,7 @@ public class ThreadPools {
 
 
     // 定义一个线程池,设置消费线程的数量
     // 定义一个线程池,设置消费线程的数量
     public static final ThreadPoolExecutor newUploadCrawlerVideoPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(40);
     public static final ThreadPoolExecutor newUploadCrawlerVideoPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(40);
+
+    // 定义一个线程池,设置消费线程的数量
+    public static final ThreadPoolExecutor newVectorMatchVideoPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(5);
 }
 }

+ 5 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/controller/JobController.java

@@ -18,6 +18,11 @@ public class JobController {
     public void matchCrawlerVideo() {
     public void matchCrawlerVideo() {
         newMatchVideoJob.matchCrawlerVideoJob(null);
         newMatchVideoJob.matchCrawlerVideoJob(null);
     }
     }
+
+    @GetMapping("/vectorMatchVideoJob")
+    public void vectorMatchVideoJob() {
+        newMatchVideoJob.vectorMatchVideoJob(null);
+    }
 }
 }
 
 
 
 

+ 5 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/longarticle/LongArticlesTextMapper.java

@@ -33,4 +33,9 @@ public interface LongArticlesTextMapper {
     int updateByPrimaryKeyWithBLOBs(LongArticlesText record);
     int updateByPrimaryKeyWithBLOBs(LongArticlesText record);
 
 
     int updateByPrimaryKey(LongArticlesText record);
     int updateByPrimaryKey(LongArticlesText record);
+
+    /**
+     * 查询有标题但尚未在 vector_match_videos 中有匹配记录的文章
+     */
+    List<LongArticlesText> selectUnmatchedArticles();
 }
 }

+ 30 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/longarticle/VectorMatchVideoMapper.java

@@ -0,0 +1,30 @@
+package com.tzld.piaoquan.longarticle.dao.mapper.longarticle;
+
+import com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideo;
+import com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideoExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface VectorMatchVideoMapper {
+    long countByExample(VectorMatchVideoExample example);
+
+    int deleteByExample(VectorMatchVideoExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(VectorMatchVideo record);
+
+    int insertSelective(VectorMatchVideo record);
+
+    List<VectorMatchVideo> selectByExample(VectorMatchVideoExample example);
+
+    VectorMatchVideo selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") VectorMatchVideo record, @Param("example") VectorMatchVideoExample example);
+
+    int updateByExample(@Param("record") VectorMatchVideo record, @Param("example") VectorMatchVideoExample example);
+
+    int updateByPrimaryKeySelective(VectorMatchVideo record);
+
+    int updateByPrimaryKey(VectorMatchVideo record);
+}

+ 11 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/NewMatchVideoJob.java

@@ -113,5 +113,16 @@ public class NewMatchVideoJob {
         return ReturnT.SUCCESS;
         return ReturnT.SUCCESS;
     }
     }
 
 
+    @XxlJob("vectorMatchVideoJob")
+    public ReturnT<String> vectorMatchVideoJob(String param) {
+        try {
+            newMatchVideoService.vectorMatchVideo();
+        } catch (Exception e) {
+            LarkRobotUtil.sendMessage("vectorMatchVideoJob异常,请及时查看,<at user_id=\"g6732afb\">王云鹏</at>");
+            log.error("vectorMatchVideoJob error:{}", e.getMessage());
+        }
+        return ReturnT.SUCCESS;
+    }
+
 
 
 }
 }

+ 125 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/VectorMatchVideo.java

@@ -0,0 +1,125 @@
+package com.tzld.piaoquan.longarticle.model.po.longarticle;
+
+import java.util.Date;
+
+public class VectorMatchVideo {
+    private Long id;
+
+    private String contentId;
+
+    private Long videoId;
+
+    private Double score;
+
+    private String configCode;
+
+    private String videoTitle;
+
+    private String videoOssPath;
+
+    private String coverUrl;
+
+    private Integer status;
+
+    private Date createTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getContentId() {
+        return contentId;
+    }
+
+    public void setContentId(String contentId) {
+        this.contentId = contentId;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
+    public String getConfigCode() {
+        return configCode;
+    }
+
+    public void setConfigCode(String configCode) {
+        this.configCode = configCode;
+    }
+
+    public String getVideoTitle() {
+        return videoTitle;
+    }
+
+    public void setVideoTitle(String videoTitle) {
+        this.videoTitle = videoTitle;
+    }
+
+    public String getVideoOssPath() {
+        return videoOssPath;
+    }
+
+    public void setVideoOssPath(String videoOssPath) {
+        this.videoOssPath = videoOssPath;
+    }
+
+    public String getCoverUrl() {
+        return coverUrl;
+    }
+
+    public void setCoverUrl(String coverUrl) {
+        this.coverUrl = coverUrl;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", contentId=").append(contentId);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", score=").append(score);
+        sb.append(", configCode=").append(configCode);
+        sb.append(", videoTitle=").append(videoTitle);
+        sb.append(", videoOssPath=").append(videoOssPath);
+        sb.append(", coverUrl=").append(coverUrl);
+        sb.append(", status=").append(status);
+        sb.append(", createTime=").append(createTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 862 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/VectorMatchVideoExample.java

@@ -0,0 +1,862 @@
+package com.tzld.piaoquan.longarticle.model.po.longarticle;
+
+import com.tzld.piaoquan.longarticle.utils.page.Page;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class VectorMatchVideoExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public VectorMatchVideoExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdIsNull() {
+            addCriterion("content_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdIsNotNull() {
+            addCriterion("content_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdEqualTo(String value) {
+            addCriterion("content_id =", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotEqualTo(String value) {
+            addCriterion("content_id <>", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdGreaterThan(String value) {
+            addCriterion("content_id >", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdGreaterThanOrEqualTo(String value) {
+            addCriterion("content_id >=", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdLessThan(String value) {
+            addCriterion("content_id <", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdLessThanOrEqualTo(String value) {
+            addCriterion("content_id <=", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdLike(String value) {
+            addCriterion("content_id like", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotLike(String value) {
+            addCriterion("content_id not like", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdIn(List<String> values) {
+            addCriterion("content_id in", values, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotIn(List<String> values) {
+            addCriterion("content_id not in", values, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdBetween(String value1, String value2) {
+            addCriterion("content_id between", value1, value2, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotBetween(String value1, String value2) {
+            addCriterion("content_id not between", value1, value2, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNull() {
+            addCriterion("score is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNotNull() {
+            addCriterion("score is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreEqualTo(Double value) {
+            addCriterion("score =", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotEqualTo(Double value) {
+            addCriterion("score <>", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThan(Double value) {
+            addCriterion("score >", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("score >=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThan(Double value) {
+            addCriterion("score <", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThanOrEqualTo(Double value) {
+            addCriterion("score <=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIn(List<Double> values) {
+            addCriterion("score in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotIn(List<Double> values) {
+            addCriterion("score not in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreBetween(Double value1, Double value2) {
+            addCriterion("score between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotBetween(Double value1, Double value2) {
+            addCriterion("score not between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeIsNull() {
+            addCriterion("config_code is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeIsNotNull() {
+            addCriterion("config_code is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeEqualTo(String value) {
+            addCriterion("config_code =", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeNotEqualTo(String value) {
+            addCriterion("config_code <>", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeGreaterThan(String value) {
+            addCriterion("config_code >", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeGreaterThanOrEqualTo(String value) {
+            addCriterion("config_code >=", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeLessThan(String value) {
+            addCriterion("config_code <", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeLessThanOrEqualTo(String value) {
+            addCriterion("config_code <=", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeLike(String value) {
+            addCriterion("config_code like", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeNotLike(String value) {
+            addCriterion("config_code not like", value, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeIn(List<String> values) {
+            addCriterion("config_code in", values, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeNotIn(List<String> values) {
+            addCriterion("config_code not in", values, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeBetween(String value1, String value2) {
+            addCriterion("config_code between", value1, value2, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigCodeNotBetween(String value1, String value2) {
+            addCriterion("config_code not between", value1, value2, "configCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleIsNull() {
+            addCriterion("video_title is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleIsNotNull() {
+            addCriterion("video_title is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleEqualTo(String value) {
+            addCriterion("video_title =", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleNotEqualTo(String value) {
+            addCriterion("video_title <>", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleGreaterThan(String value) {
+            addCriterion("video_title >", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("video_title >=", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleLessThan(String value) {
+            addCriterion("video_title <", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleLessThanOrEqualTo(String value) {
+            addCriterion("video_title <=", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleLike(String value) {
+            addCriterion("video_title like", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleNotLike(String value) {
+            addCriterion("video_title not like", value, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleIn(List<String> values) {
+            addCriterion("video_title in", values, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleNotIn(List<String> values) {
+            addCriterion("video_title not in", values, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleBetween(String value1, String value2) {
+            addCriterion("video_title between", value1, value2, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoTitleNotBetween(String value1, String value2) {
+            addCriterion("video_title not between", value1, value2, "videoTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathIsNull() {
+            addCriterion("video_oss_path is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathIsNotNull() {
+            addCriterion("video_oss_path is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathEqualTo(String value) {
+            addCriterion("video_oss_path =", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathNotEqualTo(String value) {
+            addCriterion("video_oss_path <>", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathGreaterThan(String value) {
+            addCriterion("video_oss_path >", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathGreaterThanOrEqualTo(String value) {
+            addCriterion("video_oss_path >=", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathLessThan(String value) {
+            addCriterion("video_oss_path <", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathLessThanOrEqualTo(String value) {
+            addCriterion("video_oss_path <=", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathLike(String value) {
+            addCriterion("video_oss_path like", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathNotLike(String value) {
+            addCriterion("video_oss_path not like", value, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathIn(List<String> values) {
+            addCriterion("video_oss_path in", values, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathNotIn(List<String> values) {
+            addCriterion("video_oss_path not in", values, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathBetween(String value1, String value2) {
+            addCriterion("video_oss_path between", value1, value2, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoOssPathNotBetween(String value1, String value2) {
+            addCriterion("video_oss_path not between", value1, value2, "videoOssPath");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlIsNull() {
+            addCriterion("cover_url is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlIsNotNull() {
+            addCriterion("cover_url is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlEqualTo(String value) {
+            addCriterion("cover_url =", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlNotEqualTo(String value) {
+            addCriterion("cover_url <>", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlGreaterThan(String value) {
+            addCriterion("cover_url >", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlGreaterThanOrEqualTo(String value) {
+            addCriterion("cover_url >=", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlLessThan(String value) {
+            addCriterion("cover_url <", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlLessThanOrEqualTo(String value) {
+            addCriterion("cover_url <=", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlLike(String value) {
+            addCriterion("cover_url like", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlNotLike(String value) {
+            addCriterion("cover_url not like", value, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlIn(List<String> values) {
+            addCriterion("cover_url in", values, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlNotIn(List<String> values) {
+            addCriterion("cover_url not in", values, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlBetween(String value1, String value2) {
+            addCriterion("cover_url between", value1, value2, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverUrlNotBetween(String value1, String value2) {
+            addCriterion("cover_url not between", value1, value2, "coverUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/NewMatchVideoService.java

@@ -18,4 +18,6 @@ public interface NewMatchVideoService {
     void matchCrawlerVideo() throws InterruptedException;
     void matchCrawlerVideo() throws InterruptedException;
 
 
     void uploadCrawlerVideo() throws InterruptedException;
     void uploadCrawlerVideo() throws InterruptedException;
+
+    void vectorMatchVideo() throws InterruptedException;
 }
 }

+ 178 - 35
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -3,6 +3,7 @@ package com.tzld.piaoquan.longarticle.service.local.impl;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.tzld.piaoquan.longarticle.common.constants.TimeConstant;
 import com.tzld.piaoquan.longarticle.common.constants.TimeConstant;
@@ -15,6 +16,8 @@ import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
 import com.tzld.piaoquan.longarticle.model.dto.AuditContentRequest;
 import com.tzld.piaoquan.longarticle.model.dto.AuditContentRequest;
 import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
 import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
 import com.tzld.piaoquan.longarticle.model.dto.PublishArticleData;
 import com.tzld.piaoquan.longarticle.model.dto.PublishArticleData;
+import com.tzld.piaoquan.longarticle.model.dto.RecallVideoScoreParam;
+import com.tzld.piaoquan.longarticle.model.dto.RecallVideoScoreVO;
 import com.tzld.piaoquan.longarticle.model.po.crawler.FwhDailyPublishDetail;
 import com.tzld.piaoquan.longarticle.model.po.crawler.FwhDailyPublishDetail;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.*;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.*;
 import com.tzld.piaoquan.longarticle.model.vo.*;
 import com.tzld.piaoquan.longarticle.model.vo.*;
@@ -24,13 +27,16 @@ import com.tzld.piaoquan.longarticle.service.local.PlanAccountService;
 import com.tzld.piaoquan.longarticle.service.remote.AigcService;
 import com.tzld.piaoquan.longarticle.service.remote.AigcService;
 import com.tzld.piaoquan.longarticle.service.remote.MatchService;
 import com.tzld.piaoquan.longarticle.service.remote.MatchService;
 import com.tzld.piaoquan.longarticle.service.remote.VideoService;
 import com.tzld.piaoquan.longarticle.service.remote.VideoService;
+import com.tzld.piaoquan.longarticle.service.remote.VideoVectorService;
 import com.tzld.piaoquan.longarticle.utils.DateUtil;
 import com.tzld.piaoquan.longarticle.utils.DateUtil;
 import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
 import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
 import com.tzld.piaoquan.longarticle.utils.TimeZoneUtil;
 import com.tzld.piaoquan.longarticle.utils.TimeZoneUtil;
+import com.tzld.piaoquan.longarticle.utils.VideoUtils;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 
 
@@ -95,9 +101,18 @@ public class CoreServiceImpl implements CoreService {
     @Autowired
     @Autowired
     private FwhDailyPublishDetailMapper fwhDailyPublishDetailMapper;
     private FwhDailyPublishDetailMapper fwhDailyPublishDetailMapper;
 
 
+    @Autowired
+    private VideoVectorService videoVectorService;
+
+    @Autowired
+    private VectorMatchVideoMapper vectorMatchVideoMapper;
+
     @ApolloJsonValue("${fwhGhIdList:[]}")
     @ApolloJsonValue("${fwhGhIdList:[]}")
     private List<String> fwhGhIdList;
     private List<String> fwhGhIdList;
 
 
+    @Value("${recall.video.config.code:VIDEO_TOPIC}")
+    private String recallVideoConfigCode;
+
 
 
     public void initAccountSpecialSettings() {
     public void initAccountSpecialSettings() {
         List<SpecialSettingVO> specialSettings = aigcService.getSpecialSetting();
         List<SpecialSettingVO> specialSettings = aigcService.getSpecialSetting();
@@ -381,6 +396,13 @@ public class CoreServiceImpl implements CoreService {
                                 aigcService.updateMatchMiniprogramStatus(statusParam);
                                 aigcService.updateMatchMiniprogramStatus(statusParam);
                                 continue;
                                 continue;
                             }
                             }
+                            // 召回匹配并行流程:通过 recallWithScore 召回视频
+                            try {
+                                processRecallWithScore(matchContent);
+                            } catch (Exception e) {
+                                log.error("recallWithScore error, contentId={}, title={}",
+                                        matchContent.getSourceId(), matchContent.getTitle(), e);
+                            }
                             MatchVideo matchVideo = contentService.getContent(matchContent.getSourceId(),
                             MatchVideo matchVideo = contentService.getContent(matchContent.getSourceId(),
                                     matchContent.getGhId(), PublicFlagEnum.NOT_PUBLIC.getStatusCode());
                                     matchContent.getGhId(), PublicFlagEnum.NOT_PUBLIC.getStatusCode());
                             if (matchVideo != null) {
                             if (matchVideo != null) {
@@ -495,6 +517,67 @@ public class CoreServiceImpl implements CoreService {
         }
         }
     }
     }
 
 
+    /**
+     * 通过 recallWithScore 向量召回匹配视频,结果存入 recalled_video_match 表
+     */
+    private void processRecallWithScore(MatchContent matchContent) {
+        // 已有召回结果则跳过
+        VectorMatchVideoExample example = new VectorMatchVideoExample();
+        example.createCriteria().andContentIdEqualTo(matchContent.getSourceId());
+        if (vectorMatchVideoMapper.countByExample(example) > 0) {
+            return;
+        }
+        // 标题为空则跳过
+        if (StringUtils.isEmpty(matchContent.getTitle())) {
+            return;
+        }
+        RecallVideoScoreParam param = new RecallVideoScoreParam();
+        param.setQueryText(matchContent.getTitle());
+        param.setTopN(3);
+        param.setAlpha(0.6);
+        param.setSimMin(0.6);
+        if (StringUtils.isNotEmpty(recallVideoConfigCode)) {
+            param.setConfigCode(recallVideoConfigCode);
+        }
+        RecallVideoScoreVO result = videoVectorService.recallWithScore(param);
+        if (result == null || CollectionUtils.isEmpty(result.getItems())) {
+            log.info("recallWithScore no results, contentId={}, title={}", matchContent.getSourceId(), matchContent.getTitle());
+            return;
+        }
+        log.info("recallWithScore results, contentId={}, total={}", matchContent.getSourceId(), result.getTotal());
+        int savedCount = 0;
+        for (RecallVideoScoreVO.ScoredVideoItem item : result.getItems()) {
+            if (item.getVideoId() == null) {
+                continue;
+            }
+            // 通过视频ID获取OSS路径和标题
+            JSONObject videoDetailJson = VideoUtils.getVideoDetail(item.getVideoId());
+            if (videoDetailJson == null) {
+                log.warn("getVideoDetail null for videoId={}, contentId={}", item.getVideoId(), matchContent.getSourceId());
+                continue;
+            }
+            String ossVideoPath = videoDetailJson.getString("ossVideoPath");
+            String title = videoDetailJson.getString("title");
+            String shareImgPath = videoDetailJson.getString("shareImgPath");
+            if (StringUtils.isEmpty(ossVideoPath)) {
+                log.warn("ossVideoPath empty for videoId={}, contentId={}", item.getVideoId(), matchContent.getSourceId());
+                continue;
+            }
+            VectorMatchVideo recallRecord = new VectorMatchVideo();
+            recallRecord.setContentId(matchContent.getSourceId());
+            recallRecord.setVideoId(item.getVideoId());
+            recallRecord.setScore(item.getScore());
+            recallRecord.setConfigCode(item.getConfigCode());
+            recallRecord.setVideoTitle(title);
+            recallRecord.setVideoOssPath(ossVideoPath);
+            recallRecord.setCoverUrl(shareImgPath);
+            recallRecord.setStatus(1);
+            recallRecord.setCreateTime(new Date());
+            vectorMatchVideoMapper.insertSelective(recallRecord);
+            savedCount++;
+        }
+        log.info("recallWithScore saved {} records, contentId={}", savedCount, matchContent.getSourceId());
+    }
 
 
     private boolean effectiveTime(String startWindow, String endWindow, TimeZoneUtil.Timezone timezone) {
     private boolean effectiveTime(String startWindow, String endWindow, TimeZoneUtil.Timezone timezone) {
         if (!org.springframework.util.StringUtils.hasText(startWindow) || !org.springframework.util.StringUtils.hasText(endWindow)) {
         if (!org.springframework.util.StringUtils.hasText(startWindow) || !org.springframework.util.StringUtils.hasText(endWindow)) {
@@ -723,41 +806,8 @@ public class CoreServiceImpl implements CoreService {
                 continue;
                 continue;
             }
             }
             //判断是否插入小程序
             //判断是否插入小程序
-            if (planAccount.getMiniprogramInsertFlag() != null && planAccount.getMiniprogramInsertFlag() == 1) {
-                //获取小程序
-                List<PublishMiniprogram> publishMiniprogramList = publicContentService.getPublishMiniprograms(publishContent);
-                //不存在则重新生成
-                if (CollectionUtils.isEmpty(publishMiniprogramList)) {
-                    if (Objects.equals(publishContent.getSourceType(), SourceTypesEnum.longArticleVideoPoolSource.getVal())) {
-                        List<VideoDetail> videoDetails = contentService.getOnlyMiniPublishVideoDetail(publishContent);
-                        log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
-                        if (CollectionUtils.isEmpty(videoDetails)) {
-                            continue;
-                        }
-                        publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
-                        if (CollectionUtils.isEmpty(publishMiniprogramList)) {
-                            continue;
-                        }
-                    } else {
-                        MatchVideo matchVideo = contentService.getMatchVideo(publishContent, planAccount);
-                        if (matchVideo == null) {
-                            continue;
-                        }
-                        List<VideoDetail> videoDetails = contentService.
-                                getPublishVideoDetail(matchVideo, PublicFlagEnum.NOT_PUBLIC.getStatusCode(), planAccount, publishContent);
-                        log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
-                        if (CollectionUtils.isEmpty(videoDetails)) {
-                            continue;
-                        }
-                        publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
-                        if (CollectionUtils.isEmpty(publishMiniprogramList)) {
-                            continue;
-                        }
-                        contentService.updateMatchContent(publishContent, publishMiniprogramList, matchVideo);
-                    }
-                }
-                log.info("publishMiniprogramList={}", publishMiniprogramList);
-                List<PublishMiniprogramParam> publishCardList = getPublishCardList(publishMiniprogramList);
+            List<PublishMiniprogramParam> publishCardList = getOrGenerateMiniprogramCards(publishContent, planAccount);
+            if (publishCardList != null && !publishCardList.isEmpty()) {
                 contentParam.setMiniprogramCardList(publishCardList);
                 contentParam.setMiniprogramCardList(publishCardList);
             }
             }
 
 
@@ -784,6 +834,99 @@ public class CoreServiceImpl implements CoreService {
 
 
     }
     }
 
 
+    /**
+     * 获取或生成小程序卡片,返回 null 表示该内容应跳过
+     */
+    private List<PublishMiniprogramParam> getOrGenerateMiniprogramCards(PublishContent publishContent, PlanAccount planAccount) {
+        if (planAccount.getMiniprogramInsertFlag() == null || planAccount.getMiniprogramInsertFlag() != 1) {
+            return Collections.emptyList();
+        }
+        //获取小程序
+        List<PublishMiniprogram> publishMiniprogramList = publicContentService.getPublishMiniprograms(publishContent);
+        //不存在则重新生成
+        if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+            // 优先尝试 recallWithScore 召回的视频
+            publishMiniprogramList = getRecallPublishMiniprograms(publishContent, planAccount);
+            if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+                // 回退到现有流程
+                if (Objects.equals(publishContent.getSourceType(), SourceTypesEnum.longArticleVideoPoolSource.getVal())) {
+                    List<VideoDetail> videoDetails = contentService.getOnlyMiniPublishVideoDetail(publishContent);
+                    log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
+                    if (CollectionUtils.isEmpty(videoDetails)) {
+                        return null;
+                    }
+                    publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
+                    if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+                        return null;
+                    }
+                } else {
+                    MatchVideo matchVideo = contentService.getMatchVideo(publishContent, planAccount);
+                    if (matchVideo == null) {
+                        return null;
+                    }
+                    List<VideoDetail> videoDetails = contentService.
+                            getPublishVideoDetail(matchVideo, PublicFlagEnum.NOT_PUBLIC.getStatusCode(), planAccount, publishContent);
+                    log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
+                    if (CollectionUtils.isEmpty(videoDetails)) {
+                        return null;
+                    }
+                    publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
+                    if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+                        return null;
+                    }
+                    contentService.updateMatchContent(publishContent, publishMiniprogramList, matchVideo);
+                }
+            }
+        }
+        log.info("publishMiniprogramList={}", publishMiniprogramList);
+        return getPublishCardList(publishMiniprogramList);
+    }
+
+    /**
+     * 优先从 recallWithScore 召回结果中获取小程序视频,发布后生成小程序卡片
+     * 返回空列表时表示无召回结果,调用方应回退到现有流程
+     */
+    private List<PublishMiniprogram> getRecallPublishMiniprograms(PublishContent publishContent, PlanAccount planAccount) {
+        VectorMatchVideoExample example = new VectorMatchVideoExample();
+        example.createCriteria().andContentIdEqualTo(publishContent.getSourceId()).andStatusEqualTo(1);
+        example.setOrderByClause("score desc");
+        List<VectorMatchVideo> recallList = vectorMatchVideoMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(recallList)) {
+            return null;
+        }
+        log.info("getRecallPublishMiniprograms found {} recall records, contentId={}", recallList.size(), publishContent.getSourceId());
+        List<VideoDetail> videoDetails = new ArrayList<>();
+        for (VectorMatchVideo recall : recallList) {
+            try {
+                VideoDetail videoDetail = videoService.publish(recall.getVideoOssPath(), "69637498", recall.getVideoTitle());
+                if (videoDetail == null || StringUtils.isEmpty(videoDetail.getVideoId())) {
+                    log.warn("videoService.publish failed, recallId={}, videoId={}", recall.getId(), recall.getVideoId());
+                    continue;
+                }
+                videoDetail.setUid("69637498");
+                videoDetail.setSource("piaoquan");
+                videoDetail.setKimiTitle(recall.getVideoTitle());
+                videoDetail.setVideoOss(recall.getVideoOssPath());
+                videoDetail.setCoverOss(recall.getCoverUrl());
+                videoDetails.add(videoDetail);
+            } catch (Exception e) {
+                log.error("publish recall video error, recallId={}, videoId={}", recall.getId(), recall.getVideoId(), e);
+            }
+        }
+        if (CollectionUtils.isEmpty(videoDetails)) {
+            return null;
+        }
+        List<PublishMiniprogram> publishMiniprogramList = cardService.generateCards(videoDetails, planAccount, publishContent);
+        if (!CollectionUtils.isEmpty(publishMiniprogramList)) {
+            for (PublishMiniprogram publishMiniprogram : publishMiniprogramList) {
+                rootSourceService.addRootSource(publishMiniprogram, planAccount, publishContent);
+                publishMiniprogramMapper.insertSelective(publishMiniprogram);
+            }
+            log.info("getRecallPublishMiniprograms success, cards={}, contentId={}", publishMiniprogramList.size(), publishContent.getSourceId());
+        }
+        return publishMiniprogramList;
+    }
+
     private List<PublishMiniprogram> getPublishMiniprogramList(List<VideoDetail> videoDetails, PlanAccount planAccount,
     private List<PublishMiniprogram> getPublishMiniprogramList(List<VideoDetail> videoDetails, PlanAccount planAccount,
                                                                PublishContent publishContent) {
                                                                PublishContent publishContent) {
         if (CollectionUtils.isEmpty(videoDetails)) {
         if (CollectionUtils.isEmpty(videoDetails)) {

+ 95 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/NewMatchVideoServiceImpl.java

@@ -5,14 +5,22 @@ import com.tzld.piaoquan.longarticle.dao.mapper.aigc.ProducePlanExeRecordMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.LongArticlesTextMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.LongArticlesTextMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.NewMatchVideoMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.NewMatchVideoMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.PromotionSourceMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.PromotionSourceMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.VectorMatchVideoMapper;
 import com.tzld.piaoquan.longarticle.model.po.aigc.ProducePlanExeRecord;
 import com.tzld.piaoquan.longarticle.model.po.aigc.ProducePlanExeRecord;
 import com.tzld.piaoquan.longarticle.model.po.aigc.ProducePlanExeRecordExample;
 import com.tzld.piaoquan.longarticle.model.po.aigc.ProducePlanExeRecordExample;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.*;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.*;
+import com.tzld.piaoquan.longarticle.model.dto.RecallVideoScoreParam;
+import com.tzld.piaoquan.longarticle.model.dto.RecallVideoScoreVO;
 import com.tzld.piaoquan.longarticle.model.vo.MatchContentItem;
 import com.tzld.piaoquan.longarticle.model.vo.MatchContentItem;
 import com.tzld.piaoquan.longarticle.service.local.KimiService;
 import com.tzld.piaoquan.longarticle.service.local.KimiService;
 import com.tzld.piaoquan.longarticle.service.local.NewMatchVideoService;
 import com.tzld.piaoquan.longarticle.service.local.NewMatchVideoService;
+import com.tzld.piaoquan.longarticle.service.remote.VideoVectorService;
+import com.tzld.piaoquan.longarticle.utils.VideoUtils;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
@@ -47,6 +55,15 @@ public class NewMatchVideoServiceImpl implements NewMatchVideoService {
     @Autowired
     @Autowired
     private LongArticlesTextMapper longArticlesTextMapper;
     private LongArticlesTextMapper longArticlesTextMapper;
 
 
+    @Autowired
+    private VideoVectorService videoVectorService;
+
+    @Autowired
+    private VectorMatchVideoMapper vectorMatchVideoMapper;
+
+    @Value("${recall.video.config.code:VIDEO_TOPIC}")
+    private String recallVideoConfigCode;
+
     private static final Integer retryCountMax = 3;
     private static final Integer retryCountMax = 3;
 
 
 
 
@@ -203,6 +220,84 @@ public class NewMatchVideoServiceImpl implements NewMatchVideoService {
 
 
     }
     }
 
 
+    @Override
+    public void vectorMatchVideo() throws InterruptedException {
+        List<LongArticlesText> articles = longArticlesTextMapper.selectUnmatchedArticles();
+        if (CollectionUtils.isEmpty(articles)) {
+            return;
+        }
+        CountDownLatch countDownLatch = new CountDownLatch(articles.size());
+        for (LongArticlesText article : articles) {
+            newVectorMatchVideoPoolExecutor.execute(() -> {
+                try {
+                    processVectorMatchContent(article);
+                } finally {
+                    countDownLatch.countDown();
+                }
+            });
+        }
+        countDownLatch.await();
+    }
+
+    private void processVectorMatchContent(LongArticlesText article) {
+        String title = article.getArticleTitle();
+        if (StringUtils.isEmpty(title)) {
+            return;
+        }
+        // 调用向量召回
+        RecallVideoScoreParam param = new RecallVideoScoreParam();
+        param.setQueryText(title);
+        param.setTopN(3);
+        param.setAlpha(0.6);
+        param.setSimMin(0.6);
+        if (StringUtils.isNotEmpty(recallVideoConfigCode)) {
+            param.setConfigCode(recallVideoConfigCode);
+        }
+        RecallVideoScoreVO result = videoVectorService.recallWithScore(param);
+        if (result == null || CollectionUtils.isEmpty(result.getItems())) {
+            log.info("recallWithScore no results, contentId={}, title={}", article.getContentId(), title);
+            // 插入占位记录,避免下次重复尝试
+            VectorMatchVideo placeholder = new VectorMatchVideo();
+            placeholder.setContentId(article.getContentId());
+            placeholder.setStatus(0);
+            placeholder.setCreateTime(new Date());
+            vectorMatchVideoMapper.insertSelective(placeholder);
+            return;
+        }
+        log.info("recallWithScore results, contentId={}, total={}", article.getContentId(), result.getTotal());
+        int savedCount = 0;
+        for (RecallVideoScoreVO.ScoredVideoItem item : result.getItems()) {
+            if (item.getVideoId() == null) {
+                continue;
+            }
+            JSONObject videoDetailJson = VideoUtils.getVideoDetail(item.getVideoId());
+            if (videoDetailJson == null) {
+                log.warn("getVideoDetail null for videoId={}, contentId={}", item.getVideoId(), article.getContentId());
+                continue;
+            }
+            String ossVideoPath = videoDetailJson.getString("ossVideoPath");
+            String videoTitle = videoDetailJson.getString("title");
+            String shareImgPath = videoDetailJson.getJSONObject("coverImg").getString("coverImgPath");
+            if (StringUtils.isEmpty(ossVideoPath)) {
+                log.warn("ossVideoPath empty for videoId={}, contentId={}", item.getVideoId(), article.getContentId());
+                continue;
+            }
+            VectorMatchVideo recallRecord = new VectorMatchVideo();
+            recallRecord.setContentId(article.getContentId());
+            recallRecord.setVideoId(item.getVideoId());
+            recallRecord.setScore(item.getScore());
+            recallRecord.setConfigCode(item.getConfigCode());
+            recallRecord.setVideoTitle(videoTitle);
+            recallRecord.setVideoOssPath(ossVideoPath);
+            recallRecord.setCoverUrl(shareImgPath);
+            recallRecord.setStatus(1);
+            recallRecord.setCreateTime(new Date());
+            vectorMatchVideoMapper.insertSelective(recallRecord);
+            savedCount++;
+        }
+        log.info("recallWithScore saved {} records, contentId={}", savedCount, article.getContentId());
+    }
+
     private String getRootContentId(String contentId) {
     private String getRootContentId(String contentId) {
         ProducePlanExeRecordExample example = new ProducePlanExeRecordExample();
         ProducePlanExeRecordExample example = new ProducePlanExeRecordExample();
         example.createCriteria().andPlanExeIdEqualTo(contentId);
         example.createCriteria().andPlanExeIdEqualTo(contentId);

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/VideoVectorServiceImpl.java

@@ -22,7 +22,7 @@ public class VideoVectorServiceImpl implements VideoVectorService {
 
 
     @Override
     @Override
     public RecallVideoScoreVO recallWithScore(RecallVideoScoreParam param) {
     public RecallVideoScoreVO recallWithScore(RecallVideoScoreParam param) {
-        String apiUrl = videoVectorApiHost + "/recallWithScore";
+        String apiUrl = videoVectorApiHost + "/videoSearch/recallWithScore";
         try {
         try {
             log.info("recallWithScore request={}", JSON.toJSONString(param));
             log.info("recallWithScore request={}", JSON.toJSONString(param));
             String res = HTTP_CLIENT.post(apiUrl, JSON.toJSONString(param));
             String res = HTTP_CLIENT.post(apiUrl, JSON.toJSONString(param));

+ 12 - 0
long-article-server/src/main/resources/mapper/longarticle/LongArticlesTextMapper.xml

@@ -471,4 +471,16 @@
       create_time = #{createTime,jdbcType=TIMESTAMP}
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where content_id = #{contentId,jdbcType=VARCHAR}
     where content_id = #{contentId,jdbcType=VARCHAR}
   </update>
   </update>
+
+  <select id="selectUnmatchedArticles" resultMap="BaseResultMap">
+    select t.content_id, t.article_title, t.old_article_title, t.article_title_update_account,
+      t.article_title_update_timestamp, t.kimi_title, t.old_kimi_title, t.kimi_title_update_account,
+      t.kimi_title_update_timestamp, t.kimi_summary, t.kimi_keys, t.kimi_status, t.similarity_status,
+      t.start_processing_time, t.result_status, t.create_time
+    from long_articles_text t
+    left join long_articles_vector_match_videos v on t.content_id = v.content_id
+    where v.content_id is null
+      and t.article_title is not null
+      and t.article_title != ''
+  </select>
 </mapper>
 </mapper>

+ 294 - 0
long-article-server/src/main/resources/mapper/longarticle/VectorMatchVideoMapper.xml

@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.piaoquan.longarticle.dao.mapper.longarticle.VectorMatchVideoMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideo">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="content_id" jdbcType="VARCHAR" property="contentId" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="score" jdbcType="DOUBLE" property="score" />
+    <result column="config_code" jdbcType="VARCHAR" property="configCode" />
+    <result column="video_title" jdbcType="VARCHAR" property="videoTitle" />
+    <result column="video_oss_path" jdbcType="VARCHAR" property="videoOssPath" />
+    <result column="cover_url" jdbcType="VARCHAR" property="coverUrl" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, content_id, video_id, score, config_code, video_title, video_oss_path, cover_url, 
+    `status`, create_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from long_articles_vector_match_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from long_articles_vector_match_videos
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from long_articles_vector_match_videos
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideoExample">
+    delete from long_articles_vector_match_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideo">
+    insert into long_articles_vector_match_videos (id, content_id, video_id, 
+      score, config_code, video_title, 
+      video_oss_path, cover_url, `status`, 
+      create_time)
+    values (#{id,jdbcType=BIGINT}, #{contentId,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
+      #{score,jdbcType=DOUBLE}, #{configCode,jdbcType=VARCHAR}, #{videoTitle,jdbcType=VARCHAR}, 
+      #{videoOssPath,jdbcType=VARCHAR}, #{coverUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideo">
+    insert into long_articles_vector_match_videos
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="contentId != null">
+        content_id,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="score != null">
+        score,
+      </if>
+      <if test="configCode != null">
+        config_code,
+      </if>
+      <if test="videoTitle != null">
+        video_title,
+      </if>
+      <if test="videoOssPath != null">
+        video_oss_path,
+      </if>
+      <if test="coverUrl != null">
+        cover_url,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="contentId != null">
+        #{contentId,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="score != null">
+        #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="configCode != null">
+        #{configCode,jdbcType=VARCHAR},
+      </if>
+      <if test="videoTitle != null">
+        #{videoTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="videoOssPath != null">
+        #{videoOssPath,jdbcType=VARCHAR},
+      </if>
+      <if test="coverUrl != null">
+        #{coverUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideoExample" resultType="java.lang.Long">
+    select count(*) from long_articles_vector_match_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update long_articles_vector_match_videos
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.contentId != null">
+        content_id = #{record.contentId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.score != null">
+        score = #{record.score,jdbcType=DOUBLE},
+      </if>
+      <if test="record.configCode != null">
+        config_code = #{record.configCode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.videoTitle != null">
+        video_title = #{record.videoTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="record.videoOssPath != null">
+        video_oss_path = #{record.videoOssPath,jdbcType=VARCHAR},
+      </if>
+      <if test="record.coverUrl != null">
+        cover_url = #{record.coverUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update long_articles_vector_match_videos
+    set id = #{record.id,jdbcType=BIGINT},
+      content_id = #{record.contentId,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      score = #{record.score,jdbcType=DOUBLE},
+      config_code = #{record.configCode,jdbcType=VARCHAR},
+      video_title = #{record.videoTitle,jdbcType=VARCHAR},
+      video_oss_path = #{record.videoOssPath,jdbcType=VARCHAR},
+      cover_url = #{record.coverUrl,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideo">
+    update long_articles_vector_match_videos
+    <set>
+      <if test="contentId != null">
+        content_id = #{contentId,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="score != null">
+        score = #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="configCode != null">
+        config_code = #{configCode,jdbcType=VARCHAR},
+      </if>
+      <if test="videoTitle != null">
+        video_title = #{videoTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="videoOssPath != null">
+        video_oss_path = #{videoOssPath,jdbcType=VARCHAR},
+      </if>
+      <if test="coverUrl != null">
+        cover_url = #{coverUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.VectorMatchVideo">
+    update long_articles_vector_match_videos
+    set content_id = #{contentId,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
+      score = #{score,jdbcType=DOUBLE},
+      config_code = #{configCode,jdbcType=VARCHAR},
+      video_title = #{videoTitle,jdbcType=VARCHAR},
+      video_oss_path = #{videoOssPath,jdbcType=VARCHAR},
+      cover_url = #{coverUrl,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 18 - 20
long-article-server/src/main/resources/mybatis-generator-config.xml

@@ -50,26 +50,24 @@
                              targetProject="long-article-server/src/main/java">
                              targetProject="long-article-server/src/main/java">
             <property name="enableSubPackages" value="true"/>
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
         </javaClientGenerator>
-        <!--        <table tableName="video_content_understanding" domainObjectName="VideoContentUnderstanding" alias=""/>-->
-        <!--        <table tableName="long_articles_match_videos" domainObjectName="MatchVideo" alias="">-->
-        <!--            <columnOverride column="response" javaType="java.lang.String" jdbcType="LONGVARCHAR"/>-->
-        <!--        </table>-->
-        <!--        <table tableName="long_articles_text" domainObjectName="LongArticlesText" alias="">-->
-        <!--            <columnOverride column="article_text" javaType="java.lang.String" jdbcType="LONGVARCHAR"/>-->
-        <!--        </table>-->
-        <!--        <table tableName="long_articles_account_special_settings" domainObjectName="AccountSpecialSettings" alias=""/>-->
-        <!--        <table tableName="ai_video_ab_test" domainObjectName="AIVideoAbTest" alias=""/>-->
-
-        <!--        <table tableName="long_articles_root_source_id" domainObjectName="RootSource" alias=""/>-->
-        <!--        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>-->
-        <!--        <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
-        <!--        <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->
-        <table tableName="long_articles_new_match_videos" domainObjectName="NewMatchVideo" alias=""/>
-
-        <!--        <table tableName="video_keywords_map" domainObjectName="VideoKeywordsMap" alias=""/>-->
-
-        <!--        <table tableName="long_articles_publish_miniprogram" domainObjectName="PublishMiniprogram" alias=""/>-->
-        <!--        <table tableName="get_off_videos" domainObjectName="OffVideo" alias=""/>-->
+<!--        <table tableName="video_content_understanding" domainObjectName="VideoContentUnderstanding" alias=""/>-->
+<!--        <table tableName="long_articles_match_videos" domainObjectName="MatchVideo" alias="">-->
+<!--            <columnOverride column="response" javaType="java.lang.String" jdbcType="LONGVARCHAR"/>-->
+<!--        </table>-->
+<!--        <table tableName="long_articles_text" domainObjectName="LongArticlesText" alias="">-->
+<!--            <columnOverride column="article_text" javaType="java.lang.String" jdbcType="LONGVARCHAR"/>-->
+<!--        </table>-->
+<!--        <table tableName="long_articles_account_special_settings" domainObjectName="AccountSpecialSettings" alias=""/>-->
+<!--        <table tableName="ai_video_ab_test" domainObjectName="AIVideoAbTest" alias=""/>-->
+<!--        <table tableName="long_articles_root_source_id" domainObjectName="RootSource" alias=""/>-->
+<!--        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>-->
+<!--        <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
+<!--        <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->
+<!--        <table tableName="long_articles_new_match_videos" domainObjectName="NewMatchVideo" alias=""/>-->
+<!--        <table tableName="video_keywords_map" domainObjectName="VideoKeywordsMap" alias=""/>-->
+<!--        <table tableName="long_articles_publish_miniprogram" domainObjectName="PublishMiniprogram" alias=""/>-->
+<!--        <table tableName="get_off_videos" domainObjectName="OffVideo" alias=""/>-->
+        <table tableName="long_articles_vector_match_videos" domainObjectName="VectorMatchVideo" alias=""/>
 
 
     </context>
     </context>