xueyiming il y a 7 mois
Parent
commit
6309850ac5
24 fichiers modifiés avec 114 ajouts et 1848 suppressions
  1. 0 36
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/LongArticlesTextMapper.java
  2. 0 30
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/OffVideoMapper.java
  3. 1 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/GetContentsParam.java
  4. 15 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushRecordParam.java
  5. 34 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushRecordVO.java
  6. 0 10
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/KimiService.java
  7. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/MatchVideoService.java
  8. 2 7
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java
  9. 11 7
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java
  10. 0 47
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/KimiServiceImpl.java
  11. 0 255
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/MatchVideoServiceImpl.java
  12. 3 3
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/AigcService.java
  13. 48 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java
  14. 0 83
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/DouyinSearch.java
  15. 0 85
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/GetContentUtil.java
  16. 0 147
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/HkspSearch.java
  17. 0 56
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/KimiAPI.java
  18. 0 37
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/OSSUploader.java
  19. 0 88
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/OpenAIAPI.java
  20. 0 55
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/SortUtil.java
  21. 0 161
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/VideoDownloader.java
  22. 0 208
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/XiGuaUtils.java
  23. 0 293
      long-article-server/src/main/resources/mapper/LongArticlesTextMapper.xml
  24. 0 231
      long-article-server/src/main/resources/mapper/OffVideoMapper.xml

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

@@ -1,36 +0,0 @@
-package com.tzld.piaoquan.longarticle.dao.mapper;
-
-import com.tzld.piaoquan.longarticle.model.po.LongArticlesText;
-import com.tzld.piaoquan.longarticle.model.po.LongArticlesTextExample;
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-public interface LongArticlesTextMapper {
-    long countByExample(LongArticlesTextExample example);
-
-    int deleteByExample(LongArticlesTextExample example);
-
-    int deleteByPrimaryKey(String contentId);
-
-    int insert(LongArticlesText record);
-
-    int insertSelective(LongArticlesText record);
-
-    List<LongArticlesText> selectByExampleWithBLOBs(LongArticlesTextExample example);
-
-    List<LongArticlesText> selectByExample(LongArticlesTextExample example);
-
-    LongArticlesText selectByPrimaryKey(String contentId);
-
-    int updateByExampleSelective(@Param("record") LongArticlesText record, @Param("example") LongArticlesTextExample example);
-
-    int updateByExampleWithBLOBs(@Param("record") LongArticlesText record, @Param("example") LongArticlesTextExample example);
-
-    int updateByExample(@Param("record") LongArticlesText record, @Param("example") LongArticlesTextExample example);
-
-    int updateByPrimaryKeySelective(LongArticlesText record);
-
-    int updateByPrimaryKeyWithBLOBs(LongArticlesText record);
-
-    int updateByPrimaryKey(LongArticlesText record);
-}

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

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

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleSystemGetContentsParam.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/GetContentsParam.java

@@ -5,7 +5,7 @@ import lombok.Setter;
 
 @Getter
 @Setter
-public class LongArticleSystemGetContentsParam {
+public class GetContentsParam {
 
     //"计划ID")
     private String planId;

+ 15 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushRecordParam.java

@@ -0,0 +1,15 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@Getter
+@Setter
+@ToString
+public class PushRecordParam {
+    //计划ID")
+    private String planId;
+    //账号ID")
+    private String publishAccountId;
+}

+ 34 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushRecordVO.java

@@ -0,0 +1,34 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+@Getter
+@Setter
+@Accessors(chain = true)
+@ToString
+public class PushRecordVO {
+    //推送ID")
+    private String pushId;
+    //计划ID")
+    private String planId;
+    //账号ID")
+    private String publishAccountId;
+    //推送方式,1-手动推送;2-自动群发;3-自动发表;4-自动发布;5-分组群发;6-触发推送")
+    private Integer pushType;
+    //推送到草稿箱状态(0-待推送,1-推送中,2-推送成功,3-推送失败)")
+    private Integer pushStatus;
+    //发表状态(-1-未推送不能发表,0-待发表,1-发表中,2-发表成功,3-发表失败)")
+    private Integer publishStatus;
+    //错误代码")
+    private String errorCode;
+    //错误信息")
+    private String errorMsg;
+    //推送计划时间戳")
+    private Long pushScheduleTimestamp;
+    //推送完成时间戳")
+    private Long pushFinishTimestamp;
+}

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

@@ -1,10 +0,0 @@
-package com.tzld.piaoquan.longarticle.service.local;
-
-import com.tzld.piaoquan.longarticle.model.po.LongArticlesText;
-
-public interface KimiService {
-
-    void addContent(String contentId, String articleTitle, String articleText);
-
-    LongArticlesText getKimiText(String contentId);
-}

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

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service.local;
-
-public interface MatchVideoService {
-}

+ 2 - 7
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java

@@ -6,8 +6,6 @@ import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
 import com.tzld.piaoquan.longarticle.dao.mapper.CrawlerVideoMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.MatchVideoMapper;
-import com.tzld.piaoquan.longarticle.dao.mapper.PublishContentMapper;
-import com.tzld.piaoquan.longarticle.dao.mapper.PublishMiniprogramMapper;
 import com.tzld.piaoquan.longarticle.model.bo.PublishMiniprogramBo;
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
 import com.tzld.piaoquan.longarticle.model.dto.ArticleSortRequest;
@@ -17,7 +15,6 @@ import com.tzld.piaoquan.longarticle.model.dto.PublishArticleData;
 import com.tzld.piaoquan.longarticle.model.po.*;
 import com.tzld.piaoquan.longarticle.model.vo.*;
 import com.tzld.piaoquan.longarticle.service.local.ContentService;
-import com.tzld.piaoquan.longarticle.service.local.KimiService;
 import com.tzld.piaoquan.longarticle.service.remote.AigcService;
 import com.tzld.piaoquan.longarticle.service.remote.SortService;
 import com.tzld.piaoquan.longarticle.service.remote.VideoService;
@@ -25,12 +22,10 @@ import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.util.*;
-import java.util.concurrent.TimeUnit;
 
 @Slf4j
 @Service
@@ -120,19 +115,19 @@ public class ContentServiceImpl implements ContentService {
 
     public List<PublishArticleData> getWaitingSort(PlanAccount planAccount) {
         //获取待排序数据
-        LongArticleSystemGetContentsParam waitingSortParam = new LongArticleSystemGetContentsParam();
+        GetContentsParam waitingSortParam = new GetContentsParam();
         waitingSortParam.setPlanId(planAccount.getPlanId());
         waitingSortParam.setAccountId(planAccount.getAccountId());
         waitingSortParam.setPageNum(1);
         waitingSortParam.setPageSize(planAccount.getPublishPreNum());
         LongArticleSystemContentVO longArticleSystemContentVO = aigcService.listWaitingSortContents(waitingSortParam);
-        log.info("aigcService.listWaitingSortContents={}", longArticleSystemContentVO);
         if (longArticleSystemContentVO == null
                 || longArticleSystemContentVO.getTotalCount() < planAccount.getPublishPreMinNum()
                 || CollectionUtils.isEmpty(longArticleSystemContentVO.getContentItemList())
                 || longArticleSystemContentVO.getContentItemList().size() < planAccount.getPublishPreMinNum()) {
             return new ArrayList<>();
         }
+        log.info("aigcService.listWaitingSortContents.total={}", longArticleSystemContentVO.getTotalCount());
         List<PublishArticleData> waitSortList = new ArrayList<>();
         for (ContentItemVO contentItemVO : longArticleSystemContentVO.getContentItemList()) {
             PublishArticleData publishArticleData = new PublishArticleData();

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

@@ -4,11 +4,15 @@ import com.alibaba.fastjson.JSON;
 import com.tzld.piaoquan.longarticle.common.constants.TimeConstant;
 import com.tzld.piaoquan.longarticle.common.enums.ContentStatusEnum;
 import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
-import com.tzld.piaoquan.longarticle.dao.mapper.*;
+import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.PublishContentMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.PublishMiniprogramMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.RootSourceMapper;
 import com.tzld.piaoquan.longarticle.model.bo.MatchContent;
 import com.tzld.piaoquan.longarticle.model.bo.PublishMiniprogramBo;
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
-import com.tzld.piaoquan.longarticle.model.dto.*;
+import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
+import com.tzld.piaoquan.longarticle.model.dto.PublishArticleData;
 import com.tzld.piaoquan.longarticle.model.po.*;
 import com.tzld.piaoquan.longarticle.model.vo.*;
 import com.tzld.piaoquan.longarticle.service.local.CoreService;
@@ -31,7 +35,10 @@ import org.springframework.util.CollectionUtils;
 import java.math.BigDecimal;
 import java.time.LocalTime;
 import java.util.*;
-import java.util.concurrent.*;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -53,9 +60,6 @@ public class CoreServiceImpl implements CoreService {
     @Autowired
     private VideoService videoService;
 
-    @Autowired
-    private KimiServiceImpl kimiService;
-
     @Autowired
     private CardServiceImpl cardService;
 
@@ -187,7 +191,7 @@ public class CoreServiceImpl implements CoreService {
                 return;
             }
             for (PlanAccount planAccount : matchPlanAccounts) {
-                LongArticleSystemGetContentsParam param = new LongArticleSystemGetContentsParam();
+                GetContentsParam param = new GetContentsParam();
                 param.setAccountId(planAccount.getAccountId());
                 param.setPlanId(planAccount.getPlanId());
                 LongArticleSystemContentVO longArticleSystemContentVO = aigcService.getContentItemList(param);

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

@@ -1,47 +0,0 @@
-package com.tzld.piaoquan.longarticle.service.local.impl;
-
-import com.tzld.piaoquan.longarticle.dao.mapper.LongArticlesTextMapper;
-import com.tzld.piaoquan.longarticle.model.po.LongArticlesText;
-import com.tzld.piaoquan.longarticle.model.po.LongArticlesTextExample;
-import com.tzld.piaoquan.longarticle.service.local.KimiService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import java.util.List;
-
-@Service
-public class KimiServiceImpl implements KimiService {
-
-    @Autowired
-    LongArticlesTextMapper longArticlesTextMapper;
-
-    @Override
-    public void addContent(String contentId, String articleTitle, String articleText) {
-
-        LongArticlesTextExample example = new LongArticlesTextExample();
-        example.createCriteria().andContentIdEqualTo(contentId);
-        long l = longArticlesTextMapper.countByExample(example);
-        if (l == 0) {
-            LongArticlesText longArticlesText = new LongArticlesText();
-            longArticlesText.setContentId(contentId);
-            longArticlesText.setArticleTitle(articleTitle);
-            longArticlesText.setArticleText(articleText);
-            longArticlesText.setKimiStatus(0);
-            longArticlesTextMapper.insertSelective(longArticlesText);
-        }
-        longArticlesTextMapper.selectByExample(example);
-
-    }
-
-    @Override
-    public LongArticlesText getKimiText(String contentId) {
-        LongArticlesTextExample example = new LongArticlesTextExample();
-        example.createCriteria().andContentIdEqualTo(contentId);
-        List<LongArticlesText> longArticlesTexts = longArticlesTextMapper.selectByExample(example);
-        if(CollectionUtils.isEmpty(longArticlesTexts)){
-            return null;
-        }
-        return longArticlesTexts.get(0);
-    }
-}

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

@@ -1,255 +0,0 @@
-package com.tzld.piaoquan.longarticle.service.local.impl;
-
-import cn.hutool.json.JSONObject;
-import com.alibaba.fastjson.JSONArray;
-import com.tzld.piaoquan.longarticle.dao.mapper.CrawlerVideoMapper;
-import com.tzld.piaoquan.longarticle.dao.mapper.MatchVideoMapper;
-import com.tzld.piaoquan.longarticle.model.po.*;
-import com.tzld.piaoquan.longarticle.model.vo.MatchVideoVo;
-import com.tzld.piaoquan.longarticle.service.local.KimiService;
-import com.tzld.piaoquan.longarticle.service.local.MatchVideoService;
-import com.tzld.piaoquan.longarticle.utils.*;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import java.util.*;
-
-@Service
-public class MatchVideoServiceImpl implements MatchVideoService {
-
-    private static final int MAX_NUM = 3;
-
-    @Autowired
-    KimiService kimiService;
-
-    @Autowired
-    private MatchVideoMapper matchVideoMapper;
-
-    @Autowired
-    private CrawlerVideoMapper crawlerVideoMapper;
-
-    public void addMatchVideo(MatchVideoVo matchVideoVo) {
-        MatchVideoExample example = new MatchVideoExample();
-        example.createCriteria().andContentIdEqualTo(matchVideoVo.getArticleId()).andGhIdEqualTo(matchVideoVo.getGhId());
-        long l = matchVideoMapper.countByExample(example);
-        if (l > 0) {
-            return;
-        }
-        String traceId = "search-" + UUID.randomUUID();
-        MatchVideo matchVideo = new MatchVideo();
-        matchVideo.setTraceId(traceId);
-        matchVideo.setContentId(matchVideoVo.getArticleId());
-        matchVideo.setAccountName(matchVideoVo.getAccountName());
-        matchVideo.setFlowPoolLevel(matchVideo.getFlowPoolLevel());
-        matchVideo.setProcessTimes(1);
-        matchVideo.setContentStatus(0);
-        long timestamp = System.currentTimeMillis() / 1000;
-        matchVideo.setContentStatusUpdateTime(Long.valueOf(timestamp).intValue());
-        matchVideoMapper.insertSelective(matchVideo);
-    }
-
-    public void matchContent() {
-        CrawlerVideoExample example = new CrawlerVideoExample();
-        example.createCriteria().andDownloadStatusEqualTo(0);
-        crawlerVideoMapper.selectByExample(example);
-    }
-
-    public Boolean existHistoryContent(String contentId) {
-        CrawlerVideoExample example = new CrawlerVideoExample();
-        example.createCriteria().andContentIdEqualTo(contentId).andDownloadStatusEqualTo(2);
-        long l = crawlerVideoMapper.countByExample(example);
-        return l >= MAX_NUM;
-    }
-
-    public void pushOss(String traceId) {
-        CrawlerVideoExample example = new CrawlerVideoExample();
-        example.createCriteria().andTraceIdEqualTo(traceId).andDownloadStatusEqualTo(0);
-        List<CrawlerVideo> crawlerVideoList = crawlerVideoMapper.selectByExampleWithBLOBs(example);
-        if (CollectionUtils.isEmpty(crawlerVideoList)) {
-            return;
-        }
-        for (CrawlerVideo crawlerVideo : crawlerVideoList) {
-            String platform = crawlerVideo.getPlatform();
-            String outVideoId = crawlerVideo.getOutVideoId();
-            String videoPath = VideoDownloader.generateVideoPath(platform, outVideoId);
-            String coverPath = VideoDownloader.generateCoverPath(platform, outVideoId);
-            videoPath = VideoDownloader.downloadVideo(videoPath, platform, crawlerVideo.getVideoUrl(), "video");
-            coverPath = VideoDownloader.downloadCover(coverPath, platform, crawlerVideo.getCoverUrl());
-            if (StringUtils.isNotEmpty(videoPath) && StringUtils.isNotEmpty(coverPath)) {
-                String videoOssPath = OSSUploader.uploadToOSS(videoPath, "video");
-                String coverOssPath = OSSUploader.uploadToOSS(coverPath, "image");
-                if (StringUtils.isNotEmpty(videoOssPath) && StringUtils.isNotEmpty(coverOssPath)) {
-                    CrawlerVideo udpateCrawlerVideo = new CrawlerVideo();
-                    udpateCrawlerVideo.setVideoOssPath(videoOssPath);
-                    udpateCrawlerVideo.setCoverOssPath(coverOssPath);
-                    udpateCrawlerVideo.setId(crawlerVideo.getId());
-                    udpateCrawlerVideo.setDownloadStatus(2);
-                    crawlerVideoMapper.updateByPrimaryKeySelective(udpateCrawlerVideo);
-                }
-            }
-        }
-    }
-
-    public boolean addVideo(String contentId, String traceId) {
-        LongArticlesText kimiText = kimiService.getKimiText(contentId);
-        if (kimiText == null) {
-            //TODO 报警  KIMI查询不到
-            return false;
-        }
-        List<JSONObject> video = getVideo(contentId, kimiText);
-        List<JSONObject> jsonObjects = SortUtil.titleSimilarityRank(kimiText.getKimiTitle(), video);
-        List<CrawlerVideo> crawlerVideoList = getCrawlerVideoList(jsonObjects, traceId, contentId);
-        if (!CollectionUtils.isEmpty(crawlerVideoList)) {
-            for (CrawlerVideo crawlerVideo : crawlerVideoList) {
-                crawlerVideoMapper.insertSelective(crawlerVideo);
-            }
-        }
-        System.out.println();
-        System.out.println();
-        System.out.println(crawlerVideoList);
-        return false;
-    }
-
-    private List<CrawlerVideo> getCrawlerVideoList(List<JSONObject> jsonObjects, String traceId, String contentId) {
-        List<CrawlerVideo> crawlerVideoList = new ArrayList<>();
-        for (JSONObject jsonObject : jsonObjects) {
-            String platform = jsonObject.getStr("platform");
-            CrawlerVideo crawlerVideo = new CrawlerVideo();
-            crawlerVideo.setContentId(contentId);
-            crawlerVideo.setTraceId(traceId);
-            crawlerVideo.setPlatform(platform);
-            if (Objects.equals(platform, "dy_search")) {
-                crawlerVideo.setOutVideoId(jsonObject.getStr("channel_content_id"));
-                crawlerVideo.setVideoTitle(jsonObject.getStr("title"));
-                crawlerVideo.setPublishTime(jsonObject.getDate("publish_timestamp"));
-                List<JSONObject> videoUrlList = jsonObject.get("video_url_list", List.class);
-                if (!CollectionUtils.isEmpty(videoUrlList)) {
-                    crawlerVideo.setVideoUrl(videoUrlList.get(0).getStr("video_url"));
-                    crawlerVideo.setDuration(videoUrlList.get(0).getInt("video_duration"));
-                }
-                List<JSONObject> imageUrlList = jsonObject.get("image_url_list", List.class);
-                if (!CollectionUtils.isEmpty(imageUrlList)) {
-                    crawlerVideo.setCoverUrl(imageUrlList.get(0).getStr("image_url"));
-                }
-                crawlerVideo.setPlayCount(jsonObject.getInt("play_count"));
-                crawlerVideo.setLikeCount(jsonObject.getInt("like_count"));
-                crawlerVideo.setScore(jsonObject.getFloat("score"));
-                if (cheakCrawlerVideo(crawlerVideo)) {
-                    crawlerVideoList.add(crawlerVideo);
-                }
-
-                continue;
-            }
-            if (Objects.equals(platform, "baidu_search")) {
-                crawlerVideo.setOutVideoId(jsonObject.getStr("id"));
-                crawlerVideo.setVideoTitle(jsonObject.getStr("title"));
-                crawlerVideo.setPublishTime(jsonObject.getDate("publish_timestamp"));
-                crawlerVideo.setVideoUrl(jsonObject.getStr("playurl"));
-                crawlerVideo.setCoverUrl(jsonObject.getStr("poster"));
-                crawlerVideo.setPlayCount(jsonObject.getInt("play_cnt"));
-                crawlerVideo.setLikeCount(jsonObject.getInt("like_count") == null ? 0 : jsonObject.getInt("like_count"));
-                crawlerVideo.setDuration(jsonObject.getInt("duration"));
-                crawlerVideo.setScore(jsonObject.getFloat("score"));
-                if (cheakCrawlerVideo(crawlerVideo)) {
-                    crawlerVideoList.add(crawlerVideo);
-                }
-                continue;
-            }
-        }
-        return crawlerVideoList;
-    }
-
-    private boolean cheakCrawlerVideo(CrawlerVideo crawlerVideo) {
-        if (StringUtils.isEmpty(crawlerVideo.getOutVideoId())) {
-            return false;
-        }
-        if (StringUtils.isEmpty(crawlerVideo.getVideoUrl())) {
-            return false;
-        }
-        if (StringUtils.isEmpty(crawlerVideo.getCoverUrl())) {
-            return false;
-        }
-        if (StringUtils.isEmpty(crawlerVideo.getPlatform())) {
-            return false;
-        }
-        if (Objects.isNull(crawlerVideo.getPublishTime())) {
-            crawlerVideo.setPublishTime(new Date());
-        }
-        if (Objects.isNull(crawlerVideo.getDuration())) {
-            crawlerVideo.setDuration(0);
-        }
-        if (Objects.isNull(crawlerVideo.getPlayCount())) {
-            crawlerVideo.setPlayCount(0);
-        }
-        if (Objects.isNull(crawlerVideo.getLikeCount())) {
-            crawlerVideo.setLikeCount(0);
-        }
-        if (Objects.isNull(crawlerVideo.getShareCount())) {
-            crawlerVideo.setShareCount(0);
-        }
-        return true;
-    }
-
-    public List<JSONObject> getVideo(String contentId, LongArticlesText kimiText) {
-
-        List<JSONObject> res = new ArrayList<>();
-        List<JSONObject> kimiSummarys = searchVideo(kimiText.getKimiSummary().substring(0, 15), new ArrayList<>(), "");
-        if (!CollectionUtils.isEmpty(kimiSummarys)) {
-            res.addAll(kimiSummarys);
-        }
-        if (res.size() > 3) {
-            return res;
-        }
-        List<JSONObject> kimiTitles = searchVideo(kimiText.getKimiTitle().substring(0, 15), new ArrayList<>(), "");
-        if (!CollectionUtils.isEmpty(kimiTitles)) {
-            res.addAll(kimiTitles);
-        }
-        if (res.size() > 3) {
-            return res;
-        }
-        String kimiKeys = kimiText.getKimiKeys();
-        JSONArray jsonArray = JSONArray.parseArray(kimiKeys);
-        if (jsonArray == null || jsonArray.isEmpty()) {
-            return res;
-        }
-        for (int i = 0; i < jsonArray.size(); i++) {
-            String key = jsonArray.getString(i);
-            List<JSONObject> keys = searchVideo(key, new ArrayList<>(), "");
-            if (!CollectionUtils.isEmpty(keys)) {
-                res.addAll(keys);
-            }
-            if (res.size() > 3) {
-                return res;
-            }
-        }
-        return res;
-    }
-
-
-    public List<JSONObject> searchVideo(String keyword, List<String> words, String traceId) {
-        List<JSONObject> jsonObjects = DouyinSearch.douyinSearch(keyword, words, traceId);
-        if (!CollectionUtils.isEmpty(jsonObjects)) {
-            for (JSONObject jsonObject : jsonObjects) {
-                jsonObject.put("platform", "dy_search");
-            }
-        }
-        if (jsonObjects.size() >= 3) {
-            return jsonObjects;
-        }
-        List<JSONObject> jsonObjects1 = HkspSearch.hkspSearch(keyword, words, traceId);
-        if (CollectionUtils.isEmpty(jsonObjects1)) {
-            return jsonObjects;
-        }
-        for (JSONObject jsonObject : jsonObjects1) {
-            jsonObject.put("platform", "baidu_search");
-        }
-        if (CollectionUtils.isEmpty(jsonObjects)) {
-            return jsonObjects1;
-        }
-        jsonObjects.addAll(jsonObjects1);
-        return jsonObjects;
-    }
-
-}

+ 3 - 3
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/AigcService.java

@@ -8,11 +8,11 @@ public interface AigcService {
 
     List<LongArticleSystemPlan> getAllLongArticleSystemPlan();
 
-    LongArticleSystemContentVO getContentItemList(LongArticleSystemGetContentsParam param);
+    LongArticleSystemContentVO getContentItemList(GetContentsParam param);
 
-    LongArticleSystemContentVO listWaitingMatchMiniprogramContents(LongArticleSystemGetContentsParam param);
+    LongArticleSystemContentVO listWaitingMatchMiniprogramContents(GetContentsParam param);
 
-    LongArticleSystemContentVO listWaitingSortContents(LongArticleSystemGetContentsParam param);
+    LongArticleSystemContentVO listWaitingSortContents(GetContentsParam param);
 
     String createPushTask(CreatePushTaskParam param);
 

+ 48 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java

@@ -14,12 +14,13 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Slf4j
 @Service
 public class AigcServiceImpl implements AigcService {
 
-    private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 5000, 20, 100, 3, 3000);
+    private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 8000, 20, 100, 3, 3000);
 
     @Override
     //获取所有长文系统托管计划
@@ -41,7 +42,7 @@ public class AigcServiceImpl implements AigcService {
     }
 
     @Override
-    public LongArticleSystemContentVO getContentItemList(LongArticleSystemGetContentsParam param) {
+    public LongArticleSystemContentVO getContentItemList(GetContentsParam param) {
         int pageNum = 1;
         int pageSize = 500;
         param.setPageNum(pageNum);
@@ -64,7 +65,7 @@ public class AigcServiceImpl implements AigcService {
 
     @Override
     //分页获取待匹配内容列表
-    public LongArticleSystemContentVO listWaitingMatchMiniprogramContents(LongArticleSystemGetContentsParam param) {
+    public LongArticleSystemContentVO listWaitingMatchMiniprogramContents(GetContentsParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/listWaitingMatchMiniprogramContents";
         try {
             String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
@@ -80,7 +81,7 @@ public class AigcServiceImpl implements AigcService {
     }
 
     //分页获取待匹配内容列表
-    public LongArticleSystemContentVO listWaitingSortContents(LongArticleSystemGetContentsParam param) {
+    public LongArticleSystemContentVO listWaitingSortContents(GetContentsParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/listWaitingSortContents";
         try {
             String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
@@ -184,4 +185,47 @@ public class AigcServiceImpl implements AigcService {
         }
         return null;
     }
+
+    public static List<PushRecordVO> getTodayPushRecords(PushRecordParam param) {
+        String apiUrl = "http://aigc-api.cybertogether.net//aigc/publish/LongArticleSystem/getTodayPushRecords";
+        try {
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSONObject.toJSONString(param));
+            JSONObject jsonObject = JSON.parseObject(res);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                JSONArray data = jsonObject.getJSONArray("data");
+                if (CollectionUtils.isEmpty(data)) {
+                    return null;
+                }
+                return data.toJavaList(PushRecordVO.class);
+            }
+            return null;
+        } catch (Exception e) {
+            log.error("pushCover error", e);
+        }
+        return null;
+    }
+
+//    public static void main(String[] args) {
+//        PushRecordParam param = new PushRecordParam();
+//        param.setPlanId("20241107121550727253090");
+//        param.setPublishAccountId("20241107095007512448872");
+//        List<PushRecordVO> todayPushRecords = getTodayPushRecords(param);
+//        int count = 0;
+//        if (CollectionUtils.isEmpty(todayPushRecords)) {
+//            return;
+//        }
+//
+//        List<PushRecordVO> collect = todayPushRecords.stream()
+//                .filter(e -> ((e.getPushStatus() != 3) && (e.getPublishStatus() != 3))).collect(Collectors.toList());
+//        if (CollectionUtils.isEmpty(collect)) {
+//            return;
+//        }
+//        for (PushRecordVO pushRecordVO : collect) {
+//            count += pushRecordVO.
+//        }
+//        System.out.println(count);
+//    }
+
+
 }

+ 0 - 83
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/DouyinSearch.java

@@ -1,83 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
-import cn.hutool.json.JSONUtil;
-import cn.hutool.json.JSONObject;
-import java.util.ArrayList;
-import java.util.List;
-
-public class DouyinSearch {
-
-    public static List<JSONObject> douyinSearch(String keyword, List<String> sensitiveWords, String traceId) {
-        return new ArrayList<>();
-//        String url = "http://8.217.190.241:8888/crawler/dou_yin/top_hub_content";
-//        JSONObject payload = new JSONObject();
-//        payload.put("keyword", keyword);
-//        payload.put("category", "全部");
-//        payload.put("period", "近90天");
-//        payload.put("content_modal", "视频");
-//        payload.put("cursor", "");
-//
-//        HttpResponse response = HttpRequest.post(url)
-//                .header("Content-Type", "application/json")
-//                .body(payload.toString())
-//                .execute();
-//
-//        List<JSONObject> resultList = new ArrayList<>();
-//
-//        try {
-//            JSONObject jsonResponse = JSONUtil.parseObj(response.body());
-//            List<JSONObject> dtList = jsonResponse.getByPath("data.data", List.class);
-//
-//            for (JSONObject obj : dtList) {
-//                try {
-//                    String title = obj.getStr("video_desc");
-//                    String videoId = obj.getStr("video_id");
-//                    int duration = obj.getInt("duration");
-//
-//                    if (sensitiveFlag(sensitiveWords.toString(), title) && duration < 30000) {
-//                        JSONObject res = douyinDetail(videoId);
-//                        if (res != null) {
-//                            resultList.add(res);
-//                        }
-//                    }
-//                } catch (Exception e) {
-//                    System.out.println(e.getMessage());
-//                    // 处理异常
-//                }
-//            }
-//
-//            return resultList;
-//        } catch (Exception e) {
-//            return new ArrayList<>();
-//        }
-    }
-
-    public static JSONObject douyinDetail(String videoId) {
-        System.out.println(videoId);
-        String url = "http://8.217.190.241:8888/crawler/dou_yin/detail";
-        JSONObject payload = new JSONObject();
-        payload.put("content_id", videoId);
-
-        HttpResponse response = HttpRequest.post(url)
-                .header("Content-Type", "application/json")
-                .body(payload.toString())
-                .execute();
-
-        JSONObject videoInfo = JSONUtil.parseObj(response.body()).getByPath("data.data", JSONObject.class);
-
-        if ("note".equals(videoInfo.getStr("content_type"))) {
-            return null;
-        } else {
-            return videoInfo;
-        }
-    }
-
-    private static boolean sensitiveFlag(String sensitiveWords, String title) {
-        // 实现敏感词检查逻辑
-        return true; // 示例
-    }
-
-}
-
-

+ 0 - 85
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/GetContentUtil.java

@@ -1,85 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-
-import com.alibaba.fastjson.JSONObject;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.Objects;
-
-public class GetContentUtil {
-    public static void main(String[] args) {
-        String articleTitle = "中国宣布重大消息,韩国被吓,美国不服气,俄罗斯和朝鲜都笑了!";
-        String articleContent = "在当前国际政治舞台上,中朝关系、朝鲜半岛安全局势以及广泛的国际政治关系如同一副错综复杂的画卷,引人注目。\n" +
-                "近期,中国外交部副部长孙卫东带领的代表团访问平壤的消息,为这幅画卷添上了新的一笔,引发了外界对中朝关系未来走向的广泛关注。\n" +
-                "自1949年10月6日中华人民共和国与朝鲜民主主义人民共和国正式建交以来,两国之间的友好合作关系历经风雨,但总体上保持稳定发展。\n" +
-                "两国在多个领域展开了深入合作,包括文化、教育、科技、体育和民生等领域,这些合作不仅加深了两国人民之间的相互理解和友谊,也为地区乃至全球的和平与发展作出了贡献。\n" +
-                "在经济领域,作为朝鲜的重要贸易伙伴和物质援助国,中国对于朝鲜的经济发展起着至关重要的支持作用。中国提供的各种援助,帮助朝鲜在经济上保持稳定,助推其发展。\n" +
-                "而在政治领域,中国一直致力于推动实现半岛无核化,维护朝鲜半岛及地区的和平稳定。在这一过程中,中朝两国保持了密切的沟通与协调。\n" +
-                "\n" +
-                "然而,朝鲜半岛的局势一直是国际政治关系中的一个热点问题。近年来,美国、日本和韩国加强了对朝鲜的军事压力,通过扩大联合军演、部署战略武器等方式,不断提升在半岛的军事存在感,这无疑增加了地区的紧张气氛。对此,俄罗斯表达了对朝鲜的支持,批评美日韩的军事行动,认为这些行动加剧了地区的不稳定因素。\n" +
-                "在这个背景下,中国外交部副部长孙卫东此次访问朝鲜,显得尤为重要。此访旨在深化中朝传统友好,特别是在两国建交75周年之际,进一步加强经济合作,并就朝鲜半岛局势等共同关心的国际和地区问题交换意见。\n" +
-                "这次访问不仅是两国关系发展的一个里程碑,也是在当前复杂国际形势下,中国致力于维护地区和平稳定、推动构建人类命运共同体理念的一个重要体现。\n" +
-                "中朝双方的此次接触,无疑将为推动解决朝鲜半岛问题、维护地区和平稳定发挥积极作用。作为朝鲜半岛问题的直接相关方和重要的地区国家,中国一直倡导通过对话和协商解决问题,反对外部势力的军事干预和压力策略,这一立场在当前形势下显得尤为重要。\n" +
-                "\n" +
-                "未来,随着国际形势的不断变化,中朝之间的合作将更加多元化和深入。两国之间不仅在经济上互为支持,在维护地区和平稳定、推动构建更加公正合理的国际政治经济新秩序方面,也将发挥更加积极的作用。\n" +
-                "作为国际社会的一份子,希望所有国家都能本着相互尊重、平等互利的原则,共同努力,为实现地区乃至全球的和平、稳定与发展作出应有的贡献。\n" +
-                "在国际政治的大棋局中,中朝关系、朝鲜半岛的安全局势和国际政治关系的发展方向,始终是全球关注的焦点。本次中国外交部副部长孙卫东访问朝鲜,不仅是对两国传统友谊的再次肯定,更是在复杂的国际环境中,为维护地区和平稳定、推动构建人类命运共同体贡献中国的智慧和力量。\n" +
-                "让我们共同关注并支持这一重要的外交行动,期待它为地区乃至全球的和平与发展带来积极影响。转发此消息,让更多人了解国际局势的最新动向,共同为世界和平与稳定发声。";
-        String titleTxt = articleTitle + "\n" + promptGenerate("title");
-//        String kimiTitle = KimiAPI.chat(titleTxt);
-        String kimiTitle = "";
-        if (StringUtils.isEmpty(kimiTitle)) {
-            kimiTitle = OpenAIAPI.chat(titleTxt);
-        }
-        if (StringUtils.isEmpty(kimiTitle)) {
-            //TODO 处理异常
-            System.out.println("error");
-        }
-        kimiTitle = kimiTitle.replaceAll("'", "").replaceAll("\"", "").replace("\\", "");
-        System.out.println(kimiTitle);
-        String contentTxt = promptGenerate("text") + "\n" + articleContent;
-//        String kimiContent = KimiAPI.chat(contentTxt);
-        String kimiContent = "";
-        if (StringUtils.isEmpty(kimiContent)) {
-            kimiContent = OpenAIAPI.chat(contentTxt);
-        }
-        if (StringUtils.isEmpty(kimiContent)) {
-            //TODO 处理异常
-            System.out.println("error");
-        }
-        JSONObject jsonObject = JSONObject.parseObject(kimiContent);
-
-
-    }
-
-
-    public static String promptGenerate(String promptType) {
-        if (Objects.equals(promptType, "title")) {
-            return " 请将以上标题改写成适合小程序点击和传播的小程序标题,小程序标题的写作规范如下,请学习后进行小程序标题的编写。直接输出最终的小程序标题\n" +
-                    "                小程序标题写作规范:\n" +
-                    "                1.要点前置:将最重要的信息放在标题的最前面,以快速吸引读者的注意力。例如,“5月一辈子同学,三辈子亲,送给我的老同学,听哭无数人!”中的“5月”和“一辈子同学,三辈子亲”都是重要的信息点。\n" +
-                    "                2.激发情绪:使用能够触动人心的语言,激发读者的情感共鸣。如“只剩两人同学聚会,看后感动落泪。”使用“感动落泪”激发读者的同情和怀旧情绪。\n" +
-                    "                3.使用数字和特殊符号:数字可以提供具体性,而特殊符号如“\uD83D\uDD34”、“\uD83D\uDE04”、“\uD83D\uDD25”等可以吸引视觉注意力,增加点击率。\n" +
-                    "                4.悬念和好奇心:创建悬念或提出问题,激发读者的好奇心。例如,“太神奇了!长江水位下降,重庆出现惊奇一幕!”中的“惊奇一幕”就是一个悬念。\n" +
-                    "                5.名人效应:如果内容与知名人士相关,提及他们的名字可以增加标题的吸引力。\n" +
-                    "                6.社会价值观:触及读者的文化和社会价值观,如家庭、友情、国家荣誉等。\n" +
-                    "                7.标点符号的运用:使用感叹号、问号等标点来增强语气和情感表达。\n" +
-                    "                8.直接的语言:使用直白、口语化的语言,易于理解,如“狗屁股,笑死我了!”。\n" +
-                    "                9.热点人物或事件:提及当前的热点人物或事件,利用热点效应吸引读者。\n" +
-                    "                10.字数适中:保持标题在10-20个字之间,既不过长也不过短,确保信息的完整性和吸引力。\n" +
-                    "                11.适当的紧迫感:使用“最新”、“首次”、“紧急”等词汇,创造一种紧迫感,促使读者立即行动。\n" +
-                    "                12.情感或价值诉求:使用如“感动”、“泪目”、“经典”等词汇,直接与读者的情感或价值观产生共鸣。\n" +
-                    "                避免误导:确保标题准确反映内容,避免夸大或误导读者。";
-
-        } else if (Objects.equals(promptType, "text")) {
-            return "请从我给你的文章中挖掘出以下信息并且返回如下结果。\n" +
-                    "                你返回的结果是一个 json, 格式如下:\n" +
-                    "                {\n" +
-                    "                    \"content_keys\": [] # 同时提供三个与文章内容高度相关的关键词,这些关键词将用于网络上搜索相关视频内容,\n" +
-                    "                    \"content_title\": 一个总结性的标题,该标题应简洁并能够反映文章的主要内容\n" +
-                    "                }\n" +
-                    "                你需要处理的文本是:";
-        } else {
-            return "用中文帮我回答以下问题";
-        }
-    }
-}

+ 0 - 147
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/HkspSearch.java

@@ -1,147 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-
-import java.io.IOException;
-import java.net.*;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Base64;
-import java.util.List;
-import java.util.UUID;
-
-public class HkspSearch {
-
-    public static List<JSONObject> hkspSearch(String key, List<String> sensitiveWords, String traceId) {
-        try {
-            long timestampMilliseconds = System.currentTimeMillis();
-            String url = "https://haokan.baidu.com/haokan/ui-search/pc/search/video";
-            String encodedKey = URLEncoder.encode(key, "UTF-8");
-            String strings = String.format("%d_%s_%d_%d_%d", 1, encodedKey, 10, timestampMilliseconds, 1);
-            String sign = md5(strings);
-
-            JSONObject params = new JSONObject();
-            params.put("pn", 1);
-            params.put("rn", 10);
-            params.put("type", "video");
-            params.put("query", key);
-            params.put("sign", sign);
-            params.put("version", 1);
-            params.put("timestamp", timestampMilliseconds);
-
-            String base64String = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes());
-            // 这行代码是身份验证的关键配置,不然身份验证不起作用
-            System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
-            // 身份验证
-            Authenticator.setDefault(
-                    new Authenticator() {
-                        public PasswordAuthentication getPasswordAuthentication() {
-                            return new PasswordAuthentication(
-                                    "t11983523373311", "mtuhdr2z".toCharArray());
-                        }
-                    }
-            );
-            HttpResponse response = HttpRequest.get(url)
-                    .header("authority", "haokan.baidu.com")
-                    .header("accept", "*/*")
-                    .header("accept-language", "zh,en;q=0.9,zh-CN;q=0.8")
-                    .header("cookie", "BIDUPSID=" + base64String)
-                    .header("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0") // 假用户代理
-                    .header("x-requested-with", "xmlhttprequest")
-                    .timeout(120000) // 设置超时时间
-                    .setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("l901.kdltps.com", 15818)))
-                    .form(params)
-                    .execute();
-
-            List<JSONObject> resultList = new ArrayList<>();
-            System.out.println(response.body());
-            JSONObject jsonResponse = JSONUtil.parseObj(response.body());
-            List<JSONObject> dataList = jsonResponse.getByPath("data.list", List.class);
-
-            for (JSONObject data : dataList) {
-                try {
-                    String videoId = data.getStr("vid");
-                    String title = data.getStr("title");
-                    int duration = parseDuration(data.getStr("duration"));
-
-                    if (sensitiveFlag(sensitiveWords, title) && duration <= 300) {
-                        JSONObject res = getVideoDetail(videoId);
-                        if (res != null) {
-                            resultList.add(res);
-                        }
-                    }
-                } catch (Exception e) {
-                    // 处理异常
-                }
-            }
-
-            return resultList;
-        } catch (Exception e) {
-            return new ArrayList<>();
-        }
-    }
-
-    private static int parseDuration(String duration) {
-        String[] parts = duration.split(":");
-        return Integer.parseInt(parts[0]) * 60 + Integer.parseInt(parts[1]);
-    }
-
-    private static String md5(String input) {
-        try {
-            MessageDigest md = MessageDigest.getInstance("MD5");
-            byte[] messageDigest = md.digest(input.getBytes());
-            StringBuilder sb = new StringBuilder();
-            for (byte b : messageDigest) {
-                sb.append(String.format("%02x", b));
-            }
-            return sb.toString();
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private static boolean sensitiveFlag(List<String> sensitiveWords, String title) {
-        // 实现敏感词检查逻辑
-        return true; // 示例
-    }
-
-    public static JSONObject getVideoDetail(String videoId) {
-
-
-        String url = "https://haokan.baidu.com/v";
-        JSONObject params = new JSONObject();
-        params.put("vid", videoId);
-        params.put("_format", "json");
-
-        String base64String = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes());
-        // 这行代码是身份验证的关键配置,不然身份验证不起作用
-        System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
-        // 身份验证
-        Authenticator.setDefault(
-                new Authenticator() {
-                    public PasswordAuthentication getPasswordAuthentication() {
-                        return new PasswordAuthentication(
-                                "t11983523373311", "mtuhdr2z".toCharArray());
-                    }
-                }
-        );
-        HttpResponse response = HttpRequest.get(url)
-                .header("Accept", "*/*")
-                .header("cookie", "BIDUPSID=" + base64String)
-                .header("Accept-Language", "en,zh;q=0.9,zh-CN;q=0.8")
-                .header("Cache-Control", "no-cache")
-                .header("Connection", "keep-alive")
-                .header("Content-Type", "application/x-www-form-urlencoded")
-                .header("Referer", "https://haokan.baidu.com")
-                .form(params)
-                .setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("l901.kdltps.com", 15818)))
-                .execute();
-
-        return JSONUtil.parseObj(response.body()).getByPath("data.apiData.curVideoMeta", JSONObject.class);
-    }
-
-}

+ 0 - 56
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/KimiAPI.java

@@ -1,56 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-
-import cn.hutool.http.HttpRequest;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class KimiAPI {
-
-    /**
-     * 聊天端点
-     */
-    static String chatEndpoint = "https://api.moonshot.cn/v1/chat/completions";
-    /**
-     * api密匙
-     */
-    static String apiKey = "Bearer sk-5DqYCa88kche6nwIWjLE1p4oMm8nXrR9kQMKbBolNAWERu7q";
-
-    /**
-     * 发送消息
-     *
-     * @param txt 内容
-     * @return {@link String}
-     */
-    public static String chat(String txt) {
-        Map<String, Object> paramMap = new HashMap<>();
-        paramMap.put("model", "moonshot-v1-8k");
-        List<Map<String, String>> dataList = new ArrayList<>();
-        dataList.add(new HashMap<String, String>() {{
-            put("role", "user");
-            put("content", txt);
-        }});
-        paramMap.put("messages", dataList);
-        JSONObject message = null;
-        try {
-            String body = HttpRequest.post(chatEndpoint)
-                    .header("Authorization", apiKey)
-                    .header("Content-Type", "application/json")
-                    .body(JSONObject.toJSONString(paramMap))
-                    .execute()
-                    .body();
-            JSONObject jsonObject = JSONObject.parseObject(body);
-            JSONArray choices = jsonObject.getJSONArray("choices");
-            JSONObject result = choices.getJSONObject(0);
-            message = result.getJSONObject("message");
-            return message.getString("content");
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return "";
-    }
-}

+ 0 - 37
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/OSSUploader.java

@@ -1,37 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-
-import com.aliyun.oss.OSS;
-import com.aliyun.oss.OSSClientBuilder;
-import com.aliyun.oss.model.PutObjectRequest;
-
-import java.io.File;
-import java.util.UUID;
-
-public class OSSUploader {
-
-    private static final String ACCESS_KEY_ID = "LTAIP6x1l3DXfSxm"; // 填写您的 Access Key ID
-    private static final String ACCESS_KEY_SECRET = "KbTaM9ars4OX3PMS6Xm7rtxGr1FLon"; // 填写您的 Access Key Secret
-    private static final String ENDPOINT = "oss-cn-hangzhou.aliyuncs.com"; // OSS 访问域名
-    private static final String BUCKET_NAME = "art-pubbucket"; // 存储空间名称
-
-    public static String uploadToOSS(String localVideoPath, String downloadType) {
-        String ossVideoKey = String.format("long_articles/%s/%s", downloadType, UUID.randomUUID().toString());
-
-        // 创建 OSSClient 实例
-        OSS ossClient = new OSSClientBuilder().build(ENDPOINT, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
-
-        try {
-            // 创建上传请求
-            PutObjectRequest putObjectRequest = new PutObjectRequest(BUCKET_NAME, ossVideoKey, new File(localVideoPath));
-            // 上传文件
-            ossClient.putObject(putObjectRequest);
-            return ossVideoKey;
-        } catch (Exception e) {
-            e.printStackTrace();
-            return null;
-        } finally {
-            // 关闭 OSSClient
-            ossClient.shutdown();
-        }
-    }
-}

+ 0 - 88
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/OpenAIAPI.java

@@ -1,88 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-
-import cn.hutool.core.convert.ConvertException;
-import cn.hutool.http.HttpException;
-import cn.hutool.http.HttpRequest;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-
-import java.util.*;
-
-public class OpenAIAPI {
-
-    /**
-     * 聊天端点
-     */
-    static String chatEndpoint = "https://api.openai.com/v1/chat/completions";
-    /**
-     * api密匙
-     */
-    static String apiKey = "Bearer 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";
-
-    /**
-     * 发送消息
-     *
-     * @param txt 内容
-     * @return {@link String}
-     */
-    public static String chat(String txt) {
-        Map<String, Object> paramMap = new HashMap<>();
-        paramMap.put("model", "gpt-3.5-turbo");
-        List<Map<String, String>> dataList = new ArrayList<>();
-        dataList.add(new HashMap<String, String>() {{
-            put("role", "user");
-            put("content", txt);
-        }});
-        paramMap.put("messages", dataList);
-        JSONObject message = null;
-        try {
-            String body = HttpRequest.post(chatEndpoint)
-                    .header("Authorization", apiKey)
-                    .header("Content-Type", "application/json")
-                    .body(JSONObject.toJSONString(paramMap))
-                    .execute()
-                    .body();
-            JSONObject jsonObject = JSONObject.parseObject(body);
-            JSONArray choices = jsonObject.getJSONArray("choices");
-            JSONObject result = choices.getJSONObject(0);
-            message = result.getJSONObject("message");
-        } catch (HttpException e) {
-            return "出现了异常";
-        } catch (ConvertException e) {
-            return "出现了异常";
-        }
-        return message.getString("content");
-    }
-
-    public static String promptGenerate(String promptType) {
-        if (Objects.equals(promptType, "title")) {
-            return " 请将以上标题改写成适合小程序点击和传播的小程序标题,小程序标题的写作规范如下,请学习后进行小程序标题的编写。直接输出最终的小程序标题\n" +
-                    "                小程序标题写作规范:\n" +
-                    "                1.要点前置:将最重要的信息放在标题的最前面,以快速吸引读者的注意力。例如,“5月一辈子同学,三辈子亲,送给我的老同学,听哭无数人!”中的“5月”和“一辈子同学,三辈子亲”都是重要的信息点。\n" +
-                    "                2.激发情绪:使用能够触动人心的语言,激发读者的情感共鸣。如“只剩两人同学聚会,看后感动落泪。”使用“感动落泪”激发读者的同情和怀旧情绪。\n" +
-                    "                3.使用数字和特殊符号:数字可以提供具体性,而特殊符号如“\uD83D\uDD34”、“\uD83D\uDE04”、“\uD83D\uDD25”等可以吸引视觉注意力,增加点击率。\n" +
-                    "                4.悬念和好奇心:创建悬念或提出问题,激发读者的好奇心。例如,“太神奇了!长江水位下降,重庆出现惊奇一幕!”中的“惊奇一幕”就是一个悬念。\n" +
-                    "                5.名人效应:如果内容与知名人士相关,提及他们的名字可以增加标题的吸引力。\n" +
-                    "                6.社会价值观:触及读者的文化和社会价值观,如家庭、友情、国家荣誉等。\n" +
-                    "                7.标点符号的运用:使用感叹号、问号等标点来增强语气和情感表达。\n" +
-                    "                8.直接的语言:使用直白、口语化的语言,易于理解,如“狗屁股,笑死我了!”。\n" +
-                    "                9.热点人物或事件:提及当前的热点人物或事件,利用热点效应吸引读者。\n" +
-                    "                10.字数适中:保持标题在10-20个字之间,既不过长也不过短,确保信息的完整性和吸引力。\n" +
-                    "                11.适当的紧迫感:使用“最新”、“首次”、“紧急”等词汇,创造一种紧迫感,促使读者立即行动。\n" +
-                    "                12.情感或价值诉求:使用如“感动”、“泪目”、“经典”等词汇,直接与读者的情感或价值观产生共鸣。\n" +
-                    "                避免误导:确保标题准确反映内容,避免夸大或误导读者。";
-
-        } else if (Objects.equals(promptType, "text")) {
-            return "请从我给你的文章中挖掘出以下信息并且返回如下结果。\n" +
-                    "                你返回的结果是一个 json, 格式如下:\n" +
-                    "                {\n" +
-                    "                    \"content_keys\": [] # 同时提供三个与文章内容高度相关的关键词,这些关键词将用于网络上搜索相关视频内容,\n" +
-                    "                    \"content_title\": 一个总结性的标题,该标题应简洁并能够反映文章的主要内容\n" +
-                    "                }\n" +
-                    "                你需要处理的文本是:";
-        } else {
-            return "用中文帮我回答以下问题";
-        }
-    }
-
-}

+ 0 - 55
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/SortUtil.java

@@ -1,55 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-
-
-import cn.hutool.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class SortUtil {
-
-    private static double jcdTitleSimilarity(String oriTitle, String searchTitle) {
-        Set<Character> set1 = new HashSet<>();
-        for (char c : oriTitle.toCharArray()) {
-            set1.add(c);
-        }
-
-        Set<Character> set2 = new HashSet<>();
-        for (char c : searchTitle.toCharArray()) {
-            set2.add(c);
-        }
-
-        Set<Character> intersection = new HashSet<>(set1);
-        intersection.retainAll(set2);
-
-        Set<Character> union = new HashSet<>(set1);
-        union.addAll(set2);
-
-        return (double) intersection.size() / union.size();
-    }
-
-    public static List<JSONObject> titleSimilarityRank(String contentTitle, List<JSONObject> recallList) {
-        List<JSONObject> includeTitleList = new ArrayList<>();
-        for (JSONObject videoInfo : recallList) {
-            String platform = (String) videoInfo.get("platform");
-            String title = "";
-
-            if (platform.equals("dy_search") || platform.equals("baidu_search")) {
-                title = (String) videoInfo.get("title");
-            } else if (platform.equals("xg_search")) {
-                title = (String) videoInfo.get("video_title");
-            } else {
-                continue;
-            }
-
-            videoInfo.put("title", title);
-            videoInfo.put("score", jcdTitleSimilarity(contentTitle, title));
-            includeTitleList.add(videoInfo);
-        }
-
-        includeTitleList.sort((a, b) -> Double.compare((double) b.get("score"), (double) a.get("score")));
-        return includeTitleList;
-    }
-}

+ 0 - 161
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/VideoDownloader.java

@@ -1,161 +0,0 @@
-package com.tzld.piaoquan.longarticle.utils;
-
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicHeader;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Objects;
-import java.util.UUID;
-
-public class VideoDownloader {
-
-    public static String downloadCover(String filePath, String platform, String coverUrl) {
-        try {
-            HttpResponse response = sendRequest(platform, coverUrl, "cover");
-            if (response.getStatusLine().getStatusCode() != 200) {
-                return null;
-            }
-
-            try (InputStream inputStream = response.getEntity().getContent();
-                 FileOutputStream outputStream = new FileOutputStream(new File(filePath))) {
-                byte[] buffer = new byte[1024];
-                int bytesRead;
-                while ((bytesRead = inputStream.read(buffer)) != -1) {
-                    outputStream.write(buffer, 0, bytesRead);
-                }
-            }
-            return filePath;
-        } catch (Exception e) {
-
-        }
-        return "";
-    }
-
-    public static HttpResponse sendRequest(String platform, String url, String downloadType) throws IOException {
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        HttpGet request = new HttpGet(url);
-        request.setHeaders(requestHeader(platform, url, downloadType));
-        return httpClient.execute(request);
-    }
-
-    public static org.apache.http.Header[] requestHeader(String platform, String url, String downloadType) {
-        switch (platform) {
-            case "xg_search":
-                // 根据 URL 设置不同的请求头
-                if (url.contains("v9-xg-web-pc.ixigua.com")) {
-                    return new org.apache.http.Header[]{
-                            new BasicHeader("Accept", "*/*"),
-                            new BasicHeader("Accept-Language", "zh-CN,zh;q=0.9"),
-                            new BasicHeader("Host", "v9-xg-web-pc.ixigua.com"),
-                            new BasicHeader("User-Agent", "Mozilla/5.0"),
-                            new BasicHeader("Origin", "https://www.ixigua.com/"),
-                            new BasicHeader("Referer", "https://www.ixigua.com/")
-                    };
-                } else if (url.contains("v3-xg-web-pc.ixigua.com")) {
-                    return new org.apache.http.Header[]{
-                            new BasicHeader("Accept", "*/*"),
-                            new BasicHeader("Accept-Language", "zh-CN,zh;q=0.9"),
-                            new BasicHeader("Host", "v3-xg-web-pc.ixigua.com"),
-                            new BasicHeader("User-Agent", "Mozilla/5.0"),
-                            new BasicHeader("Origin", "https://www.ixigua.com/"),
-                            new BasicHeader("Referer", "https://www.ixigua.com/")
-                    };
-                } else if (Objects.equals(downloadType, "cover")) {
-                    return new org.apache.http.Header[]{
-                            new BasicHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"),
-                            new BasicHeader("Accept-Language", "en,zh;q=0.9,zh-CN;q=0.8"),
-                            new BasicHeader("Cache-Control", "max-age=0"),
-                            new BasicHeader("Proxy-Connection", "keep-alive"),
-                            new BasicHeader("Upgrade-Insecure-Requests", "1"),
-                            new BasicHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36")
-                    };
-                }
-                // 其他 headers 根据 downloadType 处理
-                break;
-            case "baidu_search":
-                return new org.apache.http.Header[]{
-                        new BasicHeader("Accept", "*/*"),
-                        new BasicHeader("Accept-Language", "zh-CN,zh;q=0.9"),
-                        new BasicHeader("User-Agent", "Mozilla/5.0")
-                };
-            case "wx_search":
-                return new org.apache.http.Header[]{
-                        new BasicHeader("Accept", "*/*"),
-                        new BasicHeader("Accept-Language", "zh-CN,zh;q=0.9"),
-                        new BasicHeader("User-Agent", "Mozilla/5.0"),
-                        new BasicHeader("Origin", "https://mp.weixin.qq.com"),
-                        new BasicHeader("Referer", "https://mp.weixin.qq.com")
-                };
-            case "dy_search":
-                return new org.apache.http.Header[]{
-                        new BasicHeader("accept", "*/*"),
-                        new BasicHeader("accept-language", "en,zh;q=0.9,zh-CN;q=0.8"),
-                        new BasicHeader("priority", "i"),
-                        new BasicHeader("referer", "https://v11-coldf.douyinvod.com/"),
-                        new BasicHeader("user-agent", "Mozilla/5.0")
-                };
-            default:
-                return new org.apache.http.Header[]{};
-        }
-        return new org.apache.http.Header[]{};
-    }
-
-    public static String downloadVideo(String filePath, String platform, String videoUrl, String downloadType) {
-        try {
-            HttpResponse response = sendRequest(platform, videoUrl, downloadType);
-            if (response.getStatusLine().getStatusCode() != 200 && response.getStatusLine().getStatusCode() != 206) {
-                System.out.println("Error: " + response.getStatusLine().getStatusCode());
-                return null;
-            }
-
-            try (InputStream inputStream = response.getEntity().getContent();
-                 FileOutputStream outputStream = new FileOutputStream(new File(filePath))) {
-                byte[] buffer = new byte[1024 * 1024];
-                int bytesRead;
-                while ((bytesRead = inputStream.read(buffer)) != -1) {
-                    outputStream.write(buffer, 0, bytesRead);
-                }
-            }
-            return filePath;
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-        }
-        return "";
-    }
-
-    public static String generateVideoPath(String platform, String videoId) {
-        String index = String.format("%s-%s-%s", platform, videoId, UUID.randomUUID());
-        String md5Hash = DigestUtils.md5Hex(index);
-        String fileName = String.format("%s.mp4", md5Hash);
-        String filePath = String.join(File.separator, System.getProperty("user.dir"), fileName);
-        return filePath; // 返回文件路径和封面路径
-    }
-
-    public static String generateCoverPath(String platform, String videoId) {
-        String index = String.format("%s-%s-%s", platform, videoId, UUID.randomUUID());
-        String md5Hash = DigestUtils.md5Hex(index);
-        String coverName = String.format("%s.png", md5Hash);
-        String coverPath = String.join(File.separator, System.getProperty("user.dir"), coverName);
-        return coverPath; // 返回文件路径和封面路径
-    }
-
-    public static void main(String[] args) {
-        // 示例用法
-        String coverUrl = "https://example.com/cover.jpg";
-        String filePath = "path/to/cover.png";
-        downloadCover(filePath, "xg_search", coverUrl);
-        String videoUrl = "https://example.com/video.mp4";
-        String videoFilePath = "path/to/video.mp4";
-        downloadVideo(videoFilePath, "xg_search", videoUrl, "video");
-        String paths = generateVideoPath("xg_search", "videoId");
-        System.out.println("Generated paths: " + paths);
-
-    }
-}

+ 0 - 208
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/XiGuaUtils.java

@@ -1,208 +0,0 @@
-//package com.tzld.piaoquan.longarticle.utils;
-//
-//import cn.hutool.http.HttpRequest;
-//import cn.hutool.http.HttpResponse;
-//import com.alibaba.fastjson.JSONArray;
-//import com.alibaba.fastjson.JSONObject;
-//import com.fasterxml.jackson.databind.JsonNode;
-//import com.fasterxml.jackson.databind.ObjectMapper;
-//import org.jsoup.Jsoup;
-//import org.jsoup.nodes.Document;
-//import org.jsoup.select.Elements;
-//
-//import javax.crypto.Cipher;
-//import javax.crypto.spec.IvParameterSpec;
-//import javax.crypto.spec.SecretKeySpec;
-//import java.io.UnsupportedEncodingException;
-//import java.net.URLEncoder;
-//import java.nio.charset.StandardCharsets;
-//import java.util.*;
-//import java.util.regex.Matcher;
-//import java.util.regex.Pattern;
-//
-//public class XiGuaUtils {
-//
-//    public static List<JSONObject> xiguaSearchV2(String keyword, List<String> sensitiveWords) throws UnsupportedEncodingException {
-//        String url = "https://www.ixigua.com/api/searchv2/complex/" + URLEncoder.encode(keyword, StandardCharsets.UTF_8.toString()) + "/10";
-//        Map<String, String> headers = new HashMap<>();
-//        headers.put("accept", "application/json, text/plain, */*");
-//        headers.put("accept-language", "en,zh;q=0.9,zh-CN;q=0.8");
-//        headers.put("cookie", "_tea_utm_cache_2285=undefined;");
-//        headers.put("priority", "u=1, i");
-//        headers.put("referer", "https://www.ixigua.com/search/" + URLEncoder.encode(keyword, StandardCharsets.UTF_8.toString()));
-//        headers.put("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3");
-//
-//        HttpResponse response = HttpRequest.get(url)
-//                .addHeaders(headers)
-//                .execute();
-//
-//        try {
-//            JSONObject jsonResponse = JSONObject.parseObject(response.body());
-//            JSONArray recallList = jsonResponse.getJSONObject("data").getJSONArray("data");
-//
-//            if (recallList != null) {
-//                for (int i = 0; i < recallList.size(); i++) {
-//                    JSONObject videoObj = recallList.getJSONObject(i);
-//                    if ("video".equals(videoObj.getString("type"))) {
-//                        String title = videoObj.getJSONObject("data").getString("title");
-//                        String groupId = videoObj.getJSONObject("data").getString("group_id");
-//                        int duration = videoObj.getJSONObject("data").getInteger("video_time");
-//
-//                        // 假设 sensitiveFlag 是一个方法用于检查敏感词
-//                        if (sensitiveFlag(sensitiveWords, title) && duration <= 300) {
-//                            System.out.println(groupId);
-//                            JSONObject videoInfo = getVideoInfo(groupId);
-//                            if (videoInfo != null) {
-//                                return List.of(videoInfo);
-//                            }
-//                        }
-//                    }
-//                }
-//            }
-//            return List.of();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return List.of();
-//        }
-//    }
-//
-//    public static JSONObject getVideoInfo(String itemId) {
-//        String url = "https://www.ixigua.com/" + itemId;
-//
-//        // 设置请求头
-//        HttpRequest request = HttpRequest.get(url)
-//                .header("accept-language", "zh-CN,zh-Hans;q=0.9")
-//                .header("cookie", "UIFID=73355a799e41c2edb6d004baa6cda0116425031dff9117e11075ec8bf266082874fe897f43e66be83a0501afe4a08cfc7e1066ab88423af122641493c7af9f0a745eb85c50fddb096de5cc77cd5ff05503312d84d36ab2681c6e6d930bbe68edaebf8fae03b04eb669359965e01c266b;"
-//                        + "__ac_nonce=0666fd1a00053bf535b9f;"
-//                        + "__ac_signature=_02B4Z6wo00f01u8PTiQAAIDBvfBuP-YjUQbvL0qAAN25bWfWXQrzRNCBKvFYKS5wAOYPXg5XV1Ck9JEroeWeWKijH2v3i4lxXM37JogiJJfEtYD.8sbXul2-4v.VRRta4xa07ignRnGj5Voh83;"
-//                        + "ttwid=1%7C9b5sTIuwZxZKt0wFsvE-2t5OoFxH_Q5VIpVNWEREbAo%7C1718605316%7C9dfc9322350e713e6109ed46a7047ed31c0ab5a724e84de0bb766c195043207c")
-//                .header("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3")
-//                .header("referer", "https://www.ixigua.com/" + itemId);
-//
-//        // 发送请求
-//        HttpResponse response = request.execute();
-//
-//        // 解析响应
-//        String responseBody = response.body();
-//        System.out.println(responseBody);
-//        return extractInfoByRegex(responseBody);
-//    }
-//
-//    public static JSONObject extractInfoByRegex(String text) {
-//        JSONObject result = extractVideoUrl(text);
-//
-//        // 标题
-//        String titleContent = extractTitle(text);
-//        result.put("video_title", titleContent);
-//
-//        return result;
-//    }
-//
-//    private static String extractTitle(String text) {
-//        Pattern pattern = Pattern.compile("<title[^>]*>(.*?)</title>");
-//        Matcher matcher = pattern.matcher(text);
-//        if (matcher.find()) {
-//            String title = matcher.group(1);
-//            // 处理标题内容
-//            String[] parts = title.split(" - ");
-//            String titleContent = parts[0];
-//
-//            // 尝试将标题内容转换为 UTF-8
-//            try {
-//                return new String(titleContent.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
-//            } catch (Exception e) {
-//                e.printStackTrace();
-//            }
-//            return titleContent;
-//        }
-//        return "";
-//    }
-//
-//    public static JSONObject extractVideoUrl(String text) {
-//        Document document = Jsoup.parse(text);
-//        Elements scriptElements = document.select("script#SSR_HYDRATED_DATA");
-//        String str2 = Objects.requireNonNull(scriptElements.first()).html();
-//        String json2 = str2.substring(str2.indexOf('{'), str2.lastIndexOf('}') + 1);
-//        String[] irregulars = {"null", "undefined", "=false", "=true", "false", "true"};
-//
-//        // 处理不规则定义
-//        for (String i : irregulars) {
-//            if ("=false".equals(i) || "=true".equals(i)) {
-//                json2 = json2.replace(i, "=" + Character.toUpperCase(i.charAt(1)) + i.substring(2));
-//            } else {
-//                json2 = json2.replace(i, "12");
-//            }
-//        }
-//
-//        try {
-//            ObjectMapper objectMapper = new ObjectMapper();
-//            JsonNode dict2 = objectMapper.readTree(json2).path("anyVideo").path("gidInformation").path("packerData").path("video");
-//
-//            long duration = dict2.path("video_duration").asLong();
-//            long playCnt = dict2.path("video_watch_count").asLong();
-//            long publishTime = dict2.path("video_publish_time").asLong();
-//            long likeCnt = dict2.path("video_like_count").asLong();
-//            String videoTitle = dict2.path("title").asText();
-//            String videoId = dict2.path("vid").asText();
-//            JsonNode videoRes = dict2.path("videoResource");
-//            String coverUrl = dict2.path("poster_url").asText().replace("\\u002F", "/");
-//
-//            String realVideoUrl;
-//            if (videoRes.path("dash").asInt() == 12) {
-//                JsonNode obj = videoRes.path("normal");
-//                String ptk = obj.path("ptk").asText();
-//                JsonNode videoList = obj.path("video_list");
-//                String mainUrl = videoList.fields().next().getValue().path("main_url").asText();
-//                realVideoUrl = aesDecrypt(mainUrl, ptk);
-//            } else {
-//                JsonNode obj = videoRes.path("dash");
-//                String ptk = obj.path("ptk").asText();
-//                String videoUrl = obj.path("dynamic_video").path("main_url").asText();
-//                realVideoUrl = aesDecrypt(videoUrl, ptk);
-//            }
-//
-//            JSONObject result = new JSONObject();
-//            result.put("video_url", realVideoUrl);
-//            result.put("cover_url", coverUrl);
-//            result.put("video_id", videoId);
-//            result.put("video_title", videoTitle);
-//            result.put("like_cnt", likeCnt);
-//            result.put("play_cnt", playCnt);
-//            result.put("publish_time", publishTime);
-//            result.put("duration", duration);
-//            return result;
-//
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return new JSONObject();
-//        }
-//    }
-//
-//    private static String aesDecrypt(String data, String key) {
-//        try {
-//            byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8);
-//            SecretKeySpec secretKey = new SecretKeySpec(keyBytes, "AES");
-//            Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
-//            IvParameterSpec ivParams = new IvParameterSpec(keyBytes, 0, 16);
-//            cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParams);
-//            byte[] decryptedBytes = cipher.doFinal(Base64.getDecoder().decode(data));
-//            return new String(decryptedBytes, StandardCharsets.UTF_8);
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return null;
-//        }
-//    }
-//
-//
-//    // 假设 sensitiveFlag 方法的实现
-//    private static boolean sensitiveFlag(List<String> sensitiveWords, String title) {
-//        return true;
-//    }
-//
-//    public static void main(String[] args) {
-//        String keyword = "测试";  // 替换为实际关键词
-//        List<String> sensitiveWords = List.of("敏感词1", "敏感词2");  // 替换为实际敏感词
-//        List<JSONObject> results = xiguaSearchV2(keyword, sensitiveWords);
-//        results.forEach(System.out::println);
-//    }
-//}

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

@@ -1,293 +0,0 @@
-<?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.LongArticlesTextMapper">
-  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.longarticle.model.po.LongArticlesText">
-    <id column="content_id" jdbcType="VARCHAR" property="contentId" />
-    <result column="article_title" jdbcType="VARCHAR" property="articleTitle" />
-    <result column="kimi_title" jdbcType="VARCHAR" property="kimiTitle" />
-    <result column="kimi_summary" jdbcType="VARCHAR" property="kimiSummary" />
-    <result column="kimi_keys" jdbcType="VARCHAR" property="kimiKeys" />
-    <result column="kimi_status" jdbcType="INTEGER" property="kimiStatus" />
-  </resultMap>
-  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.longarticle.model.po.LongArticlesText">
-    <result column="article_text" jdbcType="LONGVARCHAR" property="articleText" />
-  </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">
-    content_id, article_title, kimi_title, kimi_summary, kimi_keys, kimi_status
-  </sql>
-  <sql id="Blob_Column_List">
-    article_text
-  </sql>
-  <select id="selectByExampleWithBLOBs" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesTextExample" resultMap="ResultMapWithBLOBs">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    ,
-    <include refid="Blob_Column_List" />
-    from long_articles_text
-    <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="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesTextExample" resultMap="BaseResultMap">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from long_articles_text
-    <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.String" resultMap="ResultMapWithBLOBs">
-    select 
-    <include refid="Base_Column_List" />
-    ,
-    <include refid="Blob_Column_List" />
-    from long_articles_text
-    where content_id = #{contentId,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from long_articles_text
-    where content_id = #{contentId,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesTextExample">
-    delete from long_articles_text
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesText">
-    insert into long_articles_text (content_id, article_title, kimi_title, 
-      kimi_summary, kimi_keys, kimi_status, 
-      article_text)
-    values (#{contentId,jdbcType=VARCHAR}, #{articleTitle,jdbcType=VARCHAR}, #{kimiTitle,jdbcType=VARCHAR}, 
-      #{kimiSummary,jdbcType=VARCHAR}, #{kimiKeys,jdbcType=VARCHAR}, #{kimiStatus,jdbcType=INTEGER}, 
-      #{articleText,jdbcType=LONGVARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesText">
-    insert into long_articles_text
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="contentId != null">
-        content_id,
-      </if>
-      <if test="articleTitle != null">
-        article_title,
-      </if>
-      <if test="kimiTitle != null">
-        kimi_title,
-      </if>
-      <if test="kimiSummary != null">
-        kimi_summary,
-      </if>
-      <if test="kimiKeys != null">
-        kimi_keys,
-      </if>
-      <if test="kimiStatus != null">
-        kimi_status,
-      </if>
-      <if test="articleText != null">
-        article_text,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="contentId != null">
-        #{contentId,jdbcType=VARCHAR},
-      </if>
-      <if test="articleTitle != null">
-        #{articleTitle,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiTitle != null">
-        #{kimiTitle,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiSummary != null">
-        #{kimiSummary,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiKeys != null">
-        #{kimiKeys,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiStatus != null">
-        #{kimiStatus,jdbcType=INTEGER},
-      </if>
-      <if test="articleText != null">
-        #{articleText,jdbcType=LONGVARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesTextExample" resultType="java.lang.Long">
-    select count(*) from long_articles_text
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    update long_articles_text
-    <set>
-      <if test="record.contentId != null">
-        content_id = #{record.contentId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.articleTitle != null">
-        article_title = #{record.articleTitle,jdbcType=VARCHAR},
-      </if>
-      <if test="record.kimiTitle != null">
-        kimi_title = #{record.kimiTitle,jdbcType=VARCHAR},
-      </if>
-      <if test="record.kimiSummary != null">
-        kimi_summary = #{record.kimiSummary,jdbcType=VARCHAR},
-      </if>
-      <if test="record.kimiKeys != null">
-        kimi_keys = #{record.kimiKeys,jdbcType=VARCHAR},
-      </if>
-      <if test="record.kimiStatus != null">
-        kimi_status = #{record.kimiStatus,jdbcType=INTEGER},
-      </if>
-      <if test="record.articleText != null">
-        article_text = #{record.articleText,jdbcType=LONGVARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExampleWithBLOBs" parameterType="map">
-    update long_articles_text
-    set content_id = #{record.contentId,jdbcType=VARCHAR},
-      article_title = #{record.articleTitle,jdbcType=VARCHAR},
-      kimi_title = #{record.kimiTitle,jdbcType=VARCHAR},
-      kimi_summary = #{record.kimiSummary,jdbcType=VARCHAR},
-      kimi_keys = #{record.kimiKeys,jdbcType=VARCHAR},
-      kimi_status = #{record.kimiStatus,jdbcType=INTEGER},
-      article_text = #{record.articleText,jdbcType=LONGVARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    update long_articles_text
-    set content_id = #{record.contentId,jdbcType=VARCHAR},
-      article_title = #{record.articleTitle,jdbcType=VARCHAR},
-      kimi_title = #{record.kimiTitle,jdbcType=VARCHAR},
-      kimi_summary = #{record.kimiSummary,jdbcType=VARCHAR},
-      kimi_keys = #{record.kimiKeys,jdbcType=VARCHAR},
-      kimi_status = #{record.kimiStatus,jdbcType=INTEGER}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesText">
-    update long_articles_text
-    <set>
-      <if test="articleTitle != null">
-        article_title = #{articleTitle,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiTitle != null">
-        kimi_title = #{kimiTitle,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiSummary != null">
-        kimi_summary = #{kimiSummary,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiKeys != null">
-        kimi_keys = #{kimiKeys,jdbcType=VARCHAR},
-      </if>
-      <if test="kimiStatus != null">
-        kimi_status = #{kimiStatus,jdbcType=INTEGER},
-      </if>
-      <if test="articleText != null">
-        article_text = #{articleText,jdbcType=LONGVARCHAR},
-      </if>
-    </set>
-    where content_id = #{contentId,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesText">
-    update long_articles_text
-    set article_title = #{articleTitle,jdbcType=VARCHAR},
-      kimi_title = #{kimiTitle,jdbcType=VARCHAR},
-      kimi_summary = #{kimiSummary,jdbcType=VARCHAR},
-      kimi_keys = #{kimiKeys,jdbcType=VARCHAR},
-      kimi_status = #{kimiStatus,jdbcType=INTEGER},
-      article_text = #{articleText,jdbcType=LONGVARCHAR}
-    where content_id = #{contentId,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.LongArticlesText">
-    update long_articles_text
-    set article_title = #{articleTitle,jdbcType=VARCHAR},
-      kimi_title = #{kimiTitle,jdbcType=VARCHAR},
-      kimi_summary = #{kimiSummary,jdbcType=VARCHAR},
-      kimi_keys = #{kimiKeys,jdbcType=VARCHAR},
-      kimi_status = #{kimiStatus,jdbcType=INTEGER}
-    where content_id = #{contentId,jdbcType=VARCHAR}
-  </update>
-</mapper>

+ 0 - 231
long-article-server/src/main/resources/mapper/OffVideoMapper.xml

@@ -1,231 +0,0 @@
-<?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.OffVideoMapper">
-  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.longarticle.model.po.OffVideo">
-    <id column="video_id" jdbcType="BIGINT" property="videoId" />
-    <result column="publish_time" jdbcType="BIGINT" property="publishTime" />
-    <result column="video_status" jdbcType="INTEGER" property="videoStatus" />
-    <result column="trace_id" jdbcType="VARCHAR" property="traceId" />
-    <result column="get_off_time" jdbcType="BIGINT" property="getOffTime" />
-    <result column="check_status" jdbcType="INTEGER" property="checkStatus" />
-  </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">
-    video_id, publish_time, video_status, trace_id, get_off_time, check_status
-  </sql>
-  <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideoExample" resultMap="BaseResultMap">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from get_off_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 get_off_videos
-    where video_id = #{videoId,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    delete from get_off_videos
-    where video_id = #{videoId,jdbcType=BIGINT}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideoExample">
-    delete from get_off_videos
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
-    insert into get_off_videos (video_id, publish_time, video_status, 
-      trace_id, get_off_time, check_status
-      )
-    values (#{videoId,jdbcType=BIGINT}, #{publishTime,jdbcType=BIGINT}, #{videoStatus,jdbcType=INTEGER}, 
-      #{traceId,jdbcType=VARCHAR}, #{getOffTime,jdbcType=BIGINT}, #{checkStatus,jdbcType=INTEGER}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
-    insert into get_off_videos
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="videoId != null">
-        video_id,
-      </if>
-      <if test="publishTime != null">
-        publish_time,
-      </if>
-      <if test="videoStatus != null">
-        video_status,
-      </if>
-      <if test="traceId != null">
-        trace_id,
-      </if>
-      <if test="getOffTime != null">
-        get_off_time,
-      </if>
-      <if test="checkStatus != null">
-        check_status,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="videoId != null">
-        #{videoId,jdbcType=BIGINT},
-      </if>
-      <if test="publishTime != null">
-        #{publishTime,jdbcType=BIGINT},
-      </if>
-      <if test="videoStatus != null">
-        #{videoStatus,jdbcType=INTEGER},
-      </if>
-      <if test="traceId != null">
-        #{traceId,jdbcType=VARCHAR},
-      </if>
-      <if test="getOffTime != null">
-        #{getOffTime,jdbcType=BIGINT},
-      </if>
-      <if test="checkStatus != null">
-        #{checkStatus,jdbcType=INTEGER},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideoExample" resultType="java.lang.Long">
-    select count(*) from get_off_videos
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    update get_off_videos
-    <set>
-      <if test="record.videoId != null">
-        video_id = #{record.videoId,jdbcType=BIGINT},
-      </if>
-      <if test="record.publishTime != null">
-        publish_time = #{record.publishTime,jdbcType=BIGINT},
-      </if>
-      <if test="record.videoStatus != null">
-        video_status = #{record.videoStatus,jdbcType=INTEGER},
-      </if>
-      <if test="record.traceId != null">
-        trace_id = #{record.traceId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.getOffTime != null">
-        get_off_time = #{record.getOffTime,jdbcType=BIGINT},
-      </if>
-      <if test="record.checkStatus != null">
-        check_status = #{record.checkStatus,jdbcType=INTEGER},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    update get_off_videos
-    set video_id = #{record.videoId,jdbcType=BIGINT},
-      publish_time = #{record.publishTime,jdbcType=BIGINT},
-      video_status = #{record.videoStatus,jdbcType=INTEGER},
-      trace_id = #{record.traceId,jdbcType=VARCHAR},
-      get_off_time = #{record.getOffTime,jdbcType=BIGINT},
-      check_status = #{record.checkStatus,jdbcType=INTEGER}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
-    update get_off_videos
-    <set>
-      <if test="publishTime != null">
-        publish_time = #{publishTime,jdbcType=BIGINT},
-      </if>
-      <if test="videoStatus != null">
-        video_status = #{videoStatus,jdbcType=INTEGER},
-      </if>
-      <if test="traceId != null">
-        trace_id = #{traceId,jdbcType=VARCHAR},
-      </if>
-      <if test="getOffTime != null">
-        get_off_time = #{getOffTime,jdbcType=BIGINT},
-      </if>
-      <if test="checkStatus != null">
-        check_status = #{checkStatus,jdbcType=INTEGER},
-      </if>
-    </set>
-    where video_id = #{videoId,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
-    update get_off_videos
-    set publish_time = #{publishTime,jdbcType=BIGINT},
-      video_status = #{videoStatus,jdbcType=INTEGER},
-      trace_id = #{traceId,jdbcType=VARCHAR},
-      get_off_time = #{getOffTime,jdbcType=BIGINT},
-      check_status = #{checkStatus,jdbcType=INTEGER}
-    where video_id = #{videoId,jdbcType=BIGINT}
-  </update>
-</mapper>