diff --git a/src/main/java/com/kwan/springbootkwan/enums/CollectStatus.java b/src/main/java/com/kwan/springbootkwan/enums/CollectStatus.java index 9df023bea088f3eca854eb3bede7a1c9f96523c0..975c8f689838c583501c0c0a0a3d403c191101ec 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 1d4d6272135f3cebd301974218df8782487c9653..60b9986595f39f70fb8bd5faa44227b241c61d9e 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; }