Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
SpringBoot-kwan
提交
f1d7791c
S
SpringBoot-kwan
项目概览
Kwan的解忧杂货铺@新空间代码工作室
/
SpringBoot-kwan
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SpringBoot-kwan
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f1d7791c
编写于
10月 25, 2023
作者:
Kwan的解忧杂货铺@新空间代码工作室
🐭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:自动评论功能
上级
0b6c294c
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
192 addition
and
51 deletion
+192
-51
src/main/java/com/kwan/springbootkwan/controller/CsdnController.java
...va/com/kwan/springbootkwan/controller/CsdnController.java
+9
-0
src/main/java/com/kwan/springbootkwan/schedule/CsdnSchedule.java
...n/java/com/kwan/springbootkwan/schedule/CsdnSchedule.java
+10
-0
src/main/java/com/kwan/springbootkwan/service/CsdnArticleService.java
...a/com/kwan/springbootkwan/service/CsdnArticleService.java
+24
-0
src/main/java/com/kwan/springbootkwan/service/CsdnCommentService.java
...a/com/kwan/springbootkwan/service/CsdnCommentService.java
+1
-1
src/main/java/com/kwan/springbootkwan/service/impl/CsdnArticleServiceImpl.java
...n/springbootkwan/service/impl/CsdnArticleServiceImpl.java
+52
-0
src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java
...n/springbootkwan/service/impl/CsdnCommentServiceImpl.java
+87
-12
src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java
...com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java
+7
-38
src/main/resources/application-local.yml
src/main/resources/application-local.yml
+2
-0
未找到文件。
src/main/java/com/kwan/springbootkwan/controller/CsdnController.java
浏览文件 @
f1d7791c
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.kwan.springbootkwan.entity.CsdnUserInfo
;
import
com.kwan.springbootkwan.entity.CsdnUserInfo
;
import
com.kwan.springbootkwan.entity.Result
;
import
com.kwan.springbootkwan.entity.Result
;
import
com.kwan.springbootkwan.service.CsdnCommentService
;
import
com.kwan.springbootkwan.service.CsdnService
;
import
com.kwan.springbootkwan.service.CsdnService
;
import
com.kwan.springbootkwan.service.CsdnUserInfoService
;
import
com.kwan.springbootkwan.service.CsdnUserInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -23,6 +24,8 @@ public class CsdnController {
...
@@ -23,6 +24,8 @@ public class CsdnController {
@Autowired
@Autowired
private
CsdnService
csdnService
;
private
CsdnService
csdnService
;
@Autowired
@Autowired
private
CsdnCommentService
csdnCommentService
;
@Autowired
private
CsdnUserInfoService
csdnUserInfoService
;
private
CsdnUserInfoService
csdnUserInfoService
;
@GetMapping
(
"/singleTriplet"
)
@GetMapping
(
"/singleTriplet"
)
...
@@ -43,4 +46,10 @@ public class CsdnController {
...
@@ -43,4 +46,10 @@ public class CsdnController {
csdnService
.
multiTriplet
();
csdnService
.
multiTriplet
();
return
Result
.
ok
(
"多人三连完成"
);
return
Result
.
ok
(
"多人三连完成"
);
}
}
@GetMapping
(
"/autoReply"
)
public
Result
autoReply
()
{
csdnCommentService
.
commentSelf
();
return
Result
.
ok
(
"自动回复完成"
);
}
}
}
src/main/java/com/kwan/springbootkwan/schedule/CsdnSchedule.java
浏览文件 @
f1d7791c
...
@@ -7,6 +7,7 @@ import com.kwan.springbootkwan.entity.CsdnUserInfo;
...
@@ -7,6 +7,7 @@ import com.kwan.springbootkwan.entity.CsdnUserInfo;
import
com.kwan.springbootkwan.enums.CollectStatus
;
import
com.kwan.springbootkwan.enums.CollectStatus
;
import
com.kwan.springbootkwan.enums.CommentStatus
;
import
com.kwan.springbootkwan.enums.CommentStatus
;
import
com.kwan.springbootkwan.enums.LikeStatus
;
import
com.kwan.springbootkwan.enums.LikeStatus
;
import
com.kwan.springbootkwan.service.CsdnCommentService
;
import
com.kwan.springbootkwan.service.CsdnService
;
import
com.kwan.springbootkwan.service.CsdnService
;
import
com.kwan.springbootkwan.service.CsdnUserInfoService
;
import
com.kwan.springbootkwan.service.CsdnUserInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -24,6 +25,8 @@ public class CsdnSchedule {
...
@@ -24,6 +25,8 @@ public class CsdnSchedule {
@Autowired
@Autowired
private
CsdnService
csdnService
;
private
CsdnService
csdnService
;
@Autowired
@Autowired
private
CsdnCommentService
csdnCommentService
;
@Autowired
private
CsdnUserInfoService
csdnUserInfoService
;
private
CsdnUserInfoService
csdnUserInfoService
;
@Scheduled
(
cron
=
"0 0 8,10,12,14,16,18,20 * * ?"
)
@Scheduled
(
cron
=
"0 0 8,10,12,14,16,18,20 * * ?"
)
...
@@ -50,5 +53,12 @@ public class CsdnSchedule {
...
@@ -50,5 +53,12 @@ public class CsdnSchedule {
}
}
log
.
info
(
"executeInit task is finish ... ..."
);
log
.
info
(
"executeInit task is finish ... ..."
);
}
}
@Scheduled
(
cron
=
"0 0 8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ?"
)
public
void
executeReply
()
{
log
.
info
(
"executeReply task is running ... ..."
);
csdnCommentService
.
commentSelf
();
log
.
info
(
"executeReply task is finish ... ..."
);
}
}
}
src/main/java/com/kwan/springbootkwan/service/CsdnArticleService.java
0 → 100644
浏览文件 @
f1d7791c
package
com.kwan.springbootkwan.service
;
import
com.kwan.springbootkwan.entity.resp.BusinessInfoResponse
;
import
java.util.List
;
/**
* 获取最新的文章
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2023/10/25 18:44
*/
public
interface
CsdnArticleService
{
/**
* 获取最新的文章
*
* @param username
* @return
*/
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
getArticles
(
String
username
);
}
\ No newline at end of file
src/main/java/com/kwan/springbootkwan/service/CsdnCommentService.java
浏览文件 @
f1d7791c
...
@@ -32,5 +32,5 @@ public interface CsdnCommentService {
...
@@ -32,5 +32,5 @@ public interface CsdnCommentService {
*
*
* @return
* @return
*/
*/
Boolean
commentSelf
();
void
commentSelf
();
}
}
\ No newline at end of file
src/main/java/com/kwan/springbootkwan/service/impl/CsdnArticleServiceImpl.java
0 → 100644
浏览文件 @
f1d7791c
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.service.CsdnArticleService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Slf4j
@Service
public
class
CsdnArticleServiceImpl
implements
CsdnArticleService
{
@Value
(
"${csdn.cookie}"
)
private
String
csdnCookie
;
@Value
(
"${csdn.url.user_article_url}"
)
private
String
url
;
@Override
public
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
getArticles
(
String
username
)
{
HttpResponse
response
=
HttpUtil
.
createGet
(
url
)
.
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
();
BusinessInfoResponse
businessInfoResponse
;
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
list
=
null
;
try
{
businessInfoResponse
=
objectMapper
.
readValue
(
body
,
BusinessInfoResponse
.
class
);
final
BusinessInfoResponse
.
ArticleData
data
=
businessInfoResponse
.
getData
();
list
=
data
.
getList
();
}
catch
(
JsonProcessingException
e
)
{
e
.
printStackTrace
();
}
if
(
CollectionUtil
.
isEmpty
(
list
))
{
return
null
;
}
return
list
;
}
}
src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java
浏览文件 @
f1d7791c
...
@@ -10,13 +10,16 @@ import com.kwan.springbootkwan.entity.resp.BusinessInfoResponse;
...
@@ -10,13 +10,16 @@ import com.kwan.springbootkwan.entity.resp.BusinessInfoResponse;
import
com.kwan.springbootkwan.entity.resp.CommentListResponse
;
import
com.kwan.springbootkwan.entity.resp.CommentListResponse
;
import
com.kwan.springbootkwan.entity.resp.CommentResponse
;
import
com.kwan.springbootkwan.entity.resp.CommentResponse
;
import
com.kwan.springbootkwan.enums.CommentStatus
;
import
com.kwan.springbootkwan.enums.CommentStatus
;
import
com.kwan.springbootkwan.service.CsdnArticleService
;
import
com.kwan.springbootkwan.service.CsdnCommentService
;
import
com.kwan.springbootkwan.service.CsdnCommentService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
@Slf4j
@Slf4j
@Service
@Service
...
@@ -26,6 +29,8 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -26,6 +29,8 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
private
String
csdnCookie
;
private
String
csdnCookie
;
@Value
(
"#{'${csdn.self_comment}'.split(';')}"
)
@Value
(
"#{'${csdn.self_comment}'.split(';')}"
)
private
String
[]
selfComment
;
private
String
[]
selfComment
;
@Value
(
"#{'${csdn.self_reply}'.split(';')}"
)
private
String
[]
selfReply
;
@Value
(
"${csdn.self_user_name}"
)
@Value
(
"${csdn.self_user_name}"
)
private
String
selfUserName
;
private
String
selfUserName
;
@Value
(
"${csdn.url.is_comment_list_url}"
)
@Value
(
"${csdn.url.is_comment_list_url}"
)
...
@@ -33,6 +38,9 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -33,6 +38,9 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
@Value
(
"${csdn.url.comment_url}"
)
@Value
(
"${csdn.url.comment_url}"
)
private
String
commentUrl
;
private
String
commentUrl
;
@Autowired
private
CsdnArticleService
csdnArticleService
;
@Override
@Override
public
Boolean
isComment
(
BusinessInfoResponse
.
ArticleData
.
Article
article
,
CsdnUserInfo
csdnUserInfo
)
{
public
Boolean
isComment
(
BusinessInfoResponse
.
ArticleData
.
Article
article
,
CsdnUserInfo
csdnUserInfo
)
{
final
Integer
commentStatus
=
csdnUserInfo
.
getCommentStatus
();
final
Integer
commentStatus
=
csdnUserInfo
.
getCommentStatus
();
...
@@ -83,7 +91,10 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -83,7 +91,10 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
return
true
;
return
true
;
}
}
//评论
//评论
CommentResponse
comment
=
this
.
dealComment
(
articleId
);
int
start
=
-
1
;
int
end
=
selfComment
.
length
;
int
temp_count
=
(
int
)
(
Math
.
floor
(
Math
.
random
()
*
(
start
-
end
+
1
))
+
end
);
CommentResponse
comment
=
this
.
dealComment
(
articleId
,
selfComment
[
temp_count
],
null
);
final
int
code
=
comment
.
code
;
final
int
code
=
comment
.
code
;
final
String
message
=
comment
.
getMessage
();
final
String
message
=
comment
.
getMessage
();
if
(
code
==
200
)
{
if
(
code
==
200
)
{
...
@@ -111,8 +122,64 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -111,8 +122,64 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
}
}
@Override
@Override
public
Boolean
commentSelf
()
{
public
void
commentSelf
()
{
return
null
;
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
list
=
csdnArticleService
.
getArticles
(
selfUserName
);
if
(
list
==
null
)
{
return
;
}
for
(
BusinessInfoResponse
.
ArticleData
.
Article
article
:
list
)
{
final
String
type
=
article
.
getType
();
if
(!
StringUtils
.
equals
(
"blog"
,
type
))
{
continue
;
}
final
String
urlInfo
=
article
.
getUrl
();
String
articleId
=
urlInfo
.
substring
(
urlInfo
.
lastIndexOf
(
"/"
)
+
1
);
String
url
=
commentListUrl
+
articleId
;
HttpResponse
response
=
HttpUtil
.
createPost
(
url
)
.
header
(
"Cookie"
,
csdnCookie
)
.
form
(
"page"
,
1
)
.
form
(
"size"
,
100
)
.
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
<
CommentListResponse
.
Comment
>
otherCommentList
=
data
.
getList
();
if
(
CollectionUtil
.
isNotEmpty
(
otherCommentList
))
{
for
(
CommentListResponse
.
Comment
oneComment
:
otherCommentList
)
{
final
CommentListResponse
.
Info
info
=
oneComment
.
getInfo
();
final
String
userName
=
info
.
getUserName
();
final
Integer
commentId
=
info
.
getCommentId
();
if
(!
StringUtils
.
equals
(
userName
,
selfUserName
))
{
final
List
<
CommentListResponse
.
SubComment
>
sub
=
oneComment
.
getSub
();
boolean
flag
=
false
;
if
(
CollectionUtil
.
isNotEmpty
(
sub
))
{
for
(
CommentListResponse
.
SubComment
subComment
:
sub
)
{
//如果没有自己的评论,需要评论
final
String
subUserName
=
subComment
.
getUserName
();
if
(
StringUtils
.
equals
(
subUserName
,
selfUserName
))
{
flag
=
true
;
}
}
}
if
(
CollectionUtil
.
isEmpty
(
sub
)
||
!
flag
)
{
//需要评论
int
start
=
-
1
;
int
end
=
selfReply
.
length
;
int
temp_count
=
(
int
)
(
Math
.
floor
(
Math
.
random
()
*
(
start
-
end
+
1
))
+
end
);
CommentResponse
reply
=
this
.
dealComment
(
articleId
,
selfReply
[
temp_count
],
commentId
);
log
.
info
(
reply
.
toString
());
}
}
}
}
}
catch
(
JsonProcessingException
e
)
{
e
.
printStackTrace
();
}
}
}
}
/**
/**
...
@@ -121,15 +188,23 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -121,15 +188,23 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
* @param articleId
* @param articleId
* @return
* @return
*/
*/
private
CommentResponse
dealComment
(
String
articleId
)
{
private
CommentResponse
dealComment
(
String
articleId
,
String
commentInfo
,
Integer
commentId
)
{
int
start
=
-
1
;
HttpResponse
response
;
int
end
=
selfComment
.
length
;
if
(
Objects
.
nonNull
(
commentId
))
{
int
temp_count
=
(
int
)
(
Math
.
floor
(
Math
.
random
()
*
(
start
-
end
+
1
))
+
end
);
response
=
HttpUtil
.
createPost
(
commentUrl
)
HttpResponse
response
=
HttpUtil
.
createPost
(
commentUrl
)
.
header
(
"Cookie"
,
csdnCookie
)
.
form
(
"articleId"
,
articleId
)
.
form
(
"content"
,
commentInfo
)
.
form
(
"commentId"
,
commentId
)
.
execute
();
}
else
{
response
=
HttpUtil
.
createPost
(
commentUrl
)
.
header
(
"Cookie"
,
csdnCookie
)
.
header
(
"Cookie"
,
csdnCookie
)
.
form
(
"articleId"
,
articleId
)
.
form
(
"articleId"
,
articleId
)
.
form
(
"content"
,
selfComment
[
temp_count
]
)
.
form
(
"content"
,
commentInfo
)
.
execute
();
.
execute
();
}
final
String
body
=
response
.
body
();
final
String
body
=
response
.
body
();
log
.
info
(
body
);
log
.
info
(
body
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
...
...
src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java
浏览文件 @
f1d7791c
package
com.kwan.springbootkwan.service.impl
;
package
com.kwan.springbootkwan.service.impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.http.HttpResponse
;
import
cn.hutool.http.HttpUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.kwan.springbootkwan.entity.CsdnUserInfo
;
import
com.kwan.springbootkwan.entity.CsdnUserInfo
;
import
com.kwan.springbootkwan.entity.resp.BusinessInfoResponse
;
import
com.kwan.springbootkwan.entity.resp.BusinessInfoResponse
;
import
com.kwan.springbootkwan.enums.CommentStatus
;
import
com.kwan.springbootkwan.enums.CommentStatus
;
import
com.kwan.springbootkwan.service.CsdnArticleService
;
import
com.kwan.springbootkwan.service.CsdnCollectService
;
import
com.kwan.springbootkwan.service.CsdnCollectService
;
import
com.kwan.springbootkwan.service.CsdnCommentService
;
import
com.kwan.springbootkwan.service.CsdnCommentService
;
import
com.kwan.springbootkwan.service.CsdnLikeService
;
import
com.kwan.springbootkwan.service.CsdnLikeService
;
...
@@ -27,15 +24,14 @@ import java.util.List;
...
@@ -27,15 +24,14 @@ import java.util.List;
@Service
@Service
public
class
CsdnServiceImpl
implements
CsdnService
{
public
class
CsdnServiceImpl
implements
CsdnService
{
@Value
(
"${csdn.cookie}"
)
private
String
csdnCookie
;
@Value
(
"${csdn.num_of_articles_per_person}"
)
@Value
(
"${csdn.num_of_articles_per_person}"
)
private
Integer
numOfArticlesPerPerson
;
private
Integer
numOfArticlesPerPerson
;
@Value
(
"${csdn.url.user_article_url}"
)
private
String
url
;
@Autowired
@Autowired
private
CsdnUserInfoService
csdnUserInfoService
;
private
CsdnUserInfoService
csdnUserInfoService
;
@Autowired
@Autowired
private
CsdnArticleService
csdnArticleService
;
@Autowired
private
CsdnCollectService
csdnCollectService
;
private
CsdnCollectService
csdnCollectService
;
@Autowired
@Autowired
private
CsdnCommentService
csdnCommentService
;
private
CsdnCommentService
csdnCommentService
;
...
@@ -45,10 +41,12 @@ public class CsdnServiceImpl implements CsdnService {
...
@@ -45,10 +41,12 @@ public class CsdnServiceImpl implements CsdnService {
@Override
@Override
public
void
singleArticle
(
CsdnUserInfo
csdnUserInfo
)
{
public
void
singleArticle
(
CsdnUserInfo
csdnUserInfo
)
{
final
String
username
=
csdnUserInfo
.
getUserName
();
final
String
username
=
csdnUserInfo
.
getUserName
();
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
list
=
this
.
getArticles
(
username
);
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
list
=
csdnArticleService
.
getArticles
(
username
);
if
(
list
==
null
)
{
if
(
list
==
null
)
{
return
;
return
;
}
}
final
int
size
=
list
.
size
();
numOfArticlesPerPerson
=
size
<
numOfArticlesPerPerson
?
size
:
numOfArticlesPerPerson
;
for
(
int
i
=
0
;
i
<
numOfArticlesPerPerson
;
i
++)
{
for
(
int
i
=
0
;
i
<
numOfArticlesPerPerson
;
i
++)
{
final
BusinessInfoResponse
.
ArticleData
.
Article
article
=
list
.
get
(
i
);
final
BusinessInfoResponse
.
ArticleData
.
Article
article
=
list
.
get
(
i
);
final
String
type
=
article
.
getType
();
final
String
type
=
article
.
getType
();
...
@@ -87,35 +85,6 @@ public class CsdnServiceImpl implements CsdnService {
...
@@ -87,35 +85,6 @@ public class CsdnServiceImpl implements CsdnService {
csdnUserInfoService
.
updateById
(
csdnUserInfo
);
csdnUserInfoService
.
updateById
(
csdnUserInfo
);
}
}
private
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
getArticles
(
String
username
)
{
HttpResponse
response
=
HttpUtil
.
createGet
(
url
)
.
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
();
BusinessInfoResponse
businessInfoResponse
;
List
<
BusinessInfoResponse
.
ArticleData
.
Article
>
list
=
null
;
try
{
businessInfoResponse
=
objectMapper
.
readValue
(
body
,
BusinessInfoResponse
.
class
);
final
BusinessInfoResponse
.
ArticleData
data
=
businessInfoResponse
.
getData
();
list
=
data
.
getList
();
}
catch
(
JsonProcessingException
e
)
{
e
.
printStackTrace
();
}
if
(
CollectionUtil
.
isEmpty
(
list
))
{
return
null
;
}
final
int
size
=
list
.
size
();
if
(
size
<
numOfArticlesPerPerson
)
{
numOfArticlesPerPerson
=
size
;
}
return
list
;
}
@Override
@Override
public
void
multiTriplet
()
{
public
void
multiTriplet
()
{
...
...
src/main/resources/application-local.yml
浏览文件 @
f1d7791c
...
@@ -53,6 +53,8 @@ csdn:
...
@@ -53,6 +53,8 @@ csdn:
self_folder_id
:
7589042
#自己的收藏夹id
self_folder_id
:
7589042
#自己的收藏夹id
#自己的评论
#自己的评论
self_comment
:
博主的文章真的太赞了!每次都能学到很多新知识,感谢博主的用心分享。期待更多精彩的内容!;文章内容通俗易懂,大大提高了我对这个话题的理解。博主的干货文章一直都是我学习的首选,加油!;博主的文章写得非常详细,让我不仅学到了知识,还培养了对这个领域的浓厚兴趣。希望博主能继续分享这样有深度的文章!;感谢博主的分享,每一篇文章都是一份珍贵的学习资料。期待未来更多的独到见解和教程!;博主的文章质量一直很高,内容丰富,讲解得清晰易懂。每次阅读都能获益良多。期待博主的持续更新!;博主的文章真的是知识的宝库,每次都有新的收获。希望博主能继续分享这样精彩的内容,帮助更多人成长!;博主的文章总是带着深入的研究和独到的见解,对我的学习起到了巨大的帮助。期待更多的干货和学习资源!;博主的文章总是深入浅出,让我不再觉得学习新知识困难。博主的付出和分享令人钦佩。谢谢你,继续前行!;博主的文章是我每次学习的指南,总是解答了我遇到的问题。感谢博主的付出,期待更多的精彩内容!;博主的文章一直都是我的学习圣经,内容详实,通俗易懂。希望博主能一如既往地分享知识,帮助更多人成长。;支持博主优质文章,讲解得非常详细,干货满满,通俗易懂,期待博主下次更新
self_comment
:
博主的文章真的太赞了!每次都能学到很多新知识,感谢博主的用心分享。期待更多精彩的内容!;文章内容通俗易懂,大大提高了我对这个话题的理解。博主的干货文章一直都是我学习的首选,加油!;博主的文章写得非常详细,让我不仅学到了知识,还培养了对这个领域的浓厚兴趣。希望博主能继续分享这样有深度的文章!;感谢博主的分享,每一篇文章都是一份珍贵的学习资料。期待未来更多的独到见解和教程!;博主的文章质量一直很高,内容丰富,讲解得清晰易懂。每次阅读都能获益良多。期待博主的持续更新!;博主的文章真的是知识的宝库,每次都有新的收获。希望博主能继续分享这样精彩的内容,帮助更多人成长!;博主的文章总是带着深入的研究和独到的见解,对我的学习起到了巨大的帮助。期待更多的干货和学习资源!;博主的文章总是深入浅出,让我不再觉得学习新知识困难。博主的付出和分享令人钦佩。谢谢你,继续前行!;博主的文章是我每次学习的指南,总是解答了我遇到的问题。感谢博主的付出,期待更多的精彩内容!;博主的文章一直都是我的学习圣经,内容详实,通俗易懂。希望博主能一如既往地分享知识,帮助更多人成长。;支持博主优质文章,讲解得非常详细,干货满满,通俗易懂,期待博主下次更新
#自动评论
self_reply
:
感谢你的支持,大佬!;你的支持真的太棒了,大佬!;无法不感谢你的支持,大佬!;你的帮助对我来说意义重大,大佬!;大佬的支持让我感到非常荣幸。;我深深感激你的支持,大佬!;有你这样的大佬支持真是太好了。;大佬的支持是我前进的动力。;感激不尽,因为有了大佬的支持。;有你的支持,我感到非常幸运。;大佬的支持让一切都变得更加容易。;你的支持让我感到无比感激,大佬!;有你在我身边真的太棒了,大佬。;感谢你一直支持着我,大佬!;大佬的支持是我最大的动力之一。;你的鼓励和支持对我来说非常重要。;大佬的支持让我感到无比荣幸。;感谢你的不离不弃,大佬!;你的支持一直如同明灯照亮我的前路。;有你的支持,我觉得自己非常幸运。
#cookie,身份验证
#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;
c_ref=https%3A//blog.csdn.net/imwucx/article/details/133915120%3Fspm%3D1001.2014.3001.5501;
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_page_id=default;
Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1698023119;
dc_tos=s2yj16"
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;
c_ref=https%3A//blog.csdn.net/imwucx/article/details/133915120%3Fspm%3D1001.2014.3001.5501;
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_page_id=default;
Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1698023119;
dc_tos=s2yj16"
url
:
url
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录