Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段启岩
beyond-clouds
Commits
8fd328fb
Commit
8fd328fb
authored
Feb 11, 2020
by
Author name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.11 删除博客时跟新引用次数
parent
e8f9b254
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/main/java/cn/meteor/beyondclouds/modules/blog/service/impl/BlogServiceImpl.java
+7
-3
No files found.
src/main/java/cn/meteor/beyondclouds/modules/blog/service/impl/BlogServiceImpl.java
View file @
8fd328fb
...
@@ -203,8 +203,10 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
...
@@ -203,8 +203,10 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
QueryWrapper
<
BlogTag
>
queryWrapperTag
=
new
QueryWrapper
();
QueryWrapper
<
BlogTag
>
queryWrapperTag
=
new
QueryWrapper
();
queryWrapperTag
.
eq
(
"blog_id"
,
blogId
);
queryWrapperTag
.
eq
(
"blog_id"
,
blogId
);
//引用标签数量减一
//引用标签数量减一
List
<
String
>
tags
=
blogTagService
.
list
(
queryWrapperTag
).
stream
().
map
(
BlogTag:
:
getTagId
).
collect
(
Collectors
.
toList
());
List
<
String
>
tagIds
=
blogTagService
.
list
(
queryWrapperTag
).
stream
().
map
(
BlogTag:
:
getTagId
).
collect
(
Collectors
.
toList
());
tagService
.
decreaseReferenceCountBatch
(
tags
,
1
);
if
(!
CollectionUtils
.
isEmpty
(
tagIds
))
{
tagService
.
decreaseReferenceCountBatch
(
tagIds
,
1
);
}
blogTagService
.
remove
(
queryWrapperTag
);
blogTagService
.
remove
(
queryWrapperTag
);
//5.删除博客引用的话题
//5.删除博客引用的话题
...
@@ -212,7 +214,9 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
...
@@ -212,7 +214,9 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
queryWrapperTopic
.
eq
(
"referencer_id"
,
blogId
);
queryWrapperTopic
.
eq
(
"referencer_id"
,
blogId
);
//引用话题数量减一
//引用话题数量减一
List
<
String
>
topicIds
=
topicReferenceService
.
list
(
queryWrapperTopic
).
stream
().
map
(
TopicReference:
:
getTopicId
).
collect
(
Collectors
.
toList
());
List
<
String
>
topicIds
=
topicReferenceService
.
list
(
queryWrapperTopic
).
stream
().
map
(
TopicReference:
:
getTopicId
).
collect
(
Collectors
.
toList
());
topicService
.
decreaseReferenceCountBatch
(
topicIds
,
1
);
if
(!
CollectionUtils
.
isEmpty
(
topicIds
))
{
topicService
.
decreaseReferenceCountBatch
(
topicIds
,
1
);
}
topicReferenceService
.
remove
(
queryWrapperTopic
);
topicReferenceService
.
remove
(
queryWrapperTopic
);
//6.删除博客表里的数据
//6.删除博客表里的数据
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment