Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
6d18b645
Commit
6d18b645
authored
Sep 14, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查重
parent
384a8053
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
ThemeCheckDuplicateMapper.java
...unity/dao/mapper/community/ThemeCheckDuplicateMapper.java
+1
-1
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+1
-1
ThemeTextCheckService.java
...va/com/tanpu/community/service/ThemeTextCheckService.java
+4
-2
No files found.
community-service/src/main/java/com/tanpu/community/dao/mapper/community/ThemeCheckDuplicateMapper.java
View file @
6d18b645
...
...
@@ -17,7 +17,7 @@ import org.apache.ibatis.annotations.Update;
* @since 2021-09-08
*/
public
interface
ThemeCheckDuplicateMapper
extends
BaseMapper
<
ThemeCheckDuplicateEntity
>
{
@Update
(
"update theme_check_duplicate set delete_tag=1 where theme_id =
$
{id}"
)
@Update
(
"update theme_check_duplicate set delete_tag=1 where theme_id =
#
{id}"
)
Long
deleteByThemeId
(
@Param
(
"id"
)
String
themeId
);
@Select
(
"select max(tmp.d) from ("
+
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
6d18b645
...
...
@@ -248,7 +248,7 @@ public class ThemeManager {
}
catch
(
Exception
e
)
{
log
.
error
(
"error in save theme to ES. themeId:{}, error:{}"
,
themeEntity
.
getThemeId
(),
ExceptionUtils
.
getStackTrace
(
e
));
}
themeTextCheckService
.
insert
(
esThemeQo
.
getTextContent
(),
themeEntity
.
getThemeId
(),
userId
,
themeEntity
.
getThemeType
());
themeTextCheckService
.
insert
(
esThemeQo
.
getTextContent
(),
themeEntity
.
getThemeId
(),
userId
,
themeEntity
.
getThemeType
()
,
req
.
getEditThemeId
()
);
redisCache
.
evict
(
StringUtils
.
joinWith
(
"_"
,
CACHE_THEME_ID
,
themeEntity
.
getThemeId
()));
...
...
community-service/src/main/java/com/tanpu/community/service/ThemeTextCheckService.java
View file @
6d18b645
...
...
@@ -25,8 +25,10 @@ public class ThemeTextCheckService {
private
final
String
regex
=
"[,。!?;;:, ]"
;
// 插入
public
void
insert
(
String
content
,
String
themeId
,
String
userId
,
Integer
themeType
)
{
themeCheckDuplicateMapper
.
deleteByThemeId
(
themeId
);
public
void
insert
(
String
content
,
String
themeId
,
String
userId
,
Integer
themeType
,
String
editThemeId
)
{
if
(
StringUtils
.
isNotBlank
(
editThemeId
)){
themeCheckDuplicateMapper
.
deleteByThemeId
(
editThemeId
);
}
content
=
content
.
replaceAll
(
regex
,
"。"
);
String
[]
split
=
content
.
split
(
"。"
);
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++)
{
...
...
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