fix:收藏

上级 87bf17eb
...@@ -4,7 +4,7 @@ import lombok.Data; ...@@ -4,7 +4,7 @@ import lombok.Data;
@Data @Data
public class CollectResponse { public class CollectResponse {
public Long code; public int code;
public String msg; public String msg;
public String total; public String total;
public Object data; public Object data;
......
...@@ -100,14 +100,14 @@ public class CsdnCollectServiceImpl implements CsdnCollectService { ...@@ -100,14 +100,14 @@ public class CsdnCollectServiceImpl implements CsdnCollectService {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
e.printStackTrace(); e.printStackTrace();
} }
final Long code = collectResponse.code; final int code = collectResponse.code;
if (code.equals(200)) { if (code == 200) {
log.info("文章{}收藏成功", articleId); log.info("文章{}收藏成功", articleId);
csdnUserInfo.setCollectStatus(CollectStatus.COLLECT_SUCCESSFUL.getCode()); csdnUserInfo.setCollectStatus(CollectStatus.COLLECT_SUCCESSFUL.getCode());
} else if (code.equals(400000101)) { } else if (code == 400000101) {
log.info("收藏文章{}参数缺失", articleId); log.info("收藏文章{}参数缺失", articleId);
csdnUserInfo.setCollectStatus(CollectStatus.MISSING_PARAMETER.getCode()); csdnUserInfo.setCollectStatus(CollectStatus.MISSING_PARAMETER.getCode());
} else if (code.equals(400)) { } else if (code == 400) {
log.info("今日收藏次数已达上限!"); log.info("今日收藏次数已达上限!");
csdnUserInfo.setCollectStatus(CollectStatus.COLLECT_IS_FULL.getCode()); csdnUserInfo.setCollectStatus(CollectStatus.COLLECT_IS_FULL.getCode());
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册