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
0a52c239
Commit
0a52c239
authored
Feb 07, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复博客博客引用错误
parent
02603811
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
src/main/java/cn/meteor/beyondclouds/modules/blog/service/impl/BlogServiceImpl.java
+10
-4
src/main/java/cn/meteor/beyondclouds/modules/question/service/impl/QuestionServiceImpl.java
+7
-2
No files found.
src/main/java/cn/meteor/beyondclouds/modules/blog/service/impl/BlogServiceImpl.java
View file @
0a52c239
...
...
@@ -369,8 +369,11 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
topicReferenceService
.
list
(
topicReferenceQueryWrapper
).
stream
()
.
map
(
TopicReference:
:
getTopicId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
referencedTopicIds
))
{
// 减少话题引用测试
topicService
.
decreaseReferenceCountBatch
(
referencedTopicIds
,
1
);
}
// 删除话题引用
topicReferenceService
.
remove
(
topicReferenceQueryWrapper
);
}
...
...
@@ -384,10 +387,8 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
}
// 批量保存
topicReferenceService
.
saveBatch
(
topicReferenceList
);
// 更新话题引用次数
existsTopicIds
.
forEach
(
topicId
->
{
topicService
.
increaseReferenceCount
(
topicId
,
1
);
});
// 新增话题引用次数
topicService
.
increaseReferenceCountBatch
(
existsTopicIds
,
1
);
}
}
...
...
@@ -405,8 +406,10 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
blogTagService
.
list
(
blogTagQueryWrapper
).
stream
()
.
map
(
BlogTag:
:
getTagId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
referencedTagIds
))
{
// 减少标签引用次数
tagService
.
decreaseReferenceCountBatch
(
referencedTagIds
,
1
);
}
// 删除标签引用
blogTagService
.
remove
(
blogTagQueryWrapper
);
}
...
...
@@ -417,7 +420,10 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
blogTag
.
setTagId
(
tagId
);
blogTagList
.
add
(
blogTag
);
}
// 保存标签引用
blogTagService
.
saveBatch
(
blogTagList
);
// 删除标签引用次数
tagService
.
increaseReferenceCountBatch
(
existsTagIds
,
1
);
}
}
}
...
...
src/main/java/cn/meteor/beyondclouds/modules/question/service/impl/QuestionServiceImpl.java
View file @
0a52c239
...
...
@@ -332,8 +332,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
topicReferenceService
.
list
(
topicReferenceQueryWrapper
).
stream
()
.
map
(
TopicReference:
:
getTopicId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
referencedTopicIds
))
{
// 减少话题引用数量
topicService
.
decreaseReferenceCountBatch
(
referencedTopicIds
,
1
);
}
// 删除话题引用
topicReferenceService
.
remove
(
topicReferenceQueryWrapper
);
}
...
...
@@ -349,7 +351,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
}).
collect
(
Collectors
.
toList
());
// 保存话题引用
topicReferenceService
.
saveBatch
(
topicReferenceList
);
//
更新
话题引用次数
//
增加
话题引用次数
topicService
.
increaseReferenceCountBatch
(
existsTopicIds
,
1
);
}
}
...
...
@@ -368,8 +370,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
questionTagService
.
list
(
questionTagQueryWrapper
).
stream
()
.
map
(
QuestionTag:
:
getTagId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
referencedTagIds
))
{
// 减少标签引用数量
tagService
.
decreaseReferenceCountBatch
(
referencedTagIds
,
1
);
}
// 删除标签引用
questionTagService
.
remove
(
questionTagQueryWrapper
);
}
...
...
@@ -381,8 +385,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
questionTag
.
setTagId
(
tagId
);
return
questionTag
;
}).
collect
(
Collectors
.
toList
());
// 保存标签引用
questionTagService
.
saveBatch
(
questionTagList
);
//
更新
标签引用次数
//
增加
标签引用次数
tagService
.
increaseReferenceCountBatch
(
existsTagIds
,
1
);
}
}
...
...
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