|
@@ -109,16 +109,12 @@ public class RecallService implements ApplicationContextAware {
|
|
|
}
|
|
|
|
|
|
public RecallResult recall(RecallParam param) {
|
|
|
- long t1 = System.currentTimeMillis();
|
|
|
List<RecallResult.RecallData> results = new ArrayList<>();
|
|
|
log.info("RecallParam {}", JSONUtils.toJson(param));
|
|
|
List<RecallStrategy> strategies = getRecallStrategy(param);
|
|
|
log.info("RecallStrategy {}", JSONUtils.toJson(CommonCollectionUtils.toList(strategies,
|
|
|
s -> s.getClass().getSimpleName())));
|
|
|
List<Content> content = getAllContent(param);
|
|
|
- long t2 = System.currentTimeMillis();
|
|
|
- log.info("recall account:{} get content:{}", param.getAccountName(), t2 - t1);
|
|
|
- CostMonitor.logCost("Recall", "GetContent", t2 - t1);
|
|
|
if (CollectionUtils.isEmpty(content)) {
|
|
|
return new RecallResult(results);
|
|
|
}
|
|
@@ -166,7 +162,10 @@ public class RecallService implements ApplicationContextAware {
|
|
|
}
|
|
|
|
|
|
private List<Content> getAllContent(RecallParam param) {
|
|
|
+ long t1 = System.currentTimeMillis();
|
|
|
List<Content> content = aigcWaitingPublishContentService.getAllContent(param);
|
|
|
+ long t2 = System.currentTimeMillis();
|
|
|
+ CostMonitor.logCost("Recall", "GetAllContents", t2 - t1);
|
|
|
if (CollectionUtils.isEmpty(content)) {
|
|
|
FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.RECOMMEND.getRobotId(),
|
|
|
"内容召回失败\n"
|
|
@@ -177,8 +176,12 @@ public class RecallService implements ApplicationContextAware {
|
|
|
}
|
|
|
// category 查询
|
|
|
setContentCategory(content);
|
|
|
+ long t3 = System.currentTimeMillis();
|
|
|
+ CostMonitor.logCost("Recall", "GetCategory", t3 - t2);
|
|
|
// 标题历史均值
|
|
|
setTitleAvgViewCount(content, param.getGhId(), param.getType());
|
|
|
+ long t4 = System.currentTimeMillis();
|
|
|
+ CostMonitor.logCost("Recall", "SetAvgViewCount", t4 - t3);
|
|
|
return content;
|
|
|
}
|
|
|
|