|
@@ -29,7 +29,19 @@ public class AIGCWaitingPublishContentService {
|
|
|
|
|
|
|
|
|
public List<Content> getAllContent(RecallParam param) {
|
|
|
- List<Content> result = new ArrayList<>();
|
|
|
+ int retryTimes = 2;
|
|
|
+ while (retryTimes > 0) {
|
|
|
+ List<Content> result = post(param);
|
|
|
+ if (Objects.nonNull(result)) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ retryTimes--;
|
|
|
+ }
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<Content> post(RecallParam param) {
|
|
|
+ List<Content> result = null;
|
|
|
JSONObject bodyParam = new JSONObject();
|
|
|
JSONObject bodyParamParams = new JSONObject();
|
|
|
bodyParamParams.put("accountId", param.getAccountId());
|
|
@@ -50,7 +62,7 @@ public class AIGCWaitingPublishContentService {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(responseBody);
|
|
|
if (jsonObject.getInteger("code") == 0) {
|
|
|
JSONArray data = jsonObject.getJSONArray("data");
|
|
|
- result.addAll(JSONArray.parseArray(data.toJSONString(), Content.class));
|
|
|
+ result = JSONArray.parseArray(data.toJSONString(), Content.class);
|
|
|
}
|
|
|
}
|
|
|
}
|