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
b9de5ab4
Commit
b9de5ab4
authored
Jul 15, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
话题列表fix
parent
acb44665
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
12 deletions
+24
-12
CreateCommentReq.java
...npu/community/api/beans/req/comment/CreateCommentReq.java
+1
-2
LikeCommentReq.java
...tanpu/community/api/beans/req/comment/LikeCommentReq.java
+4
-1
ForwardThemeReq.java
.../tanpu/community/api/beans/req/theme/ForwardThemeReq.java
+3
-3
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+4
-3
HomePageController.java
...va/com/tanpu/community/controller/HomePageController.java
+9
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+3
-3
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/req/comment/CreateCommentReq.java
View file @
b9de5ab4
...
@@ -5,13 +5,12 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,13 +5,12 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
@ApiModel
@ApiModel
@Data
@Data
public
class
CreateCommentReq
{
public
class
CreateCommentReq
{
@Not
Empty
(
message
=
"主题id不能为空"
)
@Not
Blank
(
message
=
"主题id不能为空"
)
@ApiModelProperty
(
value
=
"主题Id"
)
@ApiModelProperty
(
value
=
"主题Id"
)
private
String
themeId
;
private
String
themeId
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/comment/LikeCommentReq.java
View file @
b9de5ab4
...
@@ -4,10 +4,13 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,10 +4,13 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
@ApiModel
(
value
=
"点赞/取消点赞评论"
)
import
javax.validation.constraints.NotBlank
;
@Data
@Data
@ApiModel
(
value
=
"点赞/取消点赞评论"
)
public
class
LikeCommentReq
{
public
class
LikeCommentReq
{
@NotBlank
@ApiModelProperty
(
value
=
"评论Id"
)
@ApiModelProperty
(
value
=
"评论Id"
)
private
String
commentId
;
private
String
commentId
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/ForwardThemeReq.java
View file @
b9de5ab4
...
@@ -4,19 +4,19 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,19 +4,19 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.List
;
@Data
@Data
@ApiModel
(
value
=
"转发主题"
)
@ApiModel
(
value
=
"转发主题"
)
public
class
ForwardThemeReq
{
public
class
ForwardThemeReq
{
@Not
Empty
(
message
=
"转发对象id不能为空"
)
@Not
Blank
(
message
=
"转发对象id不能为空"
)
@ApiModelProperty
(
value
=
"转发的主题Id"
)
@ApiModelProperty
(
value
=
"转发的主题Id"
)
private
String
formerThemeId
;
private
String
formerThemeId
;
@Not
Null
(
message
=
"内容不能为空"
)
@Not
Empty
(
message
=
"内容不能为空"
)
@ApiModelProperty
(
value
=
"转发的讨论内容"
)
@ApiModelProperty
(
value
=
"转发的讨论内容"
)
private
List
<
ThemeContentReq
>
content
;
private
List
<
ThemeContentReq
>
content
;
...
...
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
View file @
b9de5ab4
...
@@ -14,6 +14,7 @@ import com.tanpu.community.util.PageUtils;
...
@@ -14,6 +14,7 @@ import com.tanpu.community.util.PageUtils;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -34,7 +35,7 @@ public class CommentController {
...
@@ -34,7 +35,7 @@ public class CommentController {
@AuthLogin
@AuthLogin
@PostMapping
(
value
=
"/publishComment"
)
@PostMapping
(
value
=
"/publishComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
publishCommet
(
@RequestBody
CreateCommentReq
req
)
{
public
CommonResp
<
Void
>
publishCommet
(
@
Validated
@
RequestBody
CreateCommentReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
commentManager
.
comment
(
req
,
userId
);
commentManager
.
comment
(
req
,
userId
);
return
CommonResp
.
success
();
return
CommonResp
.
success
();
...
@@ -44,7 +45,7 @@ public class CommentController {
...
@@ -44,7 +45,7 @@ public class CommentController {
@AuthLogin
@AuthLogin
@PostMapping
(
value
=
"/queryComment"
)
@PostMapping
(
value
=
"/queryComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@RequestBody
QueryCommentReq
req
)
{
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@
Validated
@
RequestBody
QueryCommentReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
...
@@ -54,7 +55,7 @@ public class CommentController {
...
@@ -54,7 +55,7 @@ public class CommentController {
@PostMapping
(
value
=
"/likeComment"
)
@PostMapping
(
value
=
"/likeComment"
)
@AuthLogin
@AuthLogin
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
likeComment
(
@RequestBody
LikeCommentReq
req
)
{
public
CommonResp
<
Void
>
likeComment
(
@
Validated
@
RequestBody
LikeCommentReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
commentManager
.
likeComment
(
req
,
userId
);
commentManager
.
likeComment
(
req
,
userId
);
return
CommonResp
.
success
();
return
CommonResp
.
success
();
...
...
community-service/src/main/java/com/tanpu/community/controller/HomePageController.java
View file @
b9de5ab4
...
@@ -64,4 +64,13 @@ public class HomePageController {
...
@@ -64,4 +64,13 @@ public class HomePageController {
return
CommonResp
.
success
(
themeManager
.
queryThemesByUser
(
req
,
userId
));
return
CommonResp
.
success
(
themeManager
.
queryThemesByUser
(
req
,
userId
));
}
}
@PostMapping
(
value
=
"/commentThemeList"
)
@ApiOperation
(
"用户评论过的帖子列表"
)
@ResponseBody
public
CommonResp
<
List
<
ThemeQo
>>
commentThemeList
(
@RequestBody
QueryRecordThemeReq
req
){
String
userId
=
"123"
;
return
CommonResp
.
success
(
themeManager
.
queryThemesByUser
(
req
,
userId
));
}
}
}
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
b9de5ab4
...
@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
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.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
...
@@ -56,6 +57,7 @@ public class ThemeManager {
...
@@ -56,6 +57,7 @@ public class ThemeManager {
private
OSSFileService
ossFileService
;
private
OSSFileService
ossFileService
;
@Transactional
public
void
publishTheme
(
CreateThemeReq
req
,
String
userId
)
{
public
void
publishTheme
(
CreateThemeReq
req
,
String
userId
)
{
//TODO 敏感词过滤
//TODO 敏感词过滤
...
@@ -176,7 +178,7 @@ public class ThemeManager {
...
@@ -176,7 +178,7 @@ public class ThemeManager {
.
themeType
(
ThemeTypeEnum
.
FORWARD
.
getCode
())
.
themeType
(
ThemeTypeEnum
.
FORWARD
.
getCode
())
.
build
();
.
build
();
if
(
StringUtils
.
isEmpty
(
req
.
getEditThemeId
())){
if
(
StringUtils
.
isEmpty
(
req
.
getEditThemeId
())
||
req
.
getEditThemeId
()==
req
.
getFormerThemeId
()
){
//新建
//新建
themeService
.
insertTheme
(
newTheme
);
themeService
.
insertTheme
(
newTheme
);
}
else
{
}
else
{
...
@@ -262,8 +264,6 @@ public class ThemeManager {
...
@@ -262,8 +264,6 @@ public class ThemeManager {
//组装正文详情
//组装正文详情
private
void
buildMainTestExtraInfo
(
ThemeQo
themeQo
,
String
userId
)
{
private
void
buildMainTestExtraInfo
(
ThemeQo
themeQo
,
String
userId
)
{
//附件列表
//附件列表
String
themeId
=
themeQo
.
getThemeId
();
productService
.
transferAttachement
(
themeQo
);
productService
.
transferAttachement
(
themeQo
);
//转发原文
//转发原文
buildFormerTheme
(
themeQo
);
buildFormerTheme
(
themeQo
);
...
...
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