|
@@ -2,6 +2,7 @@ package com.tzld.longarticle.recommend.server.remote.aigc;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.tzld.longarticle.recommend.server.common.HttpPoolFactory;
|
|
|
+import com.tzld.longarticle.recommend.server.model.dto.Content;
|
|
|
import com.tzld.longarticle.recommend.server.model.vo.aigc.ProducePlanDetailVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.http.HttpEntity;
|
|
@@ -24,6 +25,22 @@ public class AIGCProducePlanDetailService {
|
|
|
private final CloseableHttpClient client = HttpPoolFactory.aigcPool();
|
|
|
|
|
|
public ProducePlanDetailVO articleGetProducePlanDetail(String planId) {
|
|
|
+ int retryTimes = 2;
|
|
|
+ while (retryTimes > 0) {
|
|
|
+ ProducePlanDetailVO result = post(planId);
|
|
|
+ if (Objects.nonNull(result)) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ retryTimes--;
|
|
|
+ try {
|
|
|
+ Thread.sleep(1000);
|
|
|
+ } catch (InterruptedException ignored) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ProducePlanDetailVO post(String planId) {
|
|
|
String apiUrl = "http://aigc-api.cybertogether.net/aigc/produce/plan/detail";
|
|
|
|
|
|
// 构建请求的 JSON Payload
|