Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
SpringBoot-kwan
提交
e73fbbc1
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看板
提交
e73fbbc1
编写于
10月 24, 2023
作者:
Kwan的解忧杂货铺@新空间代码工作室
🐭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:添加参数
上级
f90bff62
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
14 addition
and
12 deletion
+14
-12
src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java
...n/springbootkwan/service/impl/CsdnCollectServiceImpl.java
+7
-6
src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java
...n/springbootkwan/service/impl/CsdnCommentServiceImpl.java
+4
-3
src/main/java/com/kwan/springbootkwan/service/impl/CsdnLikeServiceImpl.java
...kwan/springbootkwan/service/impl/CsdnLikeServiceImpl.java
+2
-2
src/main/java/com/kwan/springbootkwan/service/impl/CsdnUserInfoServiceImpl.java
.../springbootkwan/service/impl/CsdnUserInfoServiceImpl.java
+1
-1
未找到文件。
src/main/java/com/kwan/springbootkwan/service/impl/CsdnCollectServiceImpl.java
浏览文件 @
e73fbbc1
...
@@ -4,7 +4,6 @@ import cn.hutool.http.HttpResponse;
...
@@ -4,7 +4,6 @@ import cn.hutool.http.HttpResponse;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
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.BusinessInfoResponse
;
import
com.kwan.springbootkwan.entity.resp.CollectInfoQuery
;
import
com.kwan.springbootkwan.entity.resp.CollectInfoQuery
;
import
com.kwan.springbootkwan.entity.resp.CollectResponse
;
import
com.kwan.springbootkwan.entity.resp.CollectResponse
;
...
@@ -14,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -14,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
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.ArrayList
;
@Slf4j
@Slf4j
@Service
@Service
public
class
CsdnCollectServiceImpl
implements
CsdnCollectService
{
public
class
CsdnCollectServiceImpl
implements
CsdnCollectService
{
...
@@ -52,9 +53,9 @@ public class CsdnCollectServiceImpl implements CsdnCollectService {
...
@@ -52,9 +53,9 @@ public class CsdnCollectServiceImpl implements CsdnCollectService {
if
(
code
==
200
)
{
if
(
code
==
200
)
{
final
boolean
status
=
data
.
status
;
final
boolean
status
=
data
.
status
;
if
(
status
)
{
if
(
status
)
{
log
.
info
(
"
已收藏"
);
log
.
info
(
"
文章{}已经收藏过"
,
articleId
);
}
else
{
}
else
{
log
.
info
(
"
未收藏"
);
log
.
info
(
"
文章{}未收藏"
,
articleId
);
}
}
return
status
;
return
status
;
}
}
...
@@ -79,7 +80,7 @@ public class CsdnCollectServiceImpl implements CsdnCollectService {
...
@@ -79,7 +80,7 @@ public class CsdnCollectServiceImpl implements CsdnCollectService {
collectInfoQuery
.
setAuthor
(
username
);
collectInfoQuery
.
setAuthor
(
username
);
collectInfoQuery
.
setDescription
(
article
.
getDescription
());
collectInfoQuery
.
setDescription
(
article
.
getDescription
());
collectInfoQuery
.
setSource
(
"blog"
);
collectInfoQuery
.
setSource
(
"blog"
);
collectInfoQuery
.
setFolderIdList
(
Lists
.
newArrayList
(
selfFolderId
));
collectInfoQuery
.
setFolderIdList
(
new
ArrayList
<>
(
selfFolderId
));
collectInfoQuery
.
setTitle
(
article
.
getTitle
());
collectInfoQuery
.
setTitle
(
article
.
getTitle
());
collectInfoQuery
.
setUrl
(
article
.
getUrl
());
collectInfoQuery
.
setUrl
(
article
.
getUrl
());
collectInfoQuery
.
setUsername
(
selfUserName
);
collectInfoQuery
.
setUsername
(
selfUserName
);
...
@@ -97,9 +98,9 @@ public class CsdnCollectServiceImpl implements CsdnCollectService {
...
@@ -97,9 +98,9 @@ public class CsdnCollectServiceImpl implements CsdnCollectService {
}
}
final
Long
code
=
collectResponse
.
code
;
final
Long
code
=
collectResponse
.
code
;
if
(
code
.
equals
(
200
))
{
if
(
code
.
equals
(
200
))
{
log
.
info
(
"
收藏成功"
);
log
.
info
(
"
文章{}收藏成功"
,
articleId
);
}
else
if
(
code
.
equals
(
400000101
))
{
}
else
if
(
code
.
equals
(
400000101
))
{
log
.
info
(
"
参数缺失"
);
log
.
info
(
"
收藏文章{}参数缺失"
,
articleId
);
}
else
if
(
code
.
equals
(
400
))
{
}
else
if
(
code
.
equals
(
400
))
{
COLLECT_IS_FULL
=
true
;
COLLECT_IS_FULL
=
true
;
log
.
info
(
"今日收藏次数已达上限!"
);
log
.
info
(
"今日收藏次数已达上限!"
);
...
...
src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java
浏览文件 @
e73fbbc1
...
@@ -29,7 +29,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -29,7 +29,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
@Value
(
"${csdn.url.comment_url}"
)
@Value
(
"${csdn.url.comment_url}"
)
private
String
commentUrl
;
private
String
commentUrl
;
/**
/**
*
收藏
满了
*
评论
满了
*/
*/
private
static
boolean
COMMENT_IS_FULL
=
false
;
private
static
boolean
COMMENT_IS_FULL
=
false
;
...
@@ -62,7 +62,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -62,7 +62,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
final
String
userName
=
info
.
getUserName
();
final
String
userName
=
info
.
getUserName
();
if
(
StringUtils
.
equals
(
userName
,
selfUserName
))
{
if
(
StringUtils
.
equals
(
userName
,
selfUserName
))
{
//评论过
//评论过
log
.
info
(
"文章
已经评论过"
);
log
.
info
(
"文章
{}已经评论过"
,
articleId
);
return
true
;
return
true
;
}
}
}
}
...
@@ -83,7 +83,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -83,7 +83,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
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
)
{
log
.
info
(
"
评论成功"
);
log
.
info
(
"
文章{}评论成功"
,
articleId
);
}
else
if
(
code
==
400
&&
StringUtils
.
equals
(
message
,
"您已达到当日发送上限,请明天尝试!"
))
{
}
else
if
(
code
==
400
&&
StringUtils
.
equals
(
message
,
"您已达到当日发送上限,请明天尝试!"
))
{
log
.
info
(
message
);
log
.
info
(
message
);
COMMENT_IS_FULL
=
true
;
COMMENT_IS_FULL
=
true
;
...
@@ -106,6 +106,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
...
@@ -106,6 +106,7 @@ public class CsdnCommentServiceImpl implements CsdnCommentService {
.
form
(
"content"
,
"支持博主优质文章,讲解得非常详细,干货满满,通俗易懂,期待博主下次更新"
)
.
form
(
"content"
,
"支持博主优质文章,讲解得非常详细,干货满满,通俗易懂,期待博主下次更新"
)
.
execute
();
.
execute
();
final
String
body
=
response
.
body
();
final
String
body
=
response
.
body
();
log
.
info
(
body
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
CommentResponse
commentResponse
=
null
;
CommentResponse
commentResponse
=
null
;
try
{
try
{
...
...
src/main/java/com/kwan/springbootkwan/service/impl/CsdnLikeServiceImpl.java
浏览文件 @
e73fbbc1
...
@@ -45,9 +45,9 @@ public class CsdnLikeServiceImpl implements CsdnLikeService {
...
@@ -45,9 +45,9 @@ public class CsdnLikeServiceImpl implements CsdnLikeService {
if
(
code
==
200
)
{
if
(
code
==
200
)
{
final
boolean
status
=
data
.
status
;
final
boolean
status
=
data
.
status
;
if
(
status
)
{
if
(
status
)
{
log
.
info
(
"
点赞成功"
);
log
.
info
(
"
文章{}点赞成功"
,
articleId
);
}
else
{
}
else
{
log
.
info
(
"
点赞取消"
);
log
.
info
(
"
文章{}点赞取消"
,
articleId
);
}
}
return
status
;
return
status
;
}
else
if
(
code
==
400
)
{
}
else
if
(
code
==
400
)
{
...
...
src/main/java/com/kwan/springbootkwan/service/impl/CsdnUserInfoServiceImpl.java
浏览文件 @
e73fbbc1
package
com.kwan.springbootkwan.service.impl
;
package
com.kwan.springbootkwan.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.kwan.springbootkwan.mapper.CsdnUserInfoMapper
;
import
com.kwan.springbootkwan.entity.CsdnUserInfo
;
import
com.kwan.springbootkwan.entity.CsdnUserInfo
;
import
com.kwan.springbootkwan.mapper.CsdnUserInfoMapper
;
import
com.kwan.springbootkwan.service.CsdnUserInfoService
;
import
com.kwan.springbootkwan.service.CsdnUserInfoService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录