|  | @@ -66,7 +66,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |              "\"20241030070010871546586\"]}")
 |  |              "\"20241030070010871546586\"]}")
 | 
											
												
													
														|  |      private static List<String> producePlanIds;
 |  |      private static List<String> producePlanIds;
 | 
											
												
													
														|  |      @Value("${kimiCategoryPrompt:}")
 |  |      @Value("${kimiCategoryPrompt:}")
 | 
											
												
													
														|  | -    private String kimiCategoryPrompt;
 |  | 
 | 
											
												
													
														|  | 
 |  | +    private String categoryPrompt;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Value("${category.active.version:1}")
 |  |      @Value("${category.active.version:1}")
 | 
											
												
													
														|  |      private Integer activeVersion;
 |  |      private Integer activeVersion;
 | 
											
										
											
												
													
														|  | @@ -99,7 +99,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |          addPromotionArticleCategoryByProducePlan();
 |  |          addPromotionArticleCategoryByProducePlan();
 | 
											
												
													
														|  |          // 视频内容池 添加品类处理任务
 |  |          // 视频内容池 添加品类处理任务
 | 
											
												
													
														|  |          addVideoPoolArticleCategory();
 |  |          addVideoPoolArticleCategory();
 | 
											
												
													
														|  | -        // 调用kimi进行内容分类
 |  | 
 | 
											
												
													
														|  | 
 |  | +        // 调用大模型进行内容分类
 | 
											
												
													
														|  |          dealArticleCategory();
 |  |          dealArticleCategory();
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -108,7 +108,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |          List<List<ArticleCategory>> partitionList = Lists.partition(dealList, 20);
 |  |          List<List<ArticleCategory>> partitionList = Lists.partition(dealList, 20);
 | 
											
												
													
														|  |          for (List<ArticleCategory> partition : partitionList) {
 |  |          for (List<ArticleCategory> partition : partitionList) {
 | 
											
												
													
														|  |              List<String> partitionTitles = partition.stream().map(ArticleCategory::getTitle).distinct().collect(Collectors.toList());
 |  |              List<String> partitionTitles = partition.stream().map(ArticleCategory::getTitle).distinct().collect(Collectors.toList());
 | 
											
												
													
														|  | -            String prompt = buildKimiPrompt(partitionTitles);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            String prompt = buildCategoryPrompt(partitionTitles);
 | 
											
												
													
														|  |              KimiResult kimiResult = deepSeekApiService.requestOfficialApi(prompt, null, null, true);
 |  |              KimiResult kimiResult = deepSeekApiService.requestOfficialApi(prompt, null, null, true);
 | 
											
												
													
														|  |              long now = System.currentTimeMillis();
 |  |              long now = System.currentTimeMillis();
 | 
											
												
													
														|  |              JSONObject obj = null;
 |  |              JSONObject obj = null;
 | 
											
										
											
												
													
														|  | @@ -120,7 +120,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |              for (ArticleCategory articleCategory : partition) {
 |  |              for (ArticleCategory articleCategory : partition) {
 | 
											
												
													
														|  | -                articleCategory.setKimiResult(kimiResult.getResponseStr());
 |  | 
 | 
											
												
													
														|  | 
 |  | +                articleCategory.setKimiResult(kimiResult.getResponseStr().trim());
 | 
											
												
													
														|  |                  articleCategory.setUpdateTimestamp(now);
 |  |                  articleCategory.setUpdateTimestamp(now);
 | 
											
												
													
														|  |                  if (kimiResult.isSuccess() && Objects.nonNull(obj) && obj.containsKey(articleCategory.getTitle())) {
 |  |                  if (kimiResult.isSuccess() && Objects.nonNull(obj) && obj.containsKey(articleCategory.getTitle())) {
 | 
											
												
													
														|  |                      articleCategory.setCategory(obj.getString(articleCategory.getTitle()));
 |  |                      articleCategory.setCategory(obj.getString(articleCategory.getTitle()));
 | 
											
										
											
												
													
														|  | @@ -164,6 +164,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |                  item.setTitle(vo.getTitle());
 |  |                  item.setTitle(vo.getTitle());
 | 
											
												
													
														|  |                  item.setTitleMd5(Md5Util.encoderByMd5(vo.getTitle()));
 |  |                  item.setTitleMd5(Md5Util.encoderByMd5(vo.getTitle()));
 | 
											
												
													
														|  |                  item.setCreateTimestamp(now);
 |  |                  item.setCreateTimestamp(now);
 | 
											
												
													
														|  | 
 |  | +                item.setVersion(activeVersion);
 | 
											
												
													
														|  |                  saveList.add(item);
 |  |                  saveList.add(item);
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |              if (CollectionUtils.isNotEmpty(saveList)) {
 |  |              if (CollectionUtils.isNotEmpty(saveList)) {
 | 
											
										
											
												
													
														|  | @@ -231,7 +232,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |                  if (Objects.nonNull(category) && StringUtils.hasText(category.getCategory())) {
 |  |                  if (Objects.nonNull(category) && StringUtils.hasText(category.getCategory())) {
 | 
											
												
													
														|  |                      articleCategory.setCategory(category.getCategory());
 |  |                      articleCategory.setCategory(category.getCategory());
 | 
											
												
													
														|  | -                    articleCategory.setKimiResult(category.getKimiResult());
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    articleCategory.setKimiResult(category.getKimiResult().trim());
 | 
											
												
													
														|  |                      articleCategory.setStatus(ArticleCategoryStatusEnum.SUCCESS.getCode());
 |  |                      articleCategory.setStatus(ArticleCategoryStatusEnum.SUCCESS.getCode());
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
										
											
												
													
														|  | @@ -253,6 +254,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |              item.setTitle(videoSource.getArticleTitle());
 |  |              item.setTitle(videoSource.getArticleTitle());
 | 
											
												
													
														|  |              item.setTitleMd5(Md5Util.encoderByMd5(videoSource.getArticleTitle()));
 |  |              item.setTitleMd5(Md5Util.encoderByMd5(videoSource.getArticleTitle()));
 | 
											
												
													
														|  |              item.setCreateTimestamp(now);
 |  |              item.setCreateTimestamp(now);
 | 
											
												
													
														|  | 
 |  | +            item.setVersion(activeVersion);
 | 
											
												
													
														|  |              saveList.add(item);
 |  |              saveList.add(item);
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          articleCategoryMapper.batchInsertArticleCategory(saveList);
 |  |          articleCategoryMapper.batchInsertArticleCategory(saveList);
 | 
											
										
											
												
													
														|  | @@ -291,14 +293,15 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |                  item.setTitle(title);
 |  |                  item.setTitle(title);
 | 
											
												
													
														|  |                  item.setTitleMd5(Md5Util.encoderByMd5(title));
 |  |                  item.setTitleMd5(Md5Util.encoderByMd5(title));
 | 
											
												
													
														|  |                  item.setCreateTimestamp(now);
 |  |                  item.setCreateTimestamp(now);
 | 
											
												
													
														|  | 
 |  | +                item.setVersion(activeVersion);
 | 
											
												
													
														|  |                  saveList.add(item);
 |  |                  saveList.add(item);
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          return saveList;
 |  |          return saveList;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    private String buildKimiPrompt(List<String> titleList) {
 |  | 
 | 
											
												
													
														|  | -        StringBuilder prompt = new StringBuilder(kimiCategoryPrompt);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    private String buildCategoryPrompt(List<String> titleList) {
 | 
											
												
													
														|  | 
 |  | +        StringBuilder prompt = new StringBuilder(categoryPrompt);
 | 
											
												
													
														|  |          prompt.append("\n");
 |  |          prompt.append("\n");
 | 
											
												
													
														|  |          for (String title : titleList) {
 |  |          for (String title : titleList) {
 | 
											
												
													
														|  |              prompt.append(title).append("\n");
 |  |              prompt.append(title).append("\n");
 | 
											
										
											
												
													
														|  | @@ -310,7 +313,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |          List<ArticleCategory> dealList = articleCategoryRepository.getByStatusAndRetryTimesLessThanAndVersion(ArticleCategoryStatusEnum.FAIL.getCode(), 3, activeVersion);
 |  |          List<ArticleCategory> dealList = articleCategoryRepository.getByStatusAndRetryTimesLessThanAndVersion(ArticleCategoryStatusEnum.FAIL.getCode(), 3, activeVersion);
 | 
											
												
													
														|  |          for (ArticleCategory articleCategory : dealList) {
 |  |          for (ArticleCategory articleCategory : dealList) {
 | 
											
												
													
														|  |              List<String> partitionTitles = Collections.singletonList(articleCategory.getTitle());
 |  |              List<String> partitionTitles = Collections.singletonList(articleCategory.getTitle());
 | 
											
												
													
														|  | -            String prompt = buildKimiPrompt(partitionTitles);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            String prompt = buildCategoryPrompt(partitionTitles);
 | 
											
												
													
														|  |              KimiResult kimiResult = deepSeekApiService.requestOfficialApi(prompt, null, null, true);
 |  |              KimiResult kimiResult = deepSeekApiService.requestOfficialApi(prompt, null, null, true);
 | 
											
												
													
														|  |              long now = System.currentTimeMillis();
 |  |              long now = System.currentTimeMillis();
 | 
											
												
													
														|  |              JSONObject obj = null;
 |  |              JSONObject obj = null;
 | 
											
										
											
												
													
														|  | @@ -321,7 +324,7 @@ public class ArticleCategoryService {
 | 
											
												
													
														|  |                      log.error(kimiResult.getResponse().getChoices().get(0).getMessage().getContent());
 |  |                      log.error(kimiResult.getResponse().getChoices().get(0).getMessage().getContent());
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | -            articleCategory.setKimiResult(kimiResult.getResponseStr());
 |  | 
 | 
											
												
													
														|  | 
 |  | +            articleCategory.setKimiResult(kimiResult.getResponseStr().trim());
 | 
											
												
													
														|  |              articleCategory.setUpdateTimestamp(now);
 |  |              articleCategory.setUpdateTimestamp(now);
 | 
											
												
													
														|  |              articleCategory.setRetryTimes(articleCategory.getRetryTimes() + 1);
 |  |              articleCategory.setRetryTimes(articleCategory.getRetryTimes() + 1);
 | 
											
												
													
														|  |              if (kimiResult.isSuccess() && Objects.nonNull(obj)) {
 |  |              if (kimiResult.isSuccess() && Objects.nonNull(obj)) {
 |