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
b7ce8f31
Commit
b7ce8f31
authored
Feb 01, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化项目评论Service
parent
bc6cb6a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
src/main/java/cn/meteor/beyondclouds/modules/project/service/impl/ProjectCommentServiceImpl.java
+8
-0
No files found.
src/main/java/cn/meteor/beyondclouds/modules/project/service/impl/ProjectCommentServiceImpl.java
View file @
b7ce8f31
...
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.Assert
;
/**
/**
* <p>
* <p>
...
@@ -35,6 +36,9 @@ public class ProjectCommentServiceImpl extends ServiceImpl<ProjectCommentMapper,
...
@@ -35,6 +36,9 @@ public class ProjectCommentServiceImpl extends ServiceImpl<ProjectCommentMapper,
@Override
@Override
public
void
publishComment
(
Integer
projectId
,
Integer
parentId
,
String
comment
,
String
userId
)
throws
ProjectCommentServiceException
{
public
void
publishComment
(
Integer
projectId
,
Integer
parentId
,
String
comment
,
String
userId
)
throws
ProjectCommentServiceException
{
Assert
.
notNull
(
projectId
,
"projectId must not be null"
);
Assert
.
hasText
(
comment
,
"comment must not be empty"
);
// 1. 查询项目是否存在
// 1. 查询项目是否存在
Project
project
=
projectService
.
getById
(
projectId
);
Project
project
=
projectService
.
getById
(
projectId
);
if
(
null
==
project
)
{
if
(
null
==
project
)
{
...
@@ -77,6 +81,9 @@ public class ProjectCommentServiceImpl extends ServiceImpl<ProjectCommentMapper,
...
@@ -77,6 +81,9 @@ public class ProjectCommentServiceImpl extends ServiceImpl<ProjectCommentMapper,
@Override
@Override
public
void
deleteComment
(
Integer
commentId
,
String
userId
)
throws
ProjectCommentServiceException
{
public
void
deleteComment
(
Integer
commentId
,
String
userId
)
throws
ProjectCommentServiceException
{
Assert
.
notNull
(
commentId
,
"commentId must not be null"
);
Assert
.
notNull
(
userId
,
"userId must not be null"
);
//1.查找评论是否存在
//1.查找评论是否存在
ProjectComment
projectComment
=
getById
(
commentId
);
ProjectComment
projectComment
=
getById
(
commentId
);
if
(
null
==
projectComment
)
{
if
(
null
==
projectComment
)
{
...
@@ -104,6 +111,7 @@ public class ProjectCommentServiceImpl extends ServiceImpl<ProjectCommentMapper,
...
@@ -104,6 +111,7 @@ public class ProjectCommentServiceImpl extends ServiceImpl<ProjectCommentMapper,
@Override
@Override
public
IPage
<
ProjectComment
>
getCommentPage
(
Integer
pageNumber
,
Integer
pageSize
,
Integer
projectId
,
Integer
parentId
)
throws
ProjectCommentServiceException
{
public
IPage
<
ProjectComment
>
getCommentPage
(
Integer
pageNumber
,
Integer
pageSize
,
Integer
projectId
,
Integer
parentId
)
throws
ProjectCommentServiceException
{
Assert
.
notNull
(
projectId
,
"projectId must not be null"
);
IPage
<
ProjectComment
>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
IPage
<
ProjectComment
>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
...
...
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