Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
f7b0c111
Commit
f7b0c111
authored
Nov 19, 2020
by
wuwz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改评论必填
parent
2d130ad8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
UserCommentBiz.java
...com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
+32
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
View file @
f7b0c111
...
...
@@ -159,7 +159,38 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
point
+=
jsonObject
.
getInteger
(
"point"
);
}
userComment
.
setPoint
(
point
);
addOrUpd
(
userComment
);
Integer
parentId
=
userComment
.
getParentId
()
==
null
?
0
:
userComment
.
getParentId
();
Integer
rootParentId
=
userComment
.
getRootParentId
()
==
null
?
0
:
userComment
.
getRootParentId
();
if
(
parentId
>
0
){
UserComment
parentComment
=
selectById
(
parentId
);
if
(
parentComment
==
null
){
throw
new
BaseException
(
"该评论不存在"
,
ResultCode
.
FAILED_CODE
);
}
rootParentId
=
parentComment
.
getRootParentId
();
userComment
.
setSoureId
(
parentComment
.
getSoureId
());
userComment
.
setSoureUserId
(
parentComment
.
getSoureUserId
());
userComment
.
setSoureType
(
parentComment
.
getSoureType
());
userComment
.
setToUserId
(
parentComment
.
getUserId
());
userComment
.
setRootParentId
(
rootParentId
);
}
else
{
if
(
StringUtils
.
isBlank
(
userComment
.
getSoureId
())){
throw
new
BaseException
(
"资源ID不能为空"
,
ResultCode
.
FAILED_CODE
);
}
}
userComment
.
setCreateTime
(
new
Date
());
insertSelective
(
userComment
);
Integer
id
=
userComment
.
getId
();
if
(
id
>
0
){
if
(
rootParentId
==
0
){
UserComment
userComment1
=
new
UserComment
();
userComment1
.
setId
(
id
);
userComment1
.
setRootParentId
(
id
);
updateSelectiveById
(
userComment1
);
}
else
{
mapper
.
addreplyNum
(
rootParentId
);
}
}
}
...
...
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