瀏覽代碼

修改更新状态

xueyiming 7 月之前
父節點
當前提交
530402065e

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

@@ -17,6 +17,8 @@ public class PushStatusVO {
     private Integer pushStatus;
     //"发表状态(-1-未推送不能发表,0-待发表,1-发表中,2-发表成功,3-发表失败)")
     private Integer publishStatus;
+    //错误码
+    private String errorCode;
     //"错误信息")
     private String errorMsg;
     //"推送完成时间戳")

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

@@ -624,6 +624,13 @@ public class CoreServiceImpl implements CoreService {
                 //发表失败
                 if (pushStatusVO.getPublishStatus() == 3) {
                     updateStatus = 3;
+                    if (StringUtils.isNotEmpty(pushStatusVO.getErrorCode())) {
+                        int errorCode = Integer.parseInt(pushStatusVO.getErrorCode());
+                        if (errorCode == 6 || errorCode == 7 || errorCode == 8 || errorCode == 999) {
+                            updateStatus = 2;
+                        }
+                    }
+
                 }
                 //发表成功
                 if (pushStatusVO.getPublishStatus() == 2) {
@@ -635,6 +642,9 @@ public class CoreServiceImpl implements CoreService {
                 PublishContentExample publishContentExample = new PublishContentExample();
                 publishContentExample.createCriteria().andPushIdEqualTo(pushId);
                 PublishContent update = new PublishContent();
+                if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg())) {
+                    update.setReason(pushStatusVO.getErrorMsg());
+                }
                 update.setStatus(updateStatus);
                 publishContentMapper.updateByExampleSelective(update, publishContentExample);
 

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

@@ -136,8 +136,7 @@ public class AigcServiceImpl implements AigcService {
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
-                PushStatusVO data = jsonObject.getJSONObject("data").toJavaObject(PushStatusVO.class);
-                return data;
+                return jsonObject.getJSONObject("data").toJavaObject(PushStatusVO.class);
             }
         } catch (Exception e) {
             log.error("queryPushStatus error", e);