diff --git a/src/main/java/com/kwan/springbootkwan/controller/CsdnController.java b/src/main/java/com/kwan/springbootkwan/controller/CsdnController.java index 5f9835155494d2dd7e256bc914d8b9c0baa71854..64be8d3396cb063839d75b6698ca15f74c08057c 100644 --- a/src/main/java/com/kwan/springbootkwan/controller/CsdnController.java +++ b/src/main/java/com/kwan/springbootkwan/controller/CsdnController.java @@ -30,7 +30,8 @@ public class CsdnController { @ApiOperation(value = "单人三连", notes = "单人三连") @GetMapping("/singleTriplet") public Result singleTriplet(@Param("username") String username) { - return Result.ok(csdnService.singleArticle(username)); + csdnService.singleArticle(username); + return Result.ok("三连完成"); } @ApiOperation(value = "多人三连", notes = "多人三连") diff --git a/src/main/java/com/kwan/springbootkwan/entity/CsdnStatusResp.java b/src/main/java/com/kwan/springbootkwan/entity/CsdnStatusResp.java deleted file mode 100644 index ef9ba8f25676c6d56e36ea9b10b66cdd0bfaf095..0000000000000000000000000000000000000000 --- a/src/main/java/com/kwan/springbootkwan/entity/CsdnStatusResp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.kwan.springbootkwan.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CsdnStatusResp { - - public Integer code; - public String value; -} diff --git a/src/main/java/com/kwan/springbootkwan/entity/resp/BusinessInfo.java b/src/main/java/com/kwan/springbootkwan/entity/resp/BusinessInfoResponse.java similarity index 87% rename from src/main/java/com/kwan/springbootkwan/entity/resp/BusinessInfo.java rename to src/main/java/com/kwan/springbootkwan/entity/resp/BusinessInfoResponse.java index 30fe26a079fd59f7f85825b75b86433b1b27fea3..eb173b90b4efd6ce75df6f16f25391b338fbd131 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/resp/BusinessInfo.java +++ b/src/main/java/com/kwan/springbootkwan/entity/resp/BusinessInfoResponse.java @@ -7,7 +7,7 @@ import lombok.Data; import java.util.List; @Data -public class BusinessInfo { +public class BusinessInfoResponse { private String traceId; private Integer code; @@ -48,16 +48,16 @@ public class BusinessInfo { public static void main(String[] args) { String body = " {\"code\":200,\"message\":\"success\",\"traceId\":\"56e59727-b0e5-4017-b613-3bfb9dbee864\",\"data\":{\"list\":[{\"type\":\"blog\",\"formatTime\":\"12 分钟前\",\"title\":\"【实战项目】从0到1实现高并发内存池(上)\",\"description\":\"\u200B本篇文章是实现一个高并发的内存池,他的原型是google的一个开源项目tcmalloc(tcmalloc源码),tcmalloc全称Thread-Caching Malloc,即线程缓存的malloc,是一种用于内存分配和管理的内存分配器(内存池)。这个项目旨在提高多线程应用程序的性能,实现了高效的多线程内存管理。\",\"hasOriginal\":true,\"diggCount\":4,\"commentCount\":3,\"postTime\":1698045098000,\"createTime\":1697553615000,\"url\":\"https://blog.csdn.net/weixin_67596609/article/details/133895730\",\"articleType\":1,\"viewCount\":36,\"picList\":[\"https://img-blog.csdnimg.cn/b7634b29af834f9d88cad6ba1de0258a.png\"],\"editUrl\":\"https://mp.csdn.net/console/editor/html/133895730\",\"collectCount\":3,\"rtype\":\"article\"},{\"type\":\"blink\",\"formatTime\":\"昨天 10:40\",\"title\":\"前几天由于一些原因,没有更新文章。最近要开始持续更新啦!\\nps:想多了全是问题,做多了全是答案!加油!\\n\",\"picList\":[{\"thumbnail\":\"https://userblink.csdnimg.cn/6748783d6e974f5da67346c6b0e9b2f0.png?x-oss-process=image/interlace,1/format,jpg/resize,w_375\",\"url\":\"https://userblink.csdnimg.cn/6748783d6e974f5da67346c6b0e9b2f0.png\"}],\"createTime\":1697942415000,\"url\":\"https://blink.csdn.net/details/1591445\",\"source\":1,\"expandTitle\":null,\"cover\":null,\"rtype\":\"picture\"}],\"total\":null}}"; ObjectMapper objectMapper = new ObjectMapper(); - BusinessInfo businessInfo = null; + BusinessInfoResponse businessInfoResponse = null; try { - businessInfo = objectMapper.readValue(body, BusinessInfo.class); - System.out.println(businessInfo); + businessInfoResponse = objectMapper.readValue(body, BusinessInfoResponse.class); + System.out.println(businessInfoResponse); } catch (JsonProcessingException e) { e.printStackTrace(); } - final BusinessInfo.ArticleData data = businessInfo.getData(); - final List list = data.getList(); - final BusinessInfo.ArticleData.Article article = list.get(0); + final BusinessInfoResponse.ArticleData data = businessInfoResponse.getData(); + final List list = data.getList(); + final BusinessInfoResponse.ArticleData.Article article = list.get(0); final String type = article.getType(); final String urlInfo = article.getUrl(); System.out.println(type); diff --git a/src/main/java/com/kwan/springbootkwan/entity/resp/CollectInfo.java b/src/main/java/com/kwan/springbootkwan/entity/resp/CollectInfoQuery.java similarity index 91% rename from src/main/java/com/kwan/springbootkwan/entity/resp/CollectInfo.java rename to src/main/java/com/kwan/springbootkwan/entity/resp/CollectInfoQuery.java index c4ae2834911b177979265cc0547fb902de494899..dfe8c96947c272a37d3aa1701d453c15bcae00a1 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/resp/CollectInfo.java +++ b/src/main/java/com/kwan/springbootkwan/entity/resp/CollectInfoQuery.java @@ -5,7 +5,7 @@ import lombok.Data; import java.util.List; @Data -public class CollectInfo { +public class CollectInfoQuery { private Integer sourceId; private String fromType; private String author; diff --git a/src/main/java/com/kwan/springbootkwan/entity/resp/CollectData.java b/src/main/java/com/kwan/springbootkwan/entity/resp/CollectResponse.java similarity index 83% rename from src/main/java/com/kwan/springbootkwan/entity/resp/CollectData.java rename to src/main/java/com/kwan/springbootkwan/entity/resp/CollectResponse.java index 0fe518169b4d99801ecdba822f0c1f491da7aa7e..04f8936065070a8c1ec9b2500fc622067c525b8e 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/resp/CollectData.java +++ b/src/main/java/com/kwan/springbootkwan/entity/resp/CollectResponse.java @@ -3,7 +3,7 @@ package com.kwan.springbootkwan.entity.resp; import lombok.Data; @Data -public class CollectData { +public class CollectResponse { public Long code; public String msg; public String total; diff --git a/src/main/java/com/kwan/springbootkwan/entity/resp/CommentData.java b/src/main/java/com/kwan/springbootkwan/entity/resp/CommentListResponse.java similarity index 98% rename from src/main/java/com/kwan/springbootkwan/entity/resp/CommentData.java rename to src/main/java/com/kwan/springbootkwan/entity/resp/CommentListResponse.java index da2905e7817804daa1540bfb8eecafa646354321..f8dbd1684119a0496b148af58f55cf56365821fb 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/resp/CommentData.java +++ b/src/main/java/com/kwan/springbootkwan/entity/resp/CommentListResponse.java @@ -5,7 +5,7 @@ import lombok.Data; import java.util.List; @Data -public class CommentData { +public class CommentListResponse { public int code; public String message; public String traceId; diff --git a/src/main/java/com/kwan/springbootkwan/entity/resp/CommentResponse.java b/src/main/java/com/kwan/springbootkwan/entity/resp/CommentResponse.java new file mode 100644 index 0000000000000000000000000000000000000000..881d3d540da88c0bff1f87fc8d99a6a7ff2863c5 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/entity/resp/CommentResponse.java @@ -0,0 +1,11 @@ +package com.kwan.springbootkwan.entity.resp; + +import lombok.Data; + +@Data +public class CommentResponse { + public int code; + public String message; + public String traceId; + public int data; +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/entity/resp/IsCollectResponse.java b/src/main/java/com/kwan/springbootkwan/entity/resp/IsCollectResponse.java new file mode 100644 index 0000000000000000000000000000000000000000..c3b05f36e88b71b6026ade24dff76b7253c0f393 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/entity/resp/IsCollectResponse.java @@ -0,0 +1,17 @@ +package com.kwan.springbootkwan.entity.resp; + +import lombok.Data; + +@Data +public class IsCollectResponse { + public int code; + public String message; + public String traceId; + public CollectDataDetail data; + + @Data + public static class CollectDataDetail { + public String tips; + public boolean status; + } +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/entity/resp/LikeData.java b/src/main/java/com/kwan/springbootkwan/entity/resp/LikeResponse.java similarity index 92% rename from src/main/java/com/kwan/springbootkwan/entity/resp/LikeData.java rename to src/main/java/com/kwan/springbootkwan/entity/resp/LikeResponse.java index 436107ce4407357e302aed357e33d1e6229a0947..f3bd90c0ce60aae297a42c32b450ee1c027a9876 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/resp/LikeData.java +++ b/src/main/java/com/kwan/springbootkwan/entity/resp/LikeResponse.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data -public class LikeData { +public class LikeResponse { public int code; public String message; public String traceId; diff --git a/src/main/java/com/kwan/springbootkwan/service/CsdnCollectService.java b/src/main/java/com/kwan/springbootkwan/service/CsdnCollectService.java new file mode 100644 index 0000000000000000000000000000000000000000..605582b449812bd1867cab0e7b0f58ae8ca544d6 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/service/CsdnCollectService.java @@ -0,0 +1,28 @@ +package com.kwan.springbootkwan.service; + + +import com.kwan.springbootkwan.entity.resp.BusinessInfoResponse; + +/** + * 收藏 + * + * @author : qinyingjie + * @version : 2.2.0 + * @date : 2023/10/24 01:00 + */ +public interface CsdnCollectService { + + /** + * 查询是否收藏过 + * + * @return + */ + Boolean isCollect(String articleId); + + /** + * 点赞和取消点赞接口,true,点过,false,没有点过 + * + * @return + */ + Boolean collect(BusinessInfoResponse.ArticleData.Article article, String username); +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/service/CsdnCommentService.java b/src/main/java/com/kwan/springbootkwan/service/CsdnCommentService.java new file mode 100644 index 0000000000000000000000000000000000000000..468623e4ba8280ee5284dba16143b9c15e2a7915 --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/service/CsdnCommentService.java @@ -0,0 +1,27 @@ +package com.kwan.springbootkwan.service; + +import com.kwan.springbootkwan.entity.resp.BusinessInfoResponse; + +/** + * 评论 + * + * @author : qinyingjie + * @version : 2.2.0 + * @date : 2023/10/24 01:25 + */ +public interface CsdnCommentService { + + /** + * 查询是否评论过 + * + * @return + */ + Boolean isComment(BusinessInfoResponse.ArticleData.Article article); + + /** + * 点赞和取消点赞接口,true,点过,false,没有点过 + * + * @return + */ + Boolean comment(String articleId); +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/service/CsdnLikeService.java b/src/main/java/com/kwan/springbootkwan/service/CsdnLikeService.java index 9f1fb687e83be1aa9e094bfd55f9c6fd678b5931..b6a535967ad915ca6334c1a604c8e1e80a5a3530 100644 --- a/src/main/java/com/kwan/springbootkwan/service/CsdnLikeService.java +++ b/src/main/java/com/kwan/springbootkwan/service/CsdnLikeService.java @@ -9,8 +9,17 @@ package com.kwan.springbootkwan.service; * @date : 2023/10/24 00:19 */ public interface CsdnLikeService { + + /** + * 查询是否点过赞 + * todo:还未找到接口,搁浅 + * + * @return + */ + Boolean islike(String articleId); + /** - * 是否点过赞,true,点过,false,没有点过 + * 点赞和取消点赞接口,true,点过,false,没有点过 * * @return */ diff --git a/src/main/java/com/kwan/springbootkwan/service/CsdnService.java b/src/main/java/com/kwan/springbootkwan/service/CsdnService.java index 6d04066a9e6f7bd390baf6b740c9fccf51951bc2..88930e4dd8e2f14fa2c87d742bccfa1c1fb469df 100644 --- a/src/main/java/com/kwan/springbootkwan/service/CsdnService.java +++ b/src/main/java/com/kwan/springbootkwan/service/CsdnService.java @@ -1,7 +1,5 @@ package com.kwan.springbootkwan.service; -import com.kwan.springbootkwan.entity.CsdnStatusResp; - /** * csdn博客自动化 * @@ -10,37 +8,16 @@ import com.kwan.springbootkwan.entity.CsdnStatusResp; * @date : 2023/10/23 14:59 */ public interface CsdnService { - /** - * 单人三连 - * - * @return - */ - CsdnStatusResp singleArticle(String username); /** - * 查询是否评论过 + * 单人三连 * - * @param articleId * @return */ - Boolean getArticleInfo(String articleId); - - /** - * 点赞 - * - * @param articleId - */ - void like(String articleId); - - /** - * 评论 - * - * @param articleId - */ - int comment(String articleId); + void singleArticle(String username); /** - * 三连 + * 多人三连 */ void multiTriplet(); } \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..3a77af9c1bce5c1ba615b55b2cc4ff78ec0a506d --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java @@ -0,0 +1,107 @@ +package com.kwan.springbootkwan.service.impl; + +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.Lists; +import com.kwan.springbootkwan.entity.resp.BusinessInfoResponse; +import com.kwan.springbootkwan.entity.resp.CollectInfoQuery; +import com.kwan.springbootkwan.entity.resp.CollectResponse; +import com.kwan.springbootkwan.entity.resp.IsCollectResponse; +import com.kwan.springbootkwan.service.CsdnCollectService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +public class CsdnCollectServiceImpl implements CsdnCollectService { + + @Value("${csdn.cookie}") + private String csdnCookie; + @Value("${csdn.self_user_name}") + private String selfUserName; + @Value("${csdn.url.is_collect_url}") + private String isCollectUrl; + @Value("${csdn.url.add_collect_url}") + private String addCollectUrl; + + /** + * 收藏满了 + */ + private static boolean COLLECT_IS_FULL = false; + + + @Override + public Boolean isCollect(String articleId) { + if (COLLECT_IS_FULL) { + return true; + } + HttpResponse response = HttpUtil.createGet(isCollectUrl) + .header("Cookie", csdnCookie) + .form("articleId", articleId) + .execute(); + final String body = response.body(); + ObjectMapper objectMapper = new ObjectMapper(); + try { + final int code = objectMapper.readValue(body, IsCollectResponse.class).code; + final IsCollectResponse.CollectDataDetail data = objectMapper.readValue(body, IsCollectResponse.class).getData(); + if (code == 200) { + final boolean status = data.status; + if (status) { + log.info("已收藏"); + } else { + log.info("未收藏"); + } + return status; + } + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return true; + } + + @Override + public Boolean collect(BusinessInfoResponse.ArticleData.Article article, String username) { + if (COLLECT_IS_FULL) { + return true; + } + final String urlInfo = article.getUrl(); + String articleId = urlInfo.substring(urlInfo.lastIndexOf("/") + 1); + CollectResponse collectResponse = null; + try { + CollectInfoQuery collectInfoQuery = new CollectInfoQuery(); + collectInfoQuery.setSourceId(Integer.valueOf(articleId)); + collectInfoQuery.setFromType("PC"); + collectInfoQuery.setAuthor(username); + collectInfoQuery.setDescription(article.getDescription()); + collectInfoQuery.setSource("blog"); + collectInfoQuery.setFolderIdList(Lists.newArrayList(7589042)); + collectInfoQuery.setTitle(article.getTitle()); + collectInfoQuery.setUrl(article.getUrl()); + collectInfoQuery.setUsername(selfUserName); + ObjectMapper objectMapper = new ObjectMapper(); + String jsonCollectInfo = objectMapper.writeValueAsString(collectInfoQuery); + HttpResponse response = HttpUtil.createPost(addCollectUrl) + .header("Cookie", csdnCookie) + .header("Content-Type", "application/json") + .body(jsonCollectInfo) + .execute(); + final String body = response.body(); + collectResponse = objectMapper.readValue(body, CollectResponse.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + final Long code = collectResponse.code; + if (code.equals(200)) { + log.info("收藏成功"); + } else if (code.equals(400000101)) { + log.info("参数缺失"); + } else if (code.equals(400)) { + COLLECT_IS_FULL = true; + log.info("今日收藏次数已达上限!"); + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..ab564bd2ca086d334751fd38b7ef9db97aebf8dc --- /dev/null +++ b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java @@ -0,0 +1,117 @@ +package com.kwan.springbootkwan.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.kwan.springbootkwan.entity.resp.BusinessInfoResponse; +import com.kwan.springbootkwan.entity.resp.CommentListResponse; +import com.kwan.springbootkwan.entity.resp.CommentResponse; +import com.kwan.springbootkwan.service.CsdnCommentService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@Service +public class CsdnCommentServiceImpl implements CsdnCommentService { + + @Value("${csdn.cookie}") + private String csdnCookie; + @Value("${csdn.self_user_name}") + private String selfUserName; + @Value("${csdn.url.is_comment_list_url}") + private String commentListUrl; + @Value("${csdn.url.comment_url}") + private String commentUrl; + /** + * 收藏满了 + */ + private static boolean COMMENT_IS_FULL = false; + + @Override + public Boolean isComment(BusinessInfoResponse.ArticleData.Article article) { + if (COMMENT_IS_FULL) { + return true; + } + final String urlInfo = article.getUrl(); + String articleId = urlInfo.substring(urlInfo.lastIndexOf("/") + 1); + String url = commentListUrl + articleId; + // 使用Hutool发送GET请求 + HttpResponse response = HttpUtil.createPost(url) + .header("Cookie", csdnCookie) + .form("page", 1) + .form("size", 50) + .form("fold", "unfold") + .execute(); + // 打印响应结果 + final String body = response.body(); + ObjectMapper objectMapper = new ObjectMapper(); + CommentListResponse articleInfo; + try { + articleInfo = objectMapper.readValue(body, CommentListResponse.class); + final CommentListResponse.DataInfo data = articleInfo.getData(); + final List list = data.getList(); + if (CollectionUtil.isNotEmpty(list)) { + for (CommentListResponse.Comment comment : list) { + final CommentListResponse.Info info = comment.getInfo(); + final String userName = info.getUserName(); + if (StringUtils.equals(userName, selfUserName)) { + //评论过 + return true; + } + } + } + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return false; + } + + @Override + public Boolean comment(String articleId) { + if (COMMENT_IS_FULL) { + return true; + } + //评论 + CommentResponse comment = this.dealComment(articleId); + final int code = comment.code; + final String message = comment.getMessage(); + if (code == 200) { + log.info("评论成功"); + } else if (code == 400 && StringUtils.equals(message, "您已达到当日发送上限,请明天尝试!")) { + log.info(message); + COMMENT_IS_FULL = true; + } else { + log.info("您评论太快了,请休息一下!"); + } + return true; + } + + /** + * 评论文章 + * + * @param articleId + * @return + */ + private CommentResponse dealComment(String articleId) { + HttpResponse response = HttpUtil.createPost(commentUrl) + .header("Cookie", csdnCookie) + .form("articleId", articleId) + .form("content", "支持博主优质文章,讲解得非常详细,干货满满,通俗易懂,期待博主下次更新") + .execute(); + final String body = response.body(); + ObjectMapper objectMapper = new ObjectMapper(); + CommentResponse commentResponse = null; + try { + commentResponse = objectMapper.readValue(body, CommentResponse.class); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return commentResponse; + } +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnLikeServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnLikeServiceImpl.java index 17a2e2bfda8fdb74c30ffdbe2273308c7fb7b6fd..2c176b60ad2eb19a73d5719412933d2fdea5a04a 100644 --- a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnLikeServiceImpl.java +++ b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnLikeServiceImpl.java @@ -4,44 +4,44 @@ import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.kwan.springbootkwan.entity.resp.LikeData; +import com.kwan.springbootkwan.entity.resp.LikeResponse; import com.kwan.springbootkwan.service.CsdnLikeService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @Slf4j @Service public class CsdnLikeServiceImpl implements CsdnLikeService { - /** - * 构建header参数 - */ - private static final String CUSTOM_HEADER_NAME = "Cookie"; + @Value("${csdn.cookie}") + private String csdnCookie; + @Value("${csdn.url.like_url}") + private String url; /** * 点赞满了 */ private static boolean LIKE_IS_FULL = false; - /** - * 参数值 - */ - private static final String CUSTOM_HEADER_VALUE = "uuid_tt_dd=10_20285116700-1697522872601-604163; c_adb=1; loginbox_strategy=%7B%22taskId%22%3A308%2C%22abCheckTime%22%3A1697522874474%2C%22version%22%3A%22control%22%7D; UserName=qyj19920704; UserInfo=a7d3b88c53a841ebb5792202cb43c84f; UserToken=a7d3b88c53a841ebb5792202cb43c84f; UserNick=%E6%AA%80%E8%B6%8A%E5%89%91%E6%8C%87%E5%A4%A7%E5%8E%82; AU=769; UN=qyj19920704; BT=1697522886100; p_uid=U010000; Hm_up_6bcd52f51e9b3dce32bec4a3997715ac=%7B%22islogin%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isonline%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isvip%22%3A%7B%22value%22%3A%220%22%2C%22scope%22%3A1%7D%2C%22uid_%22%3A%7B%22value%22%3A%22qyj19920704%22%2C%22scope%22%3A1%7D%7D; management_ques=1697592152734; blog_details_recommend_nps=1697616147423; c_segment=3; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=1697522874,1697551027,1697636661,1697683407; csrfToken=jTRD3_1IBVA703lu2FkVkazx; dc_sid=9f7a02ed8375e91d86271ddaf1cf2ce4; c_first_ref=default; c_first_page=https%3A//liucy.blog.csdn.net/article/details/133852303%3Fspm%3D1001.2014.3001.5502; c_segment=3; Hm_lvt_e5ef47b9f471504959267fd614d579cd=1697764951; Hm_lpvt_e5ef47b9f471504959267fd614d579cd=1697764951; 404_page_nps=1697764955523; ssxmod_itna=YqUxBD97kOGHD8D2BmYite44zxcYo1=WOiox0vmvqGzDAxn40iDtgeqODDwu0/DNMQiDpiDuWOntaV73S5fd3iPeaN3D84i7DKqibDCqD1D3qDktzDYA8Dt4DTD34DYDiO=DBRsUQDFATN/3wUjmGtDG4DgDB=DxBEl3djBAq4DCr4DbxPy7mrDtLNSeLLdXT0/nn5Yf445SOG5lipwm0GdG7vwBA4PlDxNt8v1wADoGGGQYf+IE75ep753zpDxD; ssxmod_itna2=YqUxBD97kOGHD8D2BmYite44zxcYo1=WOYxn9EenDDsYebDLGQCoqQuGvHdDQRKYubdD6QqomsRD3xyRI/W9Q5nhe8oeYUvimaWYrNsqwcDgL6mDjYUhZK09LYcY/t5hSuP2va/kclf6hRkNh+LPyDwic73=9i4d94Lvw/R=oQ7E+jT4jjjA2Y+=QplLm8nbePRb+7=Re1CpjmZ4wIrnNPSKofWnIj=WOtkFtphylt+GhUxr0KkGtTzDXKDEEkbn3qhIn3Sj/ezt1u2MO3M9h7zEL6RunrXaKE+YdkRnIKiTG93cqpGFq8Fwr7ehksk1ZSWhoN2hQydddqQ1bTOSW8ddX+7g24v4TZ0+52=Y8PsOwfhavW4ECY8+GZOK=ro97bK0=Yi3YD5ZGsq25FhPodIRGCD2O8xidfo8+NR88v+rq4+b=fUOEK2frPEPdLFuYkao9uCfM1+cFZQ7q6HEMfRLjf6bhof0=1YhEYO1U=NZCPvDDw2Psluciq4De13mDNBODwqLwwg44qwOiDf=j1fKK5q+8gd7DDjKDeMv/04YDmLGvrwqOz4cov79500D4D==; c_first_ref=default; c_first_page=https%3A//mp.csdn.net/; creative_btn_mp=3; c_hasSub=true; write_guide_show=3; log_Id_click=177; dc_session_id=11_1698022100317.787671; c_dsid=11_1698022100317.794351; log_Id_pv=149; log_Id_view=1105; c_pref=https%3A//i.csdn.net/; c_ref=https%3A//blog.csdn.net/imwucx; c_page_id=default; dc_session_id=11_1698022100317.787671; c_dsid=11_1698022100317.794351; log_Id_view=1106; dc_tos=s2yi9b; log_Id_click=178; c_pref=https%3A//blog.csdn.net/imwucx; log_Id_pv=150; creativeSetApiNew=%7B%22toolbarImg%22%3Anull%2C%22publishSuccessImg%22%3Anull%2C%22articleNum%22%3A895%2C%22type%22%3A0%2C%22oldUser%22%3Afalse%2C%22useSeven%22%3Afalse%2C%22userName%22%3A%22qyj19920704%22%7D; c_ref=https%3A//cxian.blog.csdn.net/article/details/131299195; c_page_id=default; Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1698022433; dc_tos=s2yinc"; + + @Override + public Boolean islike(String articleId) { + return true; + } @Override public Boolean like(String articleId) { if (LIKE_IS_FULL) { return true; } - String url = "https://blog.csdn.net//phoenix/web/v1/article/like"; - // 使用Hutool发送GET请求 HttpResponse response = HttpUtil.createPost(url) - .header(CUSTOM_HEADER_NAME, CUSTOM_HEADER_VALUE) + .header("Cookie", csdnCookie) .form("articleId", articleId) .execute(); final String body = response.body(); ObjectMapper objectMapper = new ObjectMapper(); try { - final int code = objectMapper.readValue(body, LikeData.class).code; - final LikeData.LikeDataDetail data = objectMapper.readValue(body, LikeData.class).getData(); + final int code = objectMapper.readValue(body, LikeResponse.class).code; + final LikeResponse.LikeDataDetail data = objectMapper.readValue(body, LikeResponse.class).getData(); if (code == 200) { final boolean status = data.status; if (status) { diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java index 8580d21bc1339fb820655b0688235b7e87f60c77..8d9eef73d4b7f1dbad63afad88c275b673672f84 100644 --- a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java +++ b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java @@ -5,18 +5,16 @@ import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.collect.Lists; -import com.kwan.springbootkwan.entity.CsdnStatusResp; import com.kwan.springbootkwan.entity.CsdnUserInfo; -import com.kwan.springbootkwan.entity.resp.BusinessInfo; -import com.kwan.springbootkwan.entity.resp.CollectData; -import com.kwan.springbootkwan.entity.resp.CollectInfo; -import com.kwan.springbootkwan.entity.resp.CommentData; +import com.kwan.springbootkwan.entity.resp.BusinessInfoResponse; +import com.kwan.springbootkwan.service.CsdnCollectService; +import com.kwan.springbootkwan.service.CsdnCommentService; import com.kwan.springbootkwan.service.CsdnService; import com.kwan.springbootkwan.service.CsdnUserInfoService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.List; @@ -25,187 +23,66 @@ import java.util.List; @Slf4j @Service public class CsdnServiceImpl implements CsdnService { - /** - * 构建header参数 - */ - private static final String CUSTOM_HEADER_NAME = "Cookie"; - /** - * 点赞满了 - */ - private static boolean LIKE_IS_FULL = false; - /** - * 收藏满了 - */ - private static boolean COLLECT_IS_FULL = false; - /** - * 参数值 - */ - private static final String CUSTOM_HEADER_VALUE = "uuid_tt_dd=10_20285116700-1697522872601-604163; c_adb=1; loginbox_strategy=%7B%22taskId%22%3A308%2C%22abCheckTime%22%3A1697522874474%2C%22version%22%3A%22control%22%7D; UserName=qyj19920704; UserInfo=a7d3b88c53a841ebb5792202cb43c84f; UserToken=a7d3b88c53a841ebb5792202cb43c84f; UserNick=%E6%AA%80%E8%B6%8A%E5%89%91%E6%8C%87%E5%A4%A7%E5%8E%82; AU=769; UN=qyj19920704; BT=1697522886100; p_uid=U010000; Hm_up_6bcd52f51e9b3dce32bec4a3997715ac=%7B%22islogin%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isonline%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isvip%22%3A%7B%22value%22%3A%220%22%2C%22scope%22%3A1%7D%2C%22uid_%22%3A%7B%22value%22%3A%22qyj19920704%22%2C%22scope%22%3A1%7D%7D; management_ques=1697592152734; blog_details_recommend_nps=1697616147423; c_segment=3; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=1697522874,1697551027,1697636661,1697683407; csrfToken=jTRD3_1IBVA703lu2FkVkazx; dc_sid=9f7a02ed8375e91d86271ddaf1cf2ce4; c_first_ref=default; c_first_page=https%3A//liucy.blog.csdn.net/article/details/133852303%3Fspm%3D1001.2014.3001.5502; c_segment=3; Hm_lvt_e5ef47b9f471504959267fd614d579cd=1697764951; Hm_lpvt_e5ef47b9f471504959267fd614d579cd=1697764951; 404_page_nps=1697764955523; ssxmod_itna=YqUxBD97kOGHD8D2BmYite44zxcYo1=WOiox0vmvqGzDAxn40iDtgeqODDwu0/DNMQiDpiDuWOntaV73S5fd3iPeaN3D84i7DKqibDCqD1D3qDktzDYA8Dt4DTD34DYDiO=DBRsUQDFATN/3wUjmGtDG4DgDB=DxBEl3djBAq4DCr4DbxPy7mrDtLNSeLLdXT0/nn5Yf445SOG5lipwm0GdG7vwBA4PlDxNt8v1wADoGGGQYf+IE75ep753zpDxD; ssxmod_itna2=YqUxBD97kOGHD8D2BmYite44zxcYo1=WOYxn9EenDDsYebDLGQCoqQuGvHdDQRKYubdD6QqomsRD3xyRI/W9Q5nhe8oeYUvimaWYrNsqwcDgL6mDjYUhZK09LYcY/t5hSuP2va/kclf6hRkNh+LPyDwic73=9i4d94Lvw/R=oQ7E+jT4jjjA2Y+=QplLm8nbePRb+7=Re1CpjmZ4wIrnNPSKofWnIj=WOtkFtphylt+GhUxr0KkGtTzDXKDEEkbn3qhIn3Sj/ezt1u2MO3M9h7zEL6RunrXaKE+YdkRnIKiTG93cqpGFq8Fwr7ehksk1ZSWhoN2hQydddqQ1bTOSW8ddX+7g24v4TZ0+52=Y8PsOwfhavW4ECY8+GZOK=ro97bK0=Yi3YD5ZGsq25FhPodIRGCD2O8xidfo8+NR88v+rq4+b=fUOEK2frPEPdLFuYkao9uCfM1+cFZQ7q6HEMfRLjf6bhof0=1YhEYO1U=NZCPvDDw2Psluciq4De13mDNBODwqLwwg44qwOiDf=j1fKK5q+8gd7DDjKDeMv/04YDmLGvrwqOz4cov79500D4D==; c_first_ref=default; c_first_page=https%3A//mp.csdn.net/; creative_btn_mp=3; c_hasSub=true; write_guide_show=3; log_Id_click=177; dc_session_id=11_1698022100317.787671; c_dsid=11_1698022100317.794351; log_Id_pv=149; log_Id_view=1105; c_pref=https%3A//i.csdn.net/; c_ref=https%3A//blog.csdn.net/imwucx; c_page_id=default; dc_session_id=11_1698022100317.787671; c_dsid=11_1698022100317.794351; log_Id_view=1106; dc_tos=s2yi9b; log_Id_click=178; c_pref=https%3A//blog.csdn.net/imwucx; log_Id_pv=150; creativeSetApiNew=%7B%22toolbarImg%22%3Anull%2C%22publishSuccessImg%22%3Anull%2C%22articleNum%22%3A895%2C%22type%22%3A0%2C%22oldUser%22%3Afalse%2C%22useSeven%22%3Afalse%2C%22userName%22%3A%22qyj19920704%22%7D; c_ref=https%3A//cxian.blog.csdn.net/article/details/131299195; c_page_id=default; Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1698022433; dc_tos=s2yinc"; + @Value("${csdn.cookie}") + private String csdnCookie; + @Value("${csdn.num_of_articles_per_person}") + private Integer numOfArticlesPerPerson; + @Value("${csdn.url.user_article_url}") + private String url; @Autowired private CsdnUserInfoService csdnUserInfoService; + @Autowired + private CsdnCollectService csdnCollectService; + @Autowired + private CsdnCommentService csdnCommentService; @Override - public CsdnStatusResp singleArticle(String username) { - String url = "https://blog.csdn.net/community/home-api/v1/get-business-list"; - // 使用Hutool发送GET请求 + public void singleArticle(String username) { HttpResponse response = HttpUtil.createGet(url) - .header(CUSTOM_HEADER_NAME, CUSTOM_HEADER_VALUE) + .header("Cookie", csdnCookie) .form("page", 1) .form("size", 5) .form("businessType", "lately") .form("noMore", false) .form("username", username) .execute(); - // 打印响应结果 final String body = response.body(); ObjectMapper objectMapper = new ObjectMapper(); - BusinessInfo businessInfo = null; + BusinessInfoResponse businessInfoResponse; try { - businessInfo = objectMapper.readValue(body, BusinessInfo.class); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - final BusinessInfo.ArticleData data = businessInfo.getData(); - final List list = data.getList(); - //处理评论过 - int commentNum = 0; - int successNum = 0; - int notBlogNum = 0; - int count = 3;//评论3篇 - for (int i = 0; i < count; i++) { - final BusinessInfo.ArticleData.Article article = list.get(i); - final String type = article.getType(); - if (!StringUtils.equals("blog", type)) { - notBlogNum++; - continue; - } - final String urlInfo = article.getUrl(); - String articleId = urlInfo.substring(urlInfo.lastIndexOf("/") + 1); - final Boolean articleInfo = this.getArticleInfo(articleId); - if (!articleInfo) { - //进行点赞和评论 - final int comment = this.comment(articleId); - // 打印响应结果 - if (comment == 200) { - successNum++; - if (!COLLECT_IS_FULL) { - this.collect(username, article, articleId); + businessInfoResponse = objectMapper.readValue(body, BusinessInfoResponse.class); + final BusinessInfoResponse.ArticleData data = businessInfoResponse.getData(); + final List list = data.getList(); + if (CollectionUtil.isNotEmpty(list)) { + final int size = list.size(); + if (size < numOfArticlesPerPerson) { + numOfArticlesPerPerson = size; + } + for (int i = 0; i < numOfArticlesPerPerson; i++) { + final BusinessInfoResponse.ArticleData.Article article = list.get(i); + final String type = article.getType(); + if (!StringUtils.equals("blog", type)) { + continue; + } + final String urlInfo = article.getUrl(); + String articleId = urlInfo.substring(urlInfo.lastIndexOf("/") + 1); + //评论 + final Boolean comment = csdnCommentService.isComment(article); + if (!comment) { + csdnCommentService.comment(articleId); } - if (!LIKE_IS_FULL) { - this.like(articleId); + //收藏 + final Boolean collect = csdnCollectService.isCollect(articleId); + if (!collect) { + csdnCollectService.collect(article, username); } - } else if (comment == 400) { - return new CsdnStatusResp(400, "您评论太快了,请休息一下!"); } - } else { - commentNum++; } - } - if (count != successNum) { - return new CsdnStatusResp(300, "评论过的数量=" + commentNum + "非博客的数量:" + notBlogNum); - } - return new CsdnStatusResp(200, "三连完成"); - } - - - /** - * 收藏 - * - * @param username - * @param article - * @param articleId - */ - private void collect(String username, BusinessInfo.ArticleData.Article article, String articleId) { - CollectData collectData = null; - try { - CollectInfo collectInfo = new CollectInfo(); - collectInfo.setSourceId(Integer.valueOf(articleId)); - collectInfo.setFromType("PC"); - collectInfo.setAuthor(username); - collectInfo.setDescription(article.getDescription()); - collectInfo.setSource("blog"); - collectInfo.setFolderIdList(Lists.newArrayList(7589042)); - collectInfo.setTitle(article.getTitle()); - collectInfo.setUrl(article.getUrl()); - collectInfo.setUsername("qyj19920704"); - ObjectMapper objectMapper = new ObjectMapper(); - String jsonCollectInfo = objectMapper.writeValueAsString(collectInfo); - System.out.println("jsonCollectInfo=" + jsonCollectInfo); - String collectUrl = "https://mp-action.csdn.net/interact/wrapper/pc/favorite/v1/api/addFavoriteInFolds"; - // 使用Hutool发送GET请求 - HttpResponse response = HttpUtil.createPost(collectUrl) - .header(CUSTOM_HEADER_NAME, CUSTOM_HEADER_VALUE) - .header("Content-Type", "application/json") - .body(jsonCollectInfo) - .execute(); - // 打印响应结果 - final String body = response.body(); - log.info(body); - collectData = objectMapper.readValue(body, CollectData.class); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - final Long code = collectData.code; - if (code.equals(200)) { - log.info("收藏成功"); - } else if (code.equals(400000101)) { - log.info("参数缺失"); - } else if (code.equals(400)) { - COLLECT_IS_FULL = true; - log.info("今日收藏次数已达上限!"); - } - } - @Override - public Boolean getArticleInfo(String articleId) { - String url = "https://blog.csdn.net/phoenix/web/v1/comment/list/" + articleId; - // 使用Hutool发送GET请求 - HttpResponse response = HttpUtil.createPost(url) - .header(CUSTOM_HEADER_NAME, CUSTOM_HEADER_VALUE) - .form("page", 1) - .form("size", 100) - .form("fold", "unfold") - .execute(); - // 打印响应结果 - final String body = response.body(); - ObjectMapper objectMapper = new ObjectMapper(); - CommentData articleInfo = null; - try { - articleInfo = objectMapper.readValue(body, CommentData.class); } catch (JsonProcessingException e) { e.printStackTrace(); } - final CommentData.DataInfo data = articleInfo.getData(); - final List list = data.getList(); - if (CollectionUtil.isNotEmpty(list)) { - for (CommentData.Comment comment : list) { - final CommentData.Info info = comment.getInfo(); - final String userName = info.getUserName(); - if (StringUtils.equals(userName, "qyj19920704")) { - //评论过 - return true; - } - } - } - return false; - } - - @Override - public void like(String articleId) { - - } - - @Override - public int comment(String articleId) { - String url = "https://blog.csdn.net/phoenix/web/v1/comment/submit"; - // 使用Hutool发送GET请求 - HttpResponse response = HttpUtil.createPost(url) - .header(CUSTOM_HEADER_NAME, CUSTOM_HEADER_VALUE) // 添加自定义header参数 - .form("articleId", articleId) - .form("content", "支持博主优质文章,讲解得非常详细,干货满满,通俗易懂,期待博主下次更新") - .execute(); - return response.getStatus(); } @Override @@ -213,16 +90,7 @@ public class CsdnServiceImpl implements CsdnService { final List list = csdnUserInfoService.list(); if (CollectionUtil.isNotEmpty(list)) { for (CsdnUserInfo csdnUserInfo : list) { - // 构建参数 - String username = csdnUserInfo.getUserName(); - final CsdnStatusResp csdnStatusResp = singleArticle(username); - final Integer code = csdnStatusResp.getCode(); - final String value = csdnStatusResp.getValue(); - if (code.equals(400)) { - log.info("用户{}:code={},{}", username, code, value); - break; - } - log.info("用户{}:{}", username, value); + singleArticle(csdnUserInfo.getUserName()); } } } diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index eb3f74efc83007474a303c07be5a5508ae040c95..fcd97bbc23a65e3a994a5fce5e7103535bb91c6d 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -45,4 +45,20 @@ spring: # jasypt加密的密匙 jasypt: encryptor: - password: Y6M9fAJQdU7jNp5MW \ No newline at end of file + password: Y6M9fAJQdU7jNp5MW + + +csdn: + num_of_articles_per_person: 1 #每人文章个数 + self_user_name: "qyj19920704" #自己的用户id + #cookie,身份验证 + cookie: "uuid_tt_dd=10_20285116700-1697522872601-604163; c_adb=1; loginbox_strategy=%7B%22taskId%22%3A308%2C%22abCheckTime%22%3A1697522874474%2C%22version%22%3A%22control%22%7D; UserName=qyj19920704; UserInfo=a7d3b88c53a841ebb5792202cb43c84f; UserToken=a7d3b88c53a841ebb5792202cb43c84f; UserNick=%E6%AA%80%E8%B6%8A%E5%89%91%E6%8C%87%E5%A4%A7%E5%8E%82; AU=769; UN=qyj19920704; BT=1697522886100; p_uid=U010000; Hm_up_6bcd52f51e9b3dce32bec4a3997715ac=%7B%22islogin%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isonline%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isvip%22%3A%7B%22value%22%3A%220%22%2C%22scope%22%3A1%7D%2C%22uid_%22%3A%7B%22value%22%3A%22qyj19920704%22%2C%22scope%22%3A1%7D%7D; management_ques=1697592152734; blog_details_recommend_nps=1697616147423; c_segment=3; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=1697522874,1697551027,1697636661,1697683407; csrfToken=jTRD3_1IBVA703lu2FkVkazx; dc_sid=9f7a02ed8375e91d86271ddaf1cf2ce4; c_first_ref=default; c_first_page=https%3A//liucy.blog.csdn.net/article/details/133852303%3Fspm%3D1001.2014.3001.5502; c_segment=3; Hm_lvt_e5ef47b9f471504959267fd614d579cd=1697764951; Hm_lpvt_e5ef47b9f471504959267fd614d579cd=1697764951; 404_page_nps=1697764955523; ssxmod_itna=YqUxBD97kOGHD8D2BmYite44zxcYo1=WOiox0vmvqGzDAxn40iDtgeqODDwu0/DNMQiDpiDuWOntaV73S5fd3iPeaN3D84i7DKqibDCqD1D3qDktzDYA8Dt4DTD34DYDiO=DBRsUQDFATN/3wUjmGtDG4DgDB=DxBEl3djBAq4DCr4DbxPy7mrDtLNSeLLdXT0/nn5Yf445SOG5lipwm0GdG7vwBA4PlDxNt8v1wADoGGGQYf+IE75ep753zpDxD; ssxmod_itna2=YqUxBD97kOGHD8D2BmYite44zxcYo1=WOYxn9EenDDsYebDLGQCoqQuGvHdDQRKYubdD6QqomsRD3xyRI/W9Q5nhe8oeYUvimaWYrNsqwcDgL6mDjYUhZK09LYcY/t5hSuP2va/kclf6hRkNh+LPyDwic73=9i4d94Lvw/R=oQ7E+jT4jjjA2Y+=QplLm8nbePRb+7=Re1CpjmZ4wIrnNPSKofWnIj=WOtkFtphylt+GhUxr0KkGtTzDXKDEEkbn3qhIn3Sj/ezt1u2MO3M9h7zEL6RunrXaKE+YdkRnIKiTG93cqpGFq8Fwr7ehksk1ZSWhoN2hQydddqQ1bTOSW8ddX+7g24v4TZ0+52=Y8PsOwfhavW4ECY8+GZOK=ro97bK0=Yi3YD5ZGsq25FhPodIRGCD2O8xidfo8+NR88v+rq4+b=fUOEK2frPEPdLFuYkao9uCfM1+cFZQ7q6HEMfRLjf6bhof0=1YhEYO1U=NZCPvDDw2Psluciq4De13mDNBODwqLwwg44qwOiDf=j1fKK5q+8gd7DDjKDeMv/04YDmLGvrwqOz4cov79500D4D==; c_first_ref=default; c_first_page=https%3A//mp.csdn.net/; creative_btn_mp=3; c_hasSub=true; write_guide_show=3; log_Id_click=177; dc_session_id=11_1698022100317.787671; c_dsid=11_1698022100317.794351; log_Id_pv=149; log_Id_view=1105; c_pref=https%3A//i.csdn.net/; c_ref=https%3A//blog.csdn.net/imwucx; c_page_id=default; dc_session_id=11_1698022100317.787671; c_dsid=11_1698022100317.794351; log_Id_view=1106; dc_tos=s2yi9b; log_Id_click=178; c_pref=https%3A//blog.csdn.net/imwucx; log_Id_pv=150; creativeSetApiNew=%7B%22toolbarImg%22%3Anull%2C%22publishSuccessImg%22%3Anull%2C%22articleNum%22%3A895%2C%22type%22%3A0%2C%22oldUser%22%3Afalse%2C%22useSeven%22%3Afalse%2C%22userName%22%3A%22qyj19920704%22%7D; c_ref=https%3A//cxian.blog.csdn.net/article/details/131299195; c_page_id=default; Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1698022433; dc_tos=s2yinc" + url: + user_article_url: "https://blog.csdn.net/community/home-api/v1/get-business-list" #获取用户文章接口 + is_collect_url: "https://blog.csdn.net/phoenix/web/v1/isCollect" #是否收藏接口 + add_collect_url: "https://mp-action.csdn.net/interact/wrapper/pc/favorite/v1/api/addFavoriteInFolds" #添加收藏接口 + is_comment_list_url: "https://blog.csdn.net/phoenix/web/v1/comment/list/" #查询评论接口 + comment_url: "https://blog.csdn.net/phoenix/web/v1/comment/submit" #评论接口 + like_url: "https://blog.csdn.net//phoenix/web/v1/article/like" #点赞接口 + +