From 87bf17eb5eaeb2ac6dec0530c683841471c07b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Thu, 26 Oct 2023 12:29:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=94=B6=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/kwan/springbootkwan/enums/CollectStatus.java | 4 ++++ .../springbootkwan/service/impl/CsdnCollectServiceImpl.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/kwan/springbootkwan/enums/CollectStatus.java b/src/main/java/com/kwan/springbootkwan/enums/CollectStatus.java index 9df023b..975c8f6 100644 --- a/src/main/java/com/kwan/springbootkwan/enums/CollectStatus.java +++ b/src/main/java/com/kwan/springbootkwan/enums/CollectStatus.java @@ -22,6 +22,10 @@ public enum CollectStatus { * 参数缺失 */ MISSING_PARAMETER(3, "参数缺失"), + /** + * 其他错误 + */ + OTHER_ERRORS(4, "其他错误"), /** * 收藏成功 */ diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java index 1d4d627..60b9986 100644 --- a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java +++ b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java @@ -55,6 +55,7 @@ public class CsdnCollectServiceImpl implements CsdnCollectService { csdnUserInfo.setCollectStatus(CollectStatus.HAVE_ALREADY_COLLECT.getCode()); } else { log.info("文章{}未收藏", articleId); + csdnUserInfo.setCollectStatus(CollectStatus.UN_PROCESSED.getCode()); } return status; } @@ -109,6 +110,9 @@ public class CsdnCollectServiceImpl implements CsdnCollectService { } else if (code.equals(400)) { log.info("今日收藏次数已达上限!"); csdnUserInfo.setCollectStatus(CollectStatus.COLLECT_IS_FULL.getCode()); + } else { + log.info("其他收藏错误"); + csdnUserInfo.setCollectStatus(CollectStatus.OTHER_ERRORS.getCode()); } return true; } -- GitLab