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
c4ed5301
Commit
c4ed5301
authored
Jul 08, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调整
parent
6d214c43
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
756 additions
and
291 deletions
+756
-291
pom.xml
community-api/pom.xml
+4
-0
TopicDTO.java
...src/main/java/com/tanpu/community/api/beans/TopicDTO.java
+4
-10
TopicDataAnalysDTO.java
...ava/com/tanpu/community/api/beans/TopicDataAnalysDTO.java
+7
-7
AttachmentQo.java
...n/java/com/tanpu/community/api/beans/qo/AttachmentQo.java
+18
-0
CommentLv2Qo.java
...n/java/com/tanpu/community/api/beans/qo/CommentLv2Qo.java
+44
-0
CommentQo.java
...main/java/com/tanpu/community/api/beans/qo/CommentQo.java
+15
-14
MainTextQo.java
...ain/java/com/tanpu/community/api/beans/qo/MainTextQo.java
+4
-5
ThemeQo.java
...c/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
+8
-7
TopicDetailQo.java
.../java/com/tanpu/community/api/beans/qo/TopicDetailQo.java
+22
-0
TopicTitileQo.java
.../java/com/tanpu/community/api/beans/qo/TopicTitileQo.java
+3
-3
CreateCommentReq.java
...a/com/tanpu/community/api/beans/req/CreateCommentReq.java
+7
-0
CreateThemeReq.java
...ava/com/tanpu/community/api/beans/req/CreateThemeReq.java
+3
-0
Page.java
...ain/java/com/tanpu/community/api/beans/req/page/Page.java
+105
-0
Pageable.java
...java/com/tanpu/community/api/beans/req/page/Pageable.java
+25
-0
ThemeListReq.java
...com/tanpu/community/api/beans/req/theme/ThemeListReq.java
+15
-0
TopicConcealReq.java
.../tanpu/community/api/beans/req/topic/TopicConcealReq.java
+0
-1
TopicSearchReq.java
...m/tanpu/community/api/beans/req/topic/TopicSearchReq.java
+14
-0
CourseVo.java
.../main/java/com/tanpu/community/api/beans/vo/CourseVo.java
+4
-0
ProductVo.java
...main/java/com/tanpu/community/api/beans/vo/ProductVo.java
+4
-0
ShortVideoVo.java
...n/java/com/tanpu/community/api/beans/vo/ShortVideoVo.java
+4
-0
ZhiboVo.java
...c/main/java/com/tanpu/community/api/beans/vo/ZhiboVo.java
+4
-0
RedisKeyConstant.java
...a/com/tanpu/community/api/constants/RedisKeyConstant.java
+15
-15
CollectionTypeEnum.java
...ava/com/tanpu/community/api/enums/CollectionTypeEnum.java
+3
-2
HomePageCache.java
...rc/main/java/com/tanpu/community/cache/HomePageCache.java
+22
-0
AdminController.java
.../java/com/tanpu/community/controller/AdminController.java
+2
-14
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+59
-0
HomePageController.java
...va/com/tanpu/community/controller/HomePageController.java
+1
-1
MetricsController.java
...ava/com/tanpu/community/controller/MetricsController.java
+1
-1
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+12
-20
TopicController.java
.../java/com/tanpu/community/controller/TopicController.java
+23
-11
ThemeEntity.java
...com/tanpu/community/dao/entity/community/ThemeEntity.java
+0
-24
TopicEntity.java
...com/tanpu/community/dao/entity/community/TopicEntity.java
+5
-5
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+76
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+29
-39
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+44
-38
CollectionService.java
...n/java/com/tanpu/community/service/CollectionService.java
+22
-45
CommentService.java
...main/java/com/tanpu/community/service/CommentService.java
+13
-6
HomePageService.java
...ain/java/com/tanpu/community/service/HomePageService.java
+9
-7
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+8
-1
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+10
-4
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+18
-6
PageUtils.java
...ice/src/main/java/com/tanpu/community/util/PageUtils.java
+61
-0
ThemeEntityMapper.xml
...src/main/resources/mapper/community/ThemeEntityMapper.xml
+0
-2
TopicEntityMapper.xml
...src/main/resources/mapper/community/TopicEntityMapper.xml
+1
-1
create.sql
docs/create.sql
+2
-2
pom.xml
pom.xml
+6
-0
No files found.
community-api/pom.xml
View file @
c4ed5301
...
...
@@ -17,6 +17,10 @@
<groupId>
com.tanpu
</groupId>
<artifactId>
common
</artifactId>
</dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper
</artifactId>
</dependency>
</dependencies>
</project>
community-api/src/main/java/com/tanpu/community/api/beans/TopicDTO.java
View file @
c4ed5301
...
...
@@ -25,27 +25,23 @@ public class TopicDTO implements Serializable {
@ApiModelProperty
(
value
=
"是否隐藏"
)
private
Integer
isConceal
;
private
String
createBy
;
private
LocalDateTime
createTime
;
private
String
updateBy
;
private
LocalDateTime
updateTime
;
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"帖子量"
)
private
Long
themeAm
ount
;
private
Integer
themeC
ount
;
@ApiModelProperty
(
value
=
"浏览量"
)
private
Long
viewAm
ount
;
private
Integer
viewC
ount
;
@ApiModelProperty
(
value
=
"点赞量"
)
private
Long
likeAm
ount
;
private
Integer
likeC
ount
;
@ApiModelProperty
(
value
=
"总用户数"
)
private
Long
UserAm
ount
;
private
Integer
UserC
ount
;
@ApiModelProperty
...
...
@@ -57,9 +53,7 @@ public class TopicDTO implements Serializable {
", topicTitle="
+
topicTitle
+
", isTop="
+
isTop
+
", isConceal="
+
isConceal
+
", createBy="
+
createBy
+
", createTime="
+
createTime
+
", updateBy="
+
updateBy
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
"}"
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/TopicDataAnalysDTO.java
View file @
c4ed5301
...
...
@@ -15,17 +15,17 @@ public class TopicDataAnalysDTO {
@ApiModelProperty
(
value
=
"话题名称"
)
private
String
topicTitle
;
@ApiModelProperty
(
value
=
"总浏览量"
)
private
Integer
viewTotal
Am
ount
;
private
Integer
viewTotal
C
ount
;
@ApiModelProperty
(
value
=
"话题页面浏览量"
)
private
Integer
viewPage
Am
ount
;
private
Integer
viewPage
C
ount
;
@ApiModelProperty
(
value
=
"发帖数"
)
private
Integer
theme
Am
ount
;
private
Integer
theme
C
ount
;
@ApiModelProperty
(
value
=
"回帖数"
)
private
Integer
comment
Am
ount
;
private
Integer
comment
C
ount
;
@ApiModelProperty
(
value
=
"总用户数"
)
private
Integer
userTotal
Am
ount
;
private
Integer
userTotal
C
ount
;
@ApiModelProperty
(
value
=
"发帖人数"
)
private
Integer
poster
Am
ount
;
private
Integer
poster
C
ount
;
@ApiModelProperty
(
value
=
"回帖人数"
)
private
Integer
replIier
Am
ount
;
private
Integer
replIier
C
ount
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/AttachmentQo.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
AttachmentQo
{
@ApiModelProperty
(
"附件类型,1:产品 2:直播 3:短视频 4:课程"
)
private
Integer
type
;
@ApiModelProperty
(
"附件对象"
)
private
Object
attachment
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/CommentLv2Qo.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
@Data
public
class
CommentLv2Qo
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"uuid"
)
private
String
commentId
;
@ApiModelProperty
(
value
=
"类型"
)
private
Integer
commentType
;
@ApiModelProperty
(
value
=
"文本内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
value
=
"点赞次数"
)
private
Integer
likeCount
;
@ApiModelProperty
(
value
=
"评论时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"作者昵称"
)
private
String
nickName
;
@ApiModelProperty
(
value
=
"作者头像"
)
private
String
userImg
;
@ApiModelProperty
(
value
=
"回复用户名"
)
private
String
replyName
;
@ApiModelProperty
(
value
=
"当前用户是否点赞"
)
private
boolean
hasLiked
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/CommentQo.java
View file @
c4ed5301
...
...
@@ -4,13 +4,17 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Data
public
class
CommentQo
{
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"uuid"
)
private
String
commentId
;
@ApiModelProperty
(
value
=
"类型"
)
private
Integer
commentType
;
...
...
@@ -21,24 +25,21 @@ public class CommentQo {
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
value
=
"点赞次数"
)
private
Integer
likeCount
;
@ApiModelProperty
(
value
=
"评论时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"昵称"
)
private
String
nickName
;
@ApiModelProperty
(
value
=
"用户头像"
)
private
String
userImg
;
@ApiModelProperty
(
value
=
"评论的目标id"
)
private
String
targetId
;
@ApiModelProperty
(
value
=
"是否屏蔽"
)
private
Integer
isBlock
;
@ApiModelProperty
(
value
=
"点赞次数"
)
private
Long
likeAmount
;
@ApiModelProperty
(
value
=
"评论时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"当前用户是否点赞"
)
private
boolean
isLiked
;
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"2级评论"
)
private
List
<
CommentLv2Qo
>
commentLv2Qos
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/MainTextQo.java
View file @
c4ed5301
...
...
@@ -6,7 +6,6 @@ import lombok.Data;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Map
;
/**
* 正文
...
...
@@ -55,13 +54,13 @@ public class MainTextQo {
private
Long
forwardAomunt
;
@ApiModelProperty
(
value
=
"评论量"
)
private
Long
comment
Am
ount
;
private
Long
comment
C
ount
;
@ApiModelProperty
(
value
=
"点赞量"
)
private
Long
likeAm
ount
;
private
Integer
likeC
ount
;
@ApiModelProperty
(
"附件
,key是类型,1:产品 2:直播 3:短视频 4:课程
"
)
private
Map
<
String
,
Object
>
attachment
;
@ApiModelProperty
(
"附件
,
"
)
private
List
<
AttachmentQo
>
attachment
;
@ApiModelProperty
(
value
=
"评论"
)
private
List
<
CommentQo
>
comments
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
View file @
c4ed5301
...
...
@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.time.LocalDateTime
;
import
java.util.Map
;
@Data
public
class
ThemeQo
{
...
...
@@ -12,7 +11,10 @@ public class ThemeQo {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"UUID"
)
private
String
themeId
;
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
...
...
@@ -48,18 +50,17 @@ public class ThemeQo {
private
String
formerThemeId
;
@ApiModelProperty
(
value
=
"转发量"
)
private
Long
forwardAm
ount
;
private
Integer
forwardC
ount
;
@ApiModelProperty
(
value
=
"评论量"
)
private
Long
commentAm
ount
;
private
Integer
commentC
ount
;
@ApiModelProperty
(
value
=
"点赞量"
)
private
Long
likeAm
ount
;
private
Integer
likeC
ount
;
@ApiModelProperty
(
"附件"
)
private
Map
<
String
,
Object
>
attachment
;
private
AttachmentQo
attachmentQo
;
private
Object
attachmentInfo
;
private
LocalDateTime
createTime
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicDetailQo.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
public
class
TopicDetailQo
{
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"话题名称"
)
private
String
topicTitle
;
@ApiModelProperty
(
value
=
"阅读量"
)
private
Integer
viewCount
;
@ApiModelProperty
(
value
=
"讨论量"
)
private
Integer
disscussCount
;
private
List
<
ThemeQo
>
themes
;
}
community-api/src/main/java/com/tanpu/community/api/beans/
TopicBriefInfoDTO
.java
→
community-api/src/main/java/com/tanpu/community/api/beans/
qo/TopicTitileQo
.java
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
;
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -7,7 +7,7 @@ import lombok.Data;
* APP端话题列表页
*/
@Data
public
class
Topic
BriefInfoDTO
{
public
class
Topic
TitileQo
{
private
String
topicId
;
...
...
@@ -15,5 +15,5 @@ public class TopicBriefInfoDTO {
private
String
title
;
@ApiModelProperty
(
"讨论数"
)
private
Long
discussionAm
ount
;
private
Integer
discussionC
ount
;
}
community-api/src/main/java/com/tanpu/community/api/beans/req/CreateCommentReq.java
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
req
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
...
...
@@ -12,6 +13,12 @@ public class CreateCommentReq {
@NotEmpty
(
message
=
"主题id不能为空"
)
private
String
themeId
;
@ApiModelProperty
(
value
=
"一级评论id(对主题的一级评论,此项为空)"
)
private
String
parentId
;
@ApiModelProperty
(
value
=
"回复对象的id(非对评论回复时,此项为空)"
)
private
String
replyId
;
@NotEmpty
(
message
=
"评论内容不能为空"
)
private
String
comment
;
}
community-api/src/main/java/com/tanpu/community/api/beans/req/CreateThemeReq.java
View file @
c4ed5301
...
...
@@ -3,6 +3,7 @@ package com.tanpu.community.api.beans.req;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.Map
;
@Data
...
...
@@ -11,6 +12,7 @@ public class CreateThemeReq {
private
static
final
long
serialVersionUID
=
1L
;
@NotEmpty
(
message
=
"类型不能为空"
)
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题"
)
private
Integer
themeType
;
...
...
@@ -18,6 +20,7 @@ public class CreateThemeReq {
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
@NotEmpty
(
message
=
"内容不能为空"
)
@ApiModelProperty
(
value
=
"文本内容"
)
private
String
content
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/page/Page.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
page
;
import
com.github.pagehelper.PageHelper
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
Page
<
T
>
{
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Long
totalSize
;
private
Integer
totalPages
;
private
List
<
T
>
content
;
public
Page
(
Pageable
pageable
,
List
<
T
>
content
)
{
this
.
pageNum
=
pageable
.
getPageNumber
();
this
.
pageSize
=
content
.
size
();
this
.
content
=
content
;
}
public
Page
(
Integer
pageNum
,
Integer
pageSize
)
{
com
.
github
.
pagehelper
.
Page
page
=
PageHelper
.
startPage
(
pageNum
,
pageSize
);
this
.
pageNum
=
page
.
getPageNum
();
this
.
pageSize
=
page
.
getPageSize
();
this
.
totalSize
=
page
.
getTotal
();
this
.
content
=
page
.
getResult
();
}
public
Page
(
Pageable
pageable
,
Long
totalSize
)
{
this
.
pageNum
=
pageable
.
getPageNumber
();
this
.
pageSize
=
pageable
.
getPageSize
();
this
.
totalSize
=
totalSize
;
if
(
totalSize
==
0
)
{
this
.
totalPages
=
1
;
}
else
{
this
.
totalPages
=
(
int
)
(
totalSize
%
pageable
.
getPageSize
()
==
0
?
totalSize
/
pageable
.
getPageSize
()
:
totalSize
/
pageable
.
getPageSize
()
+
1
);
}
}
public
Page
(
com
.
github
.
pagehelper
.
Page
page
)
{
this
.
pageNum
=
page
.
getPageNum
();
this
.
pageSize
=
page
.
getPageSize
();
this
.
totalSize
=
page
.
getTotal
();
this
.
totalPages
=
page
.
getPages
();
this
.
content
=
page
.
getResult
();
}
public
Page
(
com
.
github
.
pagehelper
.
Page
page
,
List
<
T
>
content
)
{
this
.
pageNum
=
page
.
getPageNum
();
this
.
pageSize
=
page
.
getPageSize
();
this
.
totalSize
=
page
.
getTotal
();
this
.
totalPages
=
page
.
getPages
();
this
.
content
=
content
;
}
public
Page
(
Pageable
pageable
,
Long
totalSize
,
List
<
T
>
content
)
{
this
.
pageNum
=
pageable
.
getPageNumber
();
this
.
pageSize
=
pageable
.
getPageSize
();
this
.
totalSize
=
totalSize
;
this
.
content
=
content
;
}
public
Page
(
org
.
springframework
.
data
.
domain
.
Page
page
)
{
this
.
pageNum
=
page
.
getPageable
().
getPageNumber
();
this
.
pageSize
=
page
.
getPageable
().
getPageSize
();
this
.
totalSize
=
(
long
)
page
.
getSize
();
this
.
totalPages
=
page
.
getTotalPages
();
this
.
content
=
page
.
getContent
();
}
public
Page
(
org
.
springframework
.
data
.
domain
.
Page
page
,
List
<
T
>
content
)
{
this
.
pageNum
=
page
.
getPageable
().
getPageNumber
()
+
1
;
this
.
pageSize
=
page
.
getPageable
().
getPageSize
();
this
.
totalSize
=
page
.
getTotalElements
();
this
.
totalPages
=
page
.
getTotalPages
();
this
.
content
=
content
;
}
public
Page
(
Integer
pageNum
,
Integer
pageSize
,
Long
totalSize
)
{
this
.
pageNum
=
pageNum
;
this
.
pageSize
=
pageSize
;
this
.
totalSize
=
totalSize
;
if
(
totalSize
==
0
)
{
this
.
totalPages
=
1
;
}
else
{
this
.
totalPages
=
(
int
)
(
totalSize
%
pageSize
==
0
?
totalSize
/
pageSize
:
totalSize
/
pageSize
+
1
);
}
}
public
Page
()
{
}
@Override
public
String
toString
()
{
return
"Page{"
+
"pageNum="
+
pageNum
+
", pageSize="
+
pageSize
+
", content="
+
"[...]"
+
'}'
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/req/page/Pageable.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
page
;
import
lombok.Data
;
@Data
public
class
Pageable
{
public
static
final
Integer
DEFAULT_PAGE_SIZE
=
10
;
public
static
final
Integer
MAX_PAGE_SIZE
=
9999
;
public
static
final
Integer
DEFAULT_PAGE_NUMBER
=
0
;
private
Integer
pageNumber
=
DEFAULT_PAGE_NUMBER
;
private
Integer
pageSize
=
DEFAULT_PAGE_SIZE
;
public
Pageable
()
{
}
public
Pageable
(
Integer
pageNumber
,
Integer
pageSize
)
{
this
.
pageNumber
=
pageNumber
;
this
.
pageSize
=
pageSize
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/ThemeListReq.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
theme
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
ThemeListReq
{
@ApiModelProperty
(
value
=
"当前浏览的最后一个themeId"
)
private
String
lastId
;
@ApiModelProperty
(
value
=
"页面大小"
)
private
Integer
PageSize
;
}
community-api/src/main/java/com/tanpu/community/api/beans/req/topic/TopicConcealReq.java
View file @
c4ed5301
...
...
@@ -4,7 +4,6 @@ import lombok.Data;
@Data
public
class
TopicConcealReq
{
private
String
topicId
;
private
boolean
isConceal
;
}
community-api/src/main/java/com/tanpu/community/api/beans/req/topic/TopicSearchReq.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
req
.
topic
;
import
com.tanpu.community.api.beans.req.page.Pageable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
TopicSearchReq
{
@ApiModelProperty
(
value
=
"搜索关键字"
)
private
String
searchKeyword
;
@ApiModelProperty
(
value
=
"分页"
)
private
Pageable
page
;
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/CourseVo.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
;
public
class
CourseVo
{
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/ProductVo.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
;
public
class
ProductVo
{
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/ShortVideoVo.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
;
public
class
ShortVideoVo
{
}
community-api/src/main/java/com/tanpu/community/api/beans/vo/ZhiboVo.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
api
.
beans
.
vo
;
public
class
ZhiboVo
{
}
community-api/src/main/java/com/tanpu/community/api/constants/RedisKeyConstant.java
View file @
c4ed5301
...
...
@@ -3,31 +3,31 @@ package com.tanpu.community.api.constants;
public
class
RedisKeyConstant
{
//话题页浏览量
public
static
final
String
TOPIC_PAGE_VIEW_
AMOUNT_
=
"TOPIC_PAGE_VIEW_AM
OUNT_"
;
public
static
final
String
TOPIC_PAGE_VIEW_
COUNT_
=
"TOPIC_PAGE_VIEW_C
OUNT_"
;
//话题总浏览量=总浏览量+带这个话题的帖子量
public
static
final
String
TOPIC_TOTAL_VIEW_
AMOUNT_
=
"TOPIC_TOTAL_VIEW_AM
OUNT_"
;
public
static
final
String
TOPIC_TOTAL_VIEW_
COUNT_
=
"TOPIC_TOTAL_VIEW_C
OUNT_"
;
//点赞量
public
static
final
String
TOPIC_LIKE_
AMOUNT_
=
"TOPIC_LIKE_AM
OUNT_"
;
public
static
final
String
TOPIC_LIKE_
COUNT_
=
"TOPIC_LIKE_C
OUNT_"
;
//收藏量
public
static
final
String
TOPIC_BOOK_
AMOUNT_
=
"TOPIC_BOOK_AM
OUNT_"
;
public
static
final
String
TOPIC_BOOK_
COUNT_
=
"TOPIC_BOOK_C
OUNT_"
;
//用户数
public
static
final
String
TOPIC_USER_
AMOUNT_
=
"TOPIC_USER_AM
OUNT_"
;
public
static
final
String
TOPIC_USER_
COUNT_
=
"TOPIC_USER_C
OUNT_"
;
//讨论量=发布主题贴数+回复总数
public
static
final
String
TOPIC_DISCUSS_
AMOUNT_
=
"TOPIC_DISCUSS_AM
OUNT_"
;
public
static
final
String
TOPIC_DISCUSS_
COUNT_
=
"TOPIC_DISCUSS_C
OUNT_"
;
//发帖数
public
static
final
String
TOPIC_THEME_
AMOUNT_
=
"TOPIC_THEME_AM
OUNT_"
;
public
static
final
String
TOPIC_THEME_
COUNT_
=
"TOPIC_THEME_C
OUNT_"
;
//回帖数
public
static
final
String
TOPIC_COMMENT_
AMOUNT_
=
"TOPIC_COMMENT_AM
OUNT_"
;
public
static
final
String
TOPIC_COMMENT_
COUNT_
=
"TOPIC_COMMENT_C
OUNT_"
;
//总用户数=访问话题页+发帖+回帖(去重)
public
static
final
String
TOPIC_TOTAL_USER_
AMOUNT_
=
"TOPIC_TOTAL_USER_AM
OUNT_"
;
public
static
final
String
TOPIC_TOTAL_USER_
COUNT_
=
"TOPIC_TOTAL_USER_C
OUNT_"
;
//访问话题人数
public
static
final
String
TOPIC_USER_VIEW_
AMOUNT_
=
"TOPIC_USER_VIEW_AM
OUNT_"
;
public
static
final
String
TOPIC_USER_VIEW_
COUNT_
=
"TOPIC_USER_VIEW_C
OUNT_"
;
//发帖人数
public
static
final
String
TOPIC_POST_USER_
AMOUNT_
=
"TOPIC_POST_USER_AM
OUNT_"
;
public
static
final
String
TOPIC_POST_USER_
COUNT_
=
"TOPIC_POST_USER_C
OUNT_"
;
//回帖人数
public
static
final
String
TOPIC_COMMENT_USER_
AMOUNT_
=
"TOPIC_COMMENT_USER_AM
OUNT_"
;
public
static
final
String
TOPIC_COMMENT_USER_
COUNT_
=
"TOPIC_COMMENT_USER_C
OUNT_"
;
public
static
final
String
THEME_VIEW_
AMOUNT_
=
"THEME_VIEW_AM
OUNT_"
;
public
static
final
String
THEME_LIKE_
AMOUNT_
=
"THEME_LIKE_AM
OUNT_"
;
public
static
final
String
THEME_BOOK_
AMOUNT_
=
"THEME_BOOK_AM
OUNT_"
;
public
static
final
String
THEME_VIEW_
COUNT_
=
"THEME_VIEW_C
OUNT_"
;
public
static
final
String
THEME_LIKE_
COUNT_
=
"THEME_LIKE_C
OUNT_"
;
public
static
final
String
THEME_BOOK_
COUNT_
=
"THEME_BOOK_C
OUNT_"
;
}
community-api/src/main/java/com/tanpu/community/api/enums/CollectionTypeEnum.java
View file @
c4ed5301
...
...
@@ -2,8 +2,9 @@ package com.tanpu.community.api.enums;
public
enum
CollectionTypeEnum
{
LIKE
(
1
,
"点赞"
),
BOOK
(
2
,
"收藏"
);
LIKE_THEME
(
1
,
"点赞主题"
),
BOOK_THEME
(
2
,
"收藏主题"
),
LIKE_COMMENT
(
3
,
"点赞评论"
);
private
Integer
code
;
private
String
type
;
...
...
community-service/src/main/java/com/tanpu/community/cache/HomePageCache.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
cache
;
import
com.tanpu.community.dao.entity.community.HomePageEntity
;
import
com.tanpu.community.service.HomePageService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.Map
;
/**
* 用户信息缓存类
*/
public
class
HomePageCache
{
private
Map
<
String
,
HomePageEntity
>
homePageCache
;
@Autowired
private
HomePageService
homePageService
;
}
community-service/src/main/java/com/tanpu/community/controller/AdminController.java
View file @
c4ed5301
...
...
@@ -2,7 +2,6 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.community.api.beans.TopicBriefInfoDTO
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.api.beans.TopicDataAnalysDTO
;
import
com.tanpu.community.api.beans.req.topic.TopicConcealReq
;
...
...
@@ -16,8 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@Slf4j
@RequestMapping
(
value
=
"/api/admin"
)
...
...
@@ -30,16 +27,7 @@ public class AdminController {
@Autowired
private
UserHolder
userHolder
;
@GetMapping
(
value
=
"/admin/queryTopicDetailList"
)
@ApiOperation
(
"查询所有的话题详情"
)
@ResponseBody
public
CommonResp
<
List
<
TopicBriefInfoDTO
>>
getAllTopicList
(){
List
<
TopicBriefInfoDTO
>
allTopic
=
topicManager
.
getAllTopicBriefInfo
();
return
CommonResp
.
success
(
allTopic
);
}
@PostMapping
(
value
=
"/admin/insertTopic"
)
@GetMapping
(
value
=
"/insertTopic"
)
@ApiOperation
(
"新增话题"
)
@ResponseBody
public
CommonResp
<
Void
>
addTopic
(
@RequestParam
String
topicTitle
){
...
...
@@ -79,7 +67,7 @@ public class AdminController {
@ApiOperation
(
"话题浏览数调整(后台管理)"
)
@ResponseBody
public
CommonResp
<
Void
>
modifyViewNum
(
@RequestBody
TopicModifyMountReq
req
)
throws
MissingServletRequestParameterException
{
topicManager
.
modifyView
Am
ount
(
req
.
getTopicId
(),
req
.
getModifyMount
());
topicManager
.
modifyView
C
ount
(
req
.
getTopicId
(),
req
.
getModifyMount
());
return
CommonResp
.
success
();
}
...
...
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
controller
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.manager.CommentManager
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@Slf4j
@RequestMapping
(
value
=
"/api/theme"
)
public
class
CommentController
{
@Autowired
private
CommentManager
commentManager
;
@ApiOperation
(
"发表评论"
)
@PostMapping
(
value
=
"/publishComment"
)
@ResponseBody
public
CommonResp
<
Void
>
publishCommet
(
@RequestBody
CreateCommentReq
req
)
{
String
userId
=
"liujm"
;
commentManager
.
comment
(
req
,
userId
);
return
CommonResp
.
success
();
}
@ApiOperation
(
"查看评论"
)
@PostMapping
(
value
=
"/queryComment"
)
@ResponseBody
public
CommonResp
<
List
<
CommentQo
>>
queryComment
(
@RequestParam
String
themeId
){
//todo
String
userId
=
"liujm"
;
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
themeId
,
userId
);
return
CommonResp
.
success
(
result
);
}
@ApiOperation
(
"点赞评论"
)
@PostMapping
(
value
=
"/likeComment"
)
@ResponseBody
public
CommonResp
likeComment
(
@RequestParam
String
themeId
){
//todo
String
userId
=
"liujm"
;
return
CommonResp
.
success
();
}
@ApiOperation
(
"举报评论"
)
@PostMapping
(
value
=
"/reportComment"
)
@ResponseBody
public
CommonResp
reportComment
(
@RequestParam
String
themeId
){
//todo
String
userId
=
"liujm"
;
return
CommonResp
.
success
();
}
}
community-service/src/main/java/com/tanpu/community/controller/HomePageController.java
View file @
c4ed5301
...
...
@@ -84,7 +84,7 @@ public class HomePageController {
return
CommonResp
.
success
();
}
@PostMapping
(
value
=
"/query
/query
MyLike"
)
@PostMapping
(
value
=
"/queryMyLike"
)
@ApiOperation
(
"我的点赞帖子列表"
)
@ResponseBody
public
CommonResp
<
List
<
ThemeQo
>>
likeList
(){
...
...
community-service/src/main/java/com/tanpu/community/controller/MetricsController.java
View file @
c4ed5301
...
...
@@ -16,7 +16,7 @@ public class MetricsController {
@ApiOperation
(
"浏览量埋点"
)
@RequestMapping
(
"/pv"
)
public
CommonResp
pageView
(
@RequestParam
String
themeId
){
redisService
.
incr
(
RedisKeyConstant
.
THEME_VIEW_
AM
OUNT_
+
themeId
,
1L
);
redisService
.
incr
(
RedisKeyConstant
.
THEME_VIEW_
C
OUNT_
+
themeId
,
1L
);
return
CommonResp
.
success
();
}
...
...
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
c4ed5301
...
...
@@ -5,8 +5,8 @@ import com.tanpu.common.api.CommonResp;
import
com.tanpu.community.api.beans.ForwardThemeReq
;
import
com.tanpu.community.api.beans.qo.MainTextQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.CreateThemeReq
;
import
com.tanpu.community.api.beans.req.theme.ThemeListReq
;
import
com.tanpu.community.manager.ThemeManager
;
import
com.tanpu.community.service.FollowRelService
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -31,39 +31,31 @@ public class ThemeController {
@ApiOperation
(
"发表主题"
)
@PostMapping
(
value
=
"/publish"
)
@ResponseBody
public
CommonResp
<
Void
>
publishTheme
(
@RequestBody
CreateThemeReq
req
)
{
public
CommonResp
<
Void
>
publishTheme
(
@
Validated
@
RequestBody
CreateThemeReq
req
)
{
String
userId
=
"liujm"
;
themeManager
.
publishTheme
(
req
,
userId
);
return
CommonResp
.
success
();
}
@ApiOperation
(
"圈子首页-推荐"
)
@GetMapping
(
value
=
"/rec
mend_l
ist"
)
@GetMapping
(
value
=
"/rec
ommendL
ist"
)
@ResponseBody
public
List
<
ThemeQo
>
selectHotList
()
{
public
List
<
ThemeQo
>
selectHotList
(
ThemeListReq
req
)
{
String
userId
=
"liujm"
;
return
themeManager
.
selectHotThemes
(
userId
);
return
themeManager
.
selectHotThemes
(
req
,
userId
);
}
@ApiOperation
(
"圈子首页-关注"
)
@GetMapping
(
value
=
"/
interest_l
ist"
)
@GetMapping
(
value
=
"/
followL
ist"
)
@ResponseBody
public
List
<
ThemeQo
>
selectInterestList
()
{
public
List
<
ThemeQo
>
selectInterestList
(
ThemeListReq
req
)
{
String
userId
=
"liujm012"
;
return
themeManager
.
selectInterestThemes
(
userId
);
return
themeManager
.
selectInterestThemes
(
req
,
userId
);
}
@ApiOperation
(
"评论"
)
@PostMapping
(
value
=
"/comment"
)
@ResponseBody
public
CommonResp
<
Void
>
commetOnTheme
(
@RequestBody
CreateCommentReq
req
)
{
String
userId
=
"liujm"
;
themeManager
.
comment
(
req
,
userId
);
return
CommonResp
.
success
();
}
@ApiOperation
(
"主题正文"
)
@GetMapping
(
value
=
"/
main_text
"
)
@GetMapping
(
value
=
"/
detail
"
)
@ResponseBody
public
CommonResp
<
MainTextQo
>
getThemeMainText
(
@RequestParam
String
topicId
)
{
String
userId
=
"liujm"
;
...
...
@@ -98,7 +90,7 @@ public class ThemeController {
}
@ApiOperation
(
"收藏主题"
)
@GetMapping
(
value
=
"/
book
"
)
@GetMapping
(
value
=
"/
collect
"
)
@ResponseBody
public
CommonResp
bookTheme
(
String
themeId
)
{
String
user
=
"liujm"
;
...
...
@@ -107,7 +99,7 @@ public class ThemeController {
}
@ApiOperation
(
"举报主题"
)
@GetMapping
(
value
=
"/
complain
t"
)
@GetMapping
(
value
=
"/
repor
t"
)
@ResponseBody
public
CommonResp
complaintTheme
(
@RequestParam
String
themeId
)
{
...
...
@@ -115,7 +107,7 @@ public class ThemeController {
}
@ApiOperation
(
"屏蔽"
)
@GetMapping
(
value
=
"/
conceal
"
)
@GetMapping
(
value
=
"/
block
"
)
@ResponseBody
public
CommonResp
concealTheme
(
String
themeId
)
{
String
user
=
"liujm"
;
...
...
community-service/src/main/java/com/tanpu/community/controller/TopicController.java
View file @
c4ed5301
...
...
@@ -2,18 +2,14 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.community.api.beans.TopicBriefInfoDTO
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.api.beans.TopicDataAnalysDTO
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.qo.TopicTitileQo
;
import
com.tanpu.community.api.beans.req.topic.TopicSearchReq
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.manager.TopicManager
;
import
com.tanpu.community.api.beans.req.topic.TopicConcealReq
;
import
com.tanpu.community.api.beans.req.topic.TopicModifyMountReq
;
import
com.tanpu.community.api.beans.req.topic.TopicTopReq
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -30,15 +26,31 @@ public class TopicController {
private
UserHolder
userHolder
;
@GetMapping
(
value
=
"/
queryTopicInfoL
ist"
)
@GetMapping
(
value
=
"/
l
ist"
)
@ApiOperation
(
"APP全部话题页面,可搜索"
)
@ResponseBody
public
CommonResp
<
List
<
TopicDTO
>>
getTopicBriefInfoList
(
){
List
<
TopicDTO
>
allTopic
=
topicManager
.
getAllTopicDetail
(
);
public
CommonResp
<
Page
<
TopicTitileQo
>>
getTopicBriefInfoList
(
TopicSearchReq
req
){
Page
<
TopicTitileQo
>
allTopic
=
topicManager
.
getAllTopicBriefInfo
(
req
);
return
CommonResp
.
success
(
allTopic
);
}
@GetMapping
(
value
=
"/hotThemes"
)
@ApiOperation
(
"话题详情页"
)
@ResponseBody
public
CommonResp
<
List
<
ThemeQo
>>
gethotThemes
(
@RequestParam
String
topicId
){
//todo
return
CommonResp
.
success
();
}
@GetMapping
(
value
=
"/latestThemes"
)
@ApiOperation
(
"话题详情页"
)
@ResponseBody
public
CommonResp
<
List
<
ThemeQo
>>
getlatestThemes
(
@RequestParam
String
topicId
){
//todo
return
CommonResp
.
success
();
}
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/ThemeEntity.java
View file @
c4ed5301
...
...
@@ -45,12 +45,6 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty
(
value
=
"文本内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"附件类型"
)
private
Integer
attachType
;
@ApiModelProperty
(
value
=
"附件内容"
)
private
String
attachment
;
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
...
...
@@ -107,22 +101,6 @@ public class ThemeEntity implements Serializable {
this
.
content
=
content
;
}
public
Integer
getAttachType
()
{
return
attachType
;
}
public
void
setAttachType
(
Integer
attachType
)
{
this
.
attachType
=
attachType
;
}
public
String
getAttachment
()
{
return
attachment
;
}
public
void
setAttachment
(
String
attachment
)
{
this
.
attachment
=
attachment
;
}
public
String
getAuthorId
()
{
return
authorId
;
}
...
...
@@ -179,8 +157,6 @@ public class ThemeEntity implements Serializable {
", title="
+
title
+
", themeType="
+
themeType
+
", content="
+
content
+
", attachType="
+
attachType
+
", attachment="
+
attachment
+
", authorId="
+
authorId
+
", formerThemeId="
+
formerThemeId
+
", topicId="
+
topicId
+
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/TopicEntity.java
View file @
c4ed5301
...
...
@@ -46,7 +46,7 @@ public class TopicEntity implements Serializable {
private
Integer
isConceal
;
@ApiModelProperty
(
value
=
"浏览量调整"
)
private
Long
view
AmountModify
;
private
Long
view
CntAdjust
;
private
LocalDateTime
createTime
;
...
...
@@ -95,12 +95,12 @@ public class TopicEntity implements Serializable {
this
.
isConceal
=
isConceal
;
}
public
Long
get
ViewAmountModify
()
{
return
view
AmountModify
;
public
Long
get
viewCntAdjust
()
{
return
view
CntAdjust
;
}
public
void
setViewAmountModify
(
Long
viewAmountModify
)
{
this
.
view
AmountModify
=
viewAmountModify
;
this
.
view
CntAdjust
=
viewAmountModify
;
}
public
LocalDateTime
getCreateTime
()
{
...
...
@@ -135,7 +135,7 @@ public class TopicEntity implements Serializable {
", topicTitle="
+
topicTitle
+
", isTop="
+
isTop
+
", isConceal="
+
isConceal
+
", viewAmountModify="
+
view
AmountModify
+
", viewAmountModify="
+
view
CntAdjust
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
...
...
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.HomePageEntity
;
import
com.tanpu.community.service.CollectionService
;
import
com.tanpu.community.service.CommentService
;
import
com.tanpu.community.service.HomePageService
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Set
;
@Service
public
class
CommentManager
{
@Autowired
private
CommentService
commentService
;
@Autowired
private
HomePageService
homePageService
;
@Autowired
private
CollectionService
collectionService
;
// 评论(对主题)
public
void
comment
(
CreateCommentReq
req
,
String
userId
)
{
CommentEntity
commentEntity
=
CommentEntity
.
builder
()
.
themeId
(
req
.
getThemeId
())
.
parentId
(
req
.
getParentId
())
.
replyId
(
req
.
getReplyId
())
.
authorId
(
userId
)
.
content
(
req
.
getComment
())
.
commentType
(
CommentTypeEnum
.
THEME
.
getCode
())
.
build
();
commentService
.
insertComment
(
commentEntity
);
}
public
List
<
CommentQo
>
queryComments
(
String
themeId
,
String
userId
)
{
List
<
CommentEntity
>
commentEntities
=
commentService
.
selectByThemeIdAndParentId
(
themeId
,
null
);
List
<
CommentQo
>
commentQos
=
ConvertUtil
.
commentEntity2Qos
(
commentEntities
);
Set
<
String
>
likeCommentList
=
collectionService
.
getListByUser
(
userId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
for
(
CommentQo
commentQo
:
commentQos
)
{
//用户信息
String
authorId
=
commentQo
.
getAuthorId
();
HomePageEntity
homePageEntity
=
homePageService
.
selectByUserId
(
authorId
);
commentQo
.
setUserImg
(
homePageEntity
.
getHeadImg
());
commentQo
.
setNickName
(
homePageEntity
.
getNickName
());
//是否点赞及点赞数
String
commentId
=
commentQo
.
getCommentId
();
if
(
likeCommentList
.
contains
(
commentId
)){
commentQo
.
setLiked
(
true
);
}
else
{
commentQo
.
setLiked
(
false
);
}
Integer
countByTypeAndId
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
commentQo
.
setLikeCount
(
countByTypeAndId
);
//二级评论,本期不上线
// List<CommentEntity> CommentLv2Entities = commentService.selectByThemeIdAndParentId(themeId, commentId);
// List<CommentLv2Qo> commentLv2Qos = ConvertUtil.commentLv2Entity2Qos(CommentLv2Entities);
// commentQo.setCommentLv2Qos(commentLv2Qos);
}
return
commentQos
;
}
}
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
c4ed5301
...
...
@@ -3,16 +3,18 @@ package com.tanpu.community.manager;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.community.api.beans.ForwardThemeReq
;
import
com.tanpu.community.api.beans.qo.
Com
mentQo
;
import
com.tanpu.community.api.beans.qo.
Attach
mentQo
;
import
com.tanpu.community.api.beans.qo.MainTextQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.CreateThemeReq
;
import
com.tanpu.community.api.beans.req.theme.ThemeListReq
;
import
com.tanpu.community.api.enums.BlockTypeEnum
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.api.enums.ThemeTypeEnum
;
import
com.tanpu.community.dao.entity.community.*
;
import
com.tanpu.community.dao.entity.community.BlackListEntity
;
import
com.tanpu.community.dao.entity.community.HomePageEntity
;
import
com.tanpu.community.dao.entity.community.ThemeAttachmentEntity
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.feign.course.FeignClientForCourse
;
import
com.tanpu.community.feign.course.vo.CourseDetailExt
;
import
com.tanpu.community.feign.product.FeignClientForProducts
;
...
...
@@ -100,7 +102,7 @@ public class ThemeManager {
}
// 返回推荐主题文章
public
List
<
ThemeQo
>
selectHotThemes
(
String
userId
)
{
public
List
<
ThemeQo
>
selectHotThemes
(
ThemeListReq
req
,
String
userId
)
{
// TODO:推荐
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectAll
();
List
<
ThemeQo
>
themeQos
=
convertEntityToQo
(
themeEntities
,
userId
);
...
...
@@ -109,7 +111,7 @@ public class ThemeManager {
// 返回关注主题
public
List
<
ThemeQo
>
selectInterestThemes
(
String
userId
)
{
public
List
<
ThemeQo
>
selectInterestThemes
(
ThemeListReq
req
,
String
userId
)
{
List
<
String
>
fansList
=
followRelService
.
queryFansByFollowerId
(
userId
);
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectByFans
(
fansList
);
List
<
ThemeQo
>
themeQos
=
convertEntityToQo
(
themeEntities
,
userId
);
...
...
@@ -131,23 +133,13 @@ public class ThemeManager {
// 点赞
public
void
like
(
String
themeId
,
String
userId
)
{
collectionService
.
addIfNotExist
(
themeId
,
userId
,
CollectionTypeEnum
.
LIKE
);
collectionService
.
addIfNotExist
(
themeId
,
userId
,
CollectionTypeEnum
.
LIKE
_THEME
);
}
public
void
unlike
(
String
themeId
,
String
userId
)
{
}
// 评论(对主题)
public
void
comment
(
CreateCommentReq
req
,
String
userId
)
{
CommentEntity
commentEntity
=
CommentEntity
.
builder
()
.
themeId
(
req
.
getThemeId
())
.
authorId
(
userId
)
.
content
(
req
.
getComment
())
.
commentType
(
CommentTypeEnum
.
THEME
.
getCode
())
.
build
();
commentService
.
insertComment
(
commentEntity
);
}
//转发
public
void
forward
(
ForwardThemeReq
req
,
String
userId
)
{
...
...
@@ -166,11 +158,11 @@ public class ThemeManager {
//收藏
public
void
favorite
(
String
themeId
,
String
userId
)
{
collectionService
.
addIfNotExist
(
themeId
,
userId
,
CollectionTypeEnum
.
BOOK
);
collectionService
.
addIfNotExist
(
themeId
,
userId
,
CollectionTypeEnum
.
BOOK
_THEME
);
}
public
void
unFavorite
(
String
themeId
,
String
userId
)
{
collectionService
.
delete
(
themeId
,
userId
,
CollectionTypeEnum
.
BOOK
);
collectionService
.
delete
(
themeId
,
userId
,
CollectionTypeEnum
.
BOOK
_THEME
);
}
//投诉(主题)
...
...
@@ -219,11 +211,12 @@ public class ThemeManager {
//组装主题列表
private
void
buildThemeQoExtraInfo
(
String
userId
,
ThemeQo
themeQO
)
{
//附件列表
List
<
ThemeAttachmentEntity
>
attachments
=
themeAttachmentService
.
selectByThemeId
(
themeQO
.
getId
());
String
themeId
=
themeQO
.
getThemeId
();
List
<
ThemeAttachmentEntity
>
attachments
=
themeAttachmentService
.
selectByThemeId
(
themeId
);
if
(!
CollectionUtils
.
isEmpty
(
attachments
))
{
HashMap
<
String
,
Object
>
attachmentQos
=
new
HashMap
<>(
);
attachments
.
forEach
(
o
->
attachmentQos
.
put
(
o
.
getAttachId
(),
transferAttachment
(
o
,
userId
))
);
themeQO
.
setAttachment
(
attachmentQos
);
ThemeAttachmentEntity
attachmentEntity
=
attachments
.
get
(
0
);
AttachmentQo
attachmentQo
=
AttachmentQo
.
builder
().
type
(
attachmentEntity
.
getAttachType
()).
attachment
(
transferAttachment
(
attachmentEntity
,
userId
)).
build
(
);
themeQO
.
setAttachment
Qo
(
attachmentQo
);
}
//迄今时间
themeQO
.
setUpToNowTime
(
calUpToNowTime
(
themeQO
.
getCreateTime
()));
...
...
@@ -235,10 +228,13 @@ public class ThemeManager {
HomePageEntity
userEntity
=
homePageService
.
selectByUserId
(
userId
);
themeQO
.
setUserImg
(
userEntity
.
getHeadImg
());
themeQO
.
setNickName
(
userEntity
.
getNickName
());
//热点数据 TODO 点赞量、评论量、转发量
themeQO
.
setCommentAmount
(
0L
);
themeQO
.
setLikeAmount
(
0L
);
themeQO
.
setForwardAmount
(
0L
);
//热点数据:点赞,收藏,转发
Integer
likeCount
=
collectionService
.
getCountByTypeAndId
(
themeId
,
CollectionTypeEnum
.
LIKE_THEME
);
Integer
bookCount
=
collectionService
.
getCountByTypeAndId
(
themeId
,
CollectionTypeEnum
.
BOOK_THEME
);
Integer
forwardCount
=
themeService
.
getForwardCountById
(
themeId
);
themeQO
.
setCommentCount
(
bookCount
);
themeQO
.
setLikeCount
(
likeCount
);
themeQO
.
setForwardCount
(
forwardCount
);
}
//组装正文详情
...
...
@@ -246,8 +242,11 @@ public class ThemeManager {
//附件列表
List
<
ThemeAttachmentEntity
>
attachments
=
themeAttachmentService
.
selectByThemeId
(
maintTextQo
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
attachments
))
{
HashMap
<
String
,
Object
>
attachmentQos
=
new
HashMap
<>();
attachments
.
forEach
(
o
->
attachmentQos
.
put
(
o
.
getAttachId
(),
transferAttachment
(
o
,
userId
)));
List
<
AttachmentQo
>
attachmentQos
=
new
ArrayList
<>();
attachments
.
forEach
(
o
->
attachmentQos
.
add
(
AttachmentQo
.
builder
()
.
type
(
o
.
getAttachType
())
.
attachment
(
transferAttachment
(
o
,
userId
))
.
build
()));
maintTextQo
.
setAttachment
(
attachmentQos
);
}
//迄今时间
...
...
@@ -256,16 +255,7 @@ public class ThemeManager {
HomePageEntity
author
=
homePageService
.
selectByUserId
(
userId
);
maintTextQo
.
setUserImg
(
author
.
getHeadImg
());
maintTextQo
.
setNickName
(
author
.
getNickName
());
//评论
List
<
CommentQo
>
commentQos
=
ConvertUtil
.
commentEntity2Qos
(
commentService
.
selectByTargetId
(
maintTextQo
.
getId
()));
for
(
CommentQo
comment
:
commentQos
)
{
HomePageEntity
commentor
=
homePageService
.
selectByUserId
(
comment
.
getAuthorId
());
comment
.
setUserImg
(
commentor
.
getHeadImg
());
comment
.
setNickName
(
commentor
.
getNickName
());
//TODO 评论点赞量
comment
.
setLikeAmount
(
0L
);
}
maintTextQo
.
setComments
(
commentQos
);
return
;
}
...
...
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
c4ed5301
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.community.api.beans.TopicBriefInfoDTO
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.api.beans.TopicDataAnalysDTO
;
import
com.tanpu.community.api.beans.qo.TopicTitileQo
;
import
com.tanpu.community.api.beans.req.topic.TopicSearchReq
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.constants.RedisKeyConstant
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.PageUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -37,7 +41,7 @@ public class TopicManager {
//新增话题
public
void
insertTopic
(
String
topicTitle
,
String
userId
)
{
if
(
topicService
.
queryByTitile
(
topicTitle
)
==
null
){
if
(
topicService
.
queryByTitile
(
topicTitle
)
==
null
)
{
topicService
.
addTopic
(
topicTitle
,
userId
);
}
return
;
...
...
@@ -51,15 +55,17 @@ public class TopicManager {
//话题简介列表
public
List
<
TopicBriefInfoDTO
>
getAllTopicBriefInfo
(
)
{
List
<
TopicEntity
>
allTopic
=
topicService
.
query
All
(
);
List
<
Topic
BriefInfoDTO
>
topicDTOS
=
ConvertUtil
.
topicEntitiesToBriefDTOs
(
allTopic
);
public
Page
<
TopicTitileQo
>
getAllTopicBriefInfo
(
TopicSearchReq
req
)
{
List
<
TopicEntity
>
allTopic
=
topicService
.
query
ByKeyword
(
req
.
getSearchKeyword
()
);
List
<
Topic
TitileQo
>
topicTitileQos
=
ConvertUtil
.
topicEntitiesToBriefDTOs
(
allTopic
);
//讨论数=发布主题贴数+回复总数
for
(
TopicBriefInfoDTO
topicDTO
:
topicDTOS
)
{
Long
discussAmount
=
redisService
.
getLong
(
RedisKeyConstant
.
TOPIC_DISCUSS_AMOUNT_
+
topicDTO
.
getTopicId
());
topicDTO
.
setDiscussionAmount
(
discussAmount
);
for
(
TopicTitileQo
topicQo
:
topicTitileQos
)
{
// Integer commentCountByThemeIds = commentService.getCommentCountByThemeIds(themeIds);
topicQo
.
setDiscussionCount
(
0
);
}
return
topicDTOS
;
return
PageUtils
.
page
(
req
.
getPage
(),
topicTitileQos
);
}
...
...
@@ -93,22 +99,22 @@ public class TopicManager {
throw
new
BizException
(
"找不到话题,id:"
+
topicId
);
}
TopicDTO
topicDTO
=
ConvertUtil
.
topicEntityToDTO
(
topicEntity
);
topicDTO
.
setView
Amount
(
redisService
.
getLong
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_AM
OUNT_
+
topicId
));
topicDTO
.
setLike
Amount
(
redisService
.
getLong
(
RedisKeyConstant
.
TOPIC_LIKE_AM
OUNT_
+
topicId
));
topicDTO
.
setUser
Amount
(
redisService
.
getLong
(
RedisKeyConstant
.
TOPIC_USER_AM
OUNT_
+
topicId
));
topicDTO
.
setView
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_C
OUNT_
+
topicId
));
topicDTO
.
setLike
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_LIKE_C
OUNT_
+
topicId
));
topicDTO
.
setUser
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_USER_C
OUNT_
+
topicId
));
return
topicDTO
;
}
public
void
modifyView
Am
ount
(
String
topicId
,
Long
modifyMount
)
{
public
void
modifyView
C
ount
(
String
topicId
,
Long
modifyMount
)
{
TopicEntity
topicEntity
=
topicService
.
queryById
(
topicId
);
if
(
topicEntity
==
null
)
{
throw
new
BizException
(
"找不到话题,id:"
+
topicId
);
}
topicService
.
modifyView
Am
ount
(
topicId
,
modifyMount
);
topicService
.
modifyView
C
ount
(
topicId
,
modifyMount
);
if
(
modifyMount
>
0
)
{
redisService
.
incr
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_
AM
OUNT_
+
topicId
,
modifyMount
);
redisService
.
incr
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_
C
OUNT_
+
topicId
,
modifyMount
);
}
else
{
redisService
.
decr
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_
AM
OUNT_
+
topicId
,
-
modifyMount
);
redisService
.
decr
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_
C
OUNT_
+
topicId
,
-
modifyMount
);
}
}
...
...
@@ -118,27 +124,27 @@ public class TopicManager {
List
<
TopicEntity
>
topicEntities
=
topicService
.
queryAll
();
for
(
TopicEntity
topic
:
topicEntities
)
{
String
topicId
=
topic
.
getTopicId
();
Long
view
AmountModify
=
topic
.
getViewAmountModify
();
Long
view
CountModify
=
topic
.
getviewCntAdjust
();
List
<
ThemeEntity
>
themeEntities
=
themeService
.
selectByTopic
(
topicId
);
List
<
String
>
themeIds
=
themeEntities
.
stream
().
map
(
ThemeEntity:
:
getThemeId
).
collect
(
Collectors
.
toList
());
Long
likeAmountByThemeIds
=
collectionService
.
getLikeAmountByThemeIds
(
themeIds
);
Long
bookAmountByThemeIds
=
collectionService
.
getBookAmountByThemeIds
(
themeIds
);
Long
comment
AmountByThemeIds
=
commentService
.
getCommentAm
ountByThemeIds
(
themeIds
);
Set
<
String
>
postUsers
=
themeService
.
getPostUser
Am
ount
(
themeIds
);
Set
<
String
>
commentUsers
=
commentService
.
getCommentUser
Am
ount
(
themeIds
);
Integer
likeCountByThemeIds
=
collectionService
.
getCountByTypeAndIds
(
themeIds
,
CollectionTypeEnum
.
LIKE_THEME
);
Integer
bookCountByThemeIds
=
collectionService
.
getCountByTypeAndIds
(
themeIds
,
CollectionTypeEnum
.
BOOK_THEME
);
Long
comment
CountByThemeIds
=
(
long
)
commentService
.
getCommentC
ountByThemeIds
(
themeIds
);
Set
<
String
>
postUsers
=
themeService
.
getPostUser
C
ount
(
themeIds
);
Set
<
String
>
commentUsers
=
commentService
.
getCommentUser
C
ount
(
themeIds
);
HashSet
<
String
>
totalUsers
=
new
HashSet
<>(
postUsers
);
totalUsers
.
addAll
(
commentUsers
);
redisService
.
set
(
RedisKeyConstant
.
TOPIC_LIKE_
AMOUNT_
+
topicId
,
likeAm
ountByThemeIds
);
redisService
.
set
(
RedisKeyConstant
.
TOPIC_BOOK_
AMOUNT_
+
topicId
,
bookAm
ountByThemeIds
);
redisService
.
set
(
RedisKeyConstant
.
TOPIC_COMMENT_
AMOUNT_
+
topicId
,
commentAm
ountByThemeIds
);
redisService
.
set
(
RedisKeyConstant
.
TOPIC_LIKE_
COUNT_
+
topicId
,
likeC
ountByThemeIds
);
redisService
.
set
(
RedisKeyConstant
.
TOPIC_BOOK_
COUNT_
+
topicId
,
bookC
ountByThemeIds
);
redisService
.
set
(
RedisKeyConstant
.
TOPIC_COMMENT_
COUNT_
+
topicId
,
commentC
ountByThemeIds
);
redisService
.
set
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_
AMOUNT_
+
topicId
,
commentAm
ountByThemeIds
+
themeIds
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_THEME_
AMOUNT_
+
topicId
,
commentAm
ountByThemeIds
+
themeIds
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_DISCUSS_
AMOUNT_
+
topicId
,
commentAm
ountByThemeIds
+
themeIds
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_POST_USER_
AM
OUNT_
+
topicId
,
(
long
)
postUsers
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_COMMENT_USER_
AM
OUNT_
+
topicId
,
(
long
)
commentUsers
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_TOTAL_USER_
AM
OUNT_
+
topicId
,
(
long
)
totalUsers
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_
COUNT_
+
topicId
,
commentC
ountByThemeIds
+
themeIds
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_THEME_
COUNT_
+
topicId
,
commentC
ountByThemeIds
+
themeIds
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_DISCUSS_
COUNT_
+
topicId
,
commentC
ountByThemeIds
+
themeIds
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_POST_USER_
C
OUNT_
+
topicId
,
(
long
)
postUsers
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_COMMENT_USER_
C
OUNT_
+
topicId
,
(
long
)
commentUsers
.
size
());
redisService
.
set
(
RedisKeyConstant
.
TOPIC_TOTAL_USER_
C
OUNT_
+
topicId
,
(
long
)
totalUsers
.
size
());
}
...
...
@@ -155,13 +161,13 @@ public class TopicManager {
this
.
refreshRedisCache
();
topicDataAnalysDTO
.
setId
(
topicId
);
topicDataAnalysDTO
.
setTopicTitle
(
topicEntity
.
getTopicTitle
());
topicDataAnalysDTO
.
setComment
Amount
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_COMMENT_AM
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setPoster
Amount
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_POST_USER_AM
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setReplIier
Amount
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_COMMENT_USER_AM
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setTheme
Amount
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_THEME_AM
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setUserTotal
Amount
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_TOTAL_USER_AM
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setViewTotal
Amount
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_AM
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setViewPage
Amount
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_PAGE_VIEW_AM
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setComment
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_COMMENT_C
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setPoster
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_POST_USER_C
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setReplIier
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_COMMENT_USER_C
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setTheme
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_THEME_C
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setUserTotal
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_TOTAL_USER_C
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setViewTotal
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_TOTAL_VIEW_C
OUNT_
+
topicId
));
topicDataAnalysDTO
.
setViewPage
Count
(
redisService
.
getInteger
(
RedisKeyConstant
.
TOPIC_PAGE_VIEW_C
OUNT_
+
topicId
));
return
topicDataAnalysDTO
;
}
}
...
...
community-service/src/main/java/com/tanpu/community/service/CollectionService.java
View file @
c4ed5301
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.common.
uuid.UuidGenHelper
;
import
com.tanpu.common.
exception.BizException
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.community.CollectionEntity
;
import
com.tanpu.community.dao.mapper.community.CollectionMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@Service
public
class
CollectionService
{
...
...
@@ -46,7 +47,7 @@ public class CollectionService {
.
eq
(
CollectionEntity:
:
getCollectionType
,
type
.
getCode
())
.
eq
(
CollectionEntity:
:
getUserId
,
userId
)
.
eq
(
CollectionEntity:
:
getTargetId
,
themeId
)
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
}
//根据用户、主题、类型查询已删除对象
...
...
@@ -55,60 +56,34 @@ public class CollectionService {
.
eq
(
CollectionEntity:
:
getCollectionType
,
type
.
getCode
())
.
eq
(
CollectionEntity:
:
getUserId
,
userId
)
.
eq
(
CollectionEntity:
:
getTargetId
,
themeId
)
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
DELETED
.
getCode
()));
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
DELETED
.
getCode
()));
}
// 根据用户id
获取点赞
列表
public
List
<
CollectionEntity
>
getLikeListByUser
(
String
userId
)
{
// 根据用户id
和行为type获取target_id
列表
public
Set
<
String
>
getListByUser
(
String
userId
,
CollectionTypeEnum
type
)
{
return
collectionMapper
.
selectList
(
new
LambdaQueryWrapper
<
CollectionEntity
>()
.
eq
(
CollectionEntity:
:
getCollectionType
,
CollectionTypeEnum
.
LIKE
.
getCode
())
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
.
eq
(
CollectionEntity:
:
getCollectionType
,
type
.
getCode
())
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
.
stream
().
map
(
CollectionEntity:
:
getTargetId
).
collect
(
Collectors
.
toSet
());
}
// 根据用户id获取收藏列表
public
List
<
CollectionEntity
>
getBookListByUser
(
String
userId
)
{
return
collectionMapper
.
selectList
(
new
LambdaQueryWrapper
<
CollectionEntity
>()
.
eq
(
CollectionEntity:
:
getCollectionType
,
CollectionTypeEnum
.
BOOK
.
getCode
())
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
}
// 统计单个主题的点赞量
public
Long
getLikeAmountByThemeId
(
String
themeId
)
{
return
(
long
)
collectionMapper
.
selectList
((
new
LambdaQueryWrapper
<
CollectionEntity
>()
.
eq
(
CollectionEntity:
:
getTargetId
,
themeId
)
.
eq
(
CollectionEntity:
:
getCollectionType
,
CollectionTypeEnum
.
LIKE
.
getCode
())
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
())))
.
size
();
// 统计单个主题的数量
public
Integer
getCountByTypeAndId
(
String
targetId
,
CollectionTypeEnum
type
)
{
return
collectionMapper
.
selectCount
((
new
LambdaQueryWrapper
<
CollectionEntity
>()
.
eq
(
CollectionEntity:
:
getTargetId
,
targetId
)
.
eq
(
CollectionEntity:
:
getCollectionType
,
type
.
getCode
())
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
())));
}
// 统计多个主题的点赞量
public
Long
getLikeAmountByThemeIds
(
List
<
String
>
themeIds
)
{
return
(
long
)
collectionMapper
.
selectLis
t
((
new
LambdaQueryWrapper
<
CollectionEntity
>()
public
Integer
getCountByTypeAndIds
(
List
<
String
>
themeIds
,
CollectionTypeEnum
type
)
{
return
collectionMapper
.
selectCoun
t
((
new
LambdaQueryWrapper
<
CollectionEntity
>()
.
in
(
CollectionEntity:
:
getTargetId
,
themeIds
)
.
eq
(
CollectionEntity:
:
getCollectionType
,
CollectionTypeEnum
.
LIKE
.
getCode
()))
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
.
size
();
}
//统计单个主题的收藏量
public
Long
getBookAmountByThemeId
(
String
themeId
)
{
return
(
long
)
collectionMapper
.
selectList
((
new
LambdaQueryWrapper
<
CollectionEntity
>()
.
eq
(
CollectionEntity:
:
getTargetId
,
themeId
)
.
eq
(
CollectionEntity:
:
getCollectionType
,
CollectionTypeEnum
.
BOOK
.
getCode
()))
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
.
size
();
}
//统计多个主题的收藏量
public
Long
getBookAmountByThemeIds
(
List
<
String
>
themeIds
)
{
return
(
long
)
collectionMapper
.
selectList
((
new
LambdaQueryWrapper
<
CollectionEntity
>()
.
in
(
CollectionEntity:
:
getTargetId
,
themeIds
)
.
eq
(
CollectionEntity:
:
getCollectionType
,
CollectionTypeEnum
.
BOOK
.
getCode
()))
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
.
size
();
.
eq
(
CollectionEntity:
:
getCollectionType
,
type
.
getCode
()))
.
eq
(
CollectionEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
}
//逻辑删除,修改delete_tag
public
void
delete
(
String
themeId
,
String
userId
,
CollectionTypeEnum
type
)
{
CollectionEntity
queryCollection
=
getTargetCollection
(
themeId
,
userId
,
type
);
...
...
@@ -116,6 +91,8 @@ public class CollectionService {
queryCollection
.
setDeleteTag
(
DeleteTagEnum
.
DELETED
.
getCode
());
queryCollection
.
setUncollectionTime
(
LocalDateTime
.
now
());
collectionMapper
.
updateById
(
queryCollection
);
}
else
{
throw
new
BizException
(
"Collection对象未找到,themeId:"
+
themeId
+
",userId:"
+
userId
+
",type:"
+
type
.
getCode
());
}
}
}
community-service/src/main/java/com/tanpu/community/service/CommentService.java
View file @
c4ed5301
...
...
@@ -34,23 +34,30 @@ public class CommentService {
}
//统计主题集合的评论量
public
Long
getCommentAm
ountByThemeIds
(
List
<
String
>
themeIds
)
{
return
(
long
)
commentMapper
.
selectList
((
new
LambdaQueryWrapper
<
CommentEntity
>()
public
Integer
getCommentC
ountByThemeIds
(
List
<
String
>
themeIds
)
{
return
commentMapper
.
selectList
((
new
LambdaQueryWrapper
<
CommentEntity
>()
.
in
(
CommentEntity:
:
getThemeId
,
themeIds
)))
.
size
();
}
public
Set
<
String
>
getCommentUser
Am
ount
(
List
<
String
>
themeIds
)
{
public
Set
<
String
>
getCommentUser
C
ount
(
List
<
String
>
themeIds
)
{
return
commentMapper
.
selectList
((
new
LambdaQueryWrapper
<
CommentEntity
>()
.
in
(
CommentEntity:
:
getThemeId
,
themeIds
)))
.
stream
().
map
(
CommentEntity:
:
getAuthorId
).
collect
(
Collectors
.
toSet
());
}
public
List
<
CommentEntity
>
selectByTargetId
(
String
id
)
{
return
commentMapper
.
selectList
(
new
LambdaQueryWrapper
<
CommentEntity
>()
public
List
<
CommentEntity
>
selectByThemeIdAndParentId
(
String
themeId
,
String
parentId
)
{
LambdaQueryWrapper
<
CommentEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<
CommentEntity
>()
.
eq
(
CommentEntity:
:
getThemeId
,
themeId
)
.
eq
(
CommentEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
())
.
eq
(
CommentEntity:
:
getIsBlock
,
TopicStatusEnum
.
FALSE
.
getCode
())
.
orderByDesc
(
CommentEntity:
:
getCreateTime
));
.
orderByDesc
(
CommentEntity:
:
getCreateTime
);
if
(
parentId
==
null
)
{
queryWrapper
.
isNull
(
CommentEntity:
:
getParentId
);
}
else
{
queryWrapper
.
eq
(
CommentEntity:
:
getParentId
,
parentId
);
}
return
commentMapper
.
selectList
(
queryWrapper
);
}
...
...
community-service/src/main/java/com/tanpu/community/service/HomePageService.java
View file @
c4ed5301
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.comm
on.uuid.UuidGenHelper
;
import
com.tanpu.comm
unity.api.enums.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.community.HomePageEntity
;
import
com.tanpu.community.dao.mapper.community.HomePageMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -20,17 +19,20 @@ public class HomePageService {
private
HomePageMapper
homePageMapper
;
public
HomePageEntity
selectByUserId
(
String
userId
){
public
HomePageEntity
selectByUserId
(
String
userId
)
{
return
homePageMapper
.
selectOne
(
new
LambdaQueryWrapper
<
HomePageEntity
>()
.
eq
(
HomePageEntity:
:
getUserId
,
userId
));
.
eq
(
HomePageEntity:
:
getUserId
,
userId
)
.
eq
(
HomePageEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
}
public
List
<
HomePageEntity
>
selectListByUserIds
(
List
<
String
>
userIds
){
if
(
CollectionUtils
.
isEmpty
(
userIds
)){
public
List
<
HomePageEntity
>
selectListByUserIds
(
List
<
String
>
userIds
)
{
if
(
CollectionUtils
.
isEmpty
(
userIds
))
{
return
Collections
.
emptyList
();
}
return
homePageMapper
.
selectList
(
new
LambdaQueryWrapper
<
HomePageEntity
>()
.
in
(
HomePageEntity:
:
getUserId
,
userIds
));
.
eq
(
HomePageEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
())
.
in
(
HomePageEntity:
:
getUserId
,
userIds
));
}
public
void
update
(
HomePageEntity
entity
)
{
...
...
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
View file @
c4ed5301
...
...
@@ -2,6 +2,7 @@ package com.tanpu.community.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.common.uuid.UuidGenHelper
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.mapper.community.ThemeMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -51,9 +52,15 @@ public class ThemeService {
}
//查询对应话题的发表用户集合
public
Set
<
String
>
getPostUser
Am
ount
(
List
<
String
>
themeIds
)
{
public
Set
<
String
>
getPostUser
C
ount
(
List
<
String
>
themeIds
)
{
return
themeMapper
.
selectBatchIds
(
themeIds
).
stream
()
.
map
(
ThemeEntity:
:
getAuthorId
)
.
collect
(
Collectors
.
toSet
());
}
public
Integer
getForwardCountById
(
String
themeId
)
{
return
themeMapper
.
selectCount
(
new
LambdaQueryWrapper
<
ThemeEntity
>()
.
eq
(
ThemeEntity:
:
getThemeId
,
themeId
)
.
eq
(
ThemeEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
));
}
}
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
c4ed5301
...
...
@@ -30,6 +30,12 @@ public class TopicService {
.
eq
(
TopicEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
}
public
List
<
TopicEntity
>
queryByKeyword
(
String
keyword
)
{
return
topicMapper
.
selectList
(
new
LambdaQueryWrapper
<
TopicEntity
>()
.
like
(
TopicEntity:
:
getTopicTitle
,
keyword
)
.
eq
(
TopicEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()));
}
public
void
addTopic
(
String
topicTitle
,
String
userId
)
{
TopicEntity
entity
=
TopicEntity
.
builder
()
...
...
@@ -75,12 +81,12 @@ public class TopicService {
return
topicMapper
.
selectById
(
topicId
);
}
public
void
modifyView
Amount
(
String
topicId
,
long
am
ount
)
{
public
void
modifyView
Count
(
String
topicId
,
long
C
ount
)
{
TopicEntity
topicEntity
=
topicMapper
.
selectById
(
topicId
);
Long
old
Amount
=
topicEntity
.
getViewAmountModify
();
topicEntity
.
setViewAmountModify
(
topicEntity
.
get
ViewAmountModify
()
+
am
ount
);
Long
old
Count
=
topicEntity
.
getviewCntAdjust
();
topicEntity
.
setViewAmountModify
(
topicEntity
.
get
viewCntAdjust
()
+
C
ount
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>()
.
eq
(
TopicEntity:
:
get
ViewAmountModify
,
oldAm
ount
));
.
eq
(
TopicEntity:
:
get
viewCntAdjust
,
oldC
ount
));
return
;
}
...
...
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
c4ed5301
package
com
.
tanpu
.
community
.
util
;
import
com.tanpu.community.api.beans.
TopicBriefInfoDTO
;
import
com.tanpu.community.api.beans.
qo.TopicTitileQo
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.api.beans.qo.CommentLv2Qo
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.FollowQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
...
...
@@ -46,10 +47,10 @@ public class ConvertUtil {
return
topicDTO
;
}
public
static
Topic
BriefInfoDTO
topicToBriefInfoDTO
(
TopicEntity
topicEntity
)
{
Topic
BriefInfoDTO
topicBriefInfoDTO
=
new
TopicBriefInfoDTO
();
BeanUtils
.
copyProperties
(
topicEntity
,
topic
BriefInfoDTO
);
return
topic
BriefInfoDTO
;
public
static
Topic
TitileQo
topicToBriefInfoDTO
(
TopicEntity
topicEntity
)
{
Topic
TitileQo
topicTitileQo
=
new
TopicTitileQo
();
BeanUtils
.
copyProperties
(
topicEntity
,
topic
TitileQo
);
return
topic
TitileQo
;
}
public
static
CommentQo
commentEntity2Qo
(
CommentEntity
entity
)
{
CommentQo
qo
=
new
CommentQo
();
...
...
@@ -61,16 +62,27 @@ public class ConvertUtil {
return
entities
.
stream
().
map
(
ConvertUtil:
:
commentEntity2Qo
).
collect
(
Collectors
.
toList
());
}
public
static
CommentLv2Qo
commentLv2Entity2Qo
(
CommentEntity
entity
)
{
CommentLv2Qo
qo
=
new
CommentLv2Qo
();
BeanUtils
.
copyProperties
(
entity
,
qo
);
return
qo
;
}
public
static
List
<
CommentLv2Qo
>
commentLv2Entity2Qos
(
List
<
CommentEntity
>
entities
){
return
entities
.
stream
().
map
(
ConvertUtil:
:
commentLv2Entity2Qo
).
collect
(
Collectors
.
toList
());
}
public
static
List
<
TopicDTO
>
topicEntitiesToDTOs
(
List
<
TopicEntity
>
topicEntities
)
{
return
topicEntities
.
stream
().
map
(
ConvertUtil:
:
topicEntityToDTO
).
collect
(
Collectors
.
toList
());
}
public
static
List
<
Topic
BriefInfoDTO
>
topicEntitiesToBriefDTOs
(
List
<
TopicEntity
>
topicEntities
)
{
public
static
List
<
Topic
TitileQo
>
topicEntitiesToBriefDTOs
(
List
<
TopicEntity
>
topicEntities
)
{
return
topicEntities
.
stream
().
map
(
ConvertUtil:
:
topicToBriefInfoDTO
).
collect
(
Collectors
.
toList
());
}
public
static
DeleteTagEnum
deleteTagShift
(
DeleteTagEnum
deleteTagEnum
)
{
if
(
deleteTagEnum
.
getCode
().
equals
(
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
{
return
DeleteTagEnum
.
DELETED
;
...
...
community-service/src/main/java/com/tanpu/community/util/PageUtils.java
0 → 100644
View file @
c4ed5301
package
com
.
tanpu
.
community
.
util
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.page.Pageable
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author: zhoupeng
* @email: zhoupeng@wealthgrow.cn
*/
public
class
PageUtils
{
public
static
<
T
>
Page
<
T
>
page
(
Pageable
pageable
,
List
<
T
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
new
Page
<>(
pageable
,
0L
,
new
ArrayList
<>());
}
else
{
// 记录总数
Integer
count
=
list
.
size
();
// 页数
int
pageCount
;
if
(
count
%
pageable
.
getPageSize
()
==
0
)
{
pageCount
=
count
/
pageable
.
getPageSize
();
}
else
{
pageCount
=
count
/
pageable
.
getPageSize
()
+
1
;
}
// 开始索引
int
fromIndex
;
// 结束索引
int
toIndex
;
// 防止索引越界
if
(
Integer
.
getInteger
(
"0"
).
equals
(
pageable
.
getPageNumber
()))
{
pageable
.
setPageNumber
(
1
);
}
if
(!
pageable
.
getPageNumber
().
equals
(
pageCount
))
{
fromIndex
=
(
pageable
.
getPageNumber
()
-
1
)
*
pageable
.
getPageSize
();
toIndex
=
fromIndex
+
pageable
.
getPageSize
();
}
else
{
fromIndex
=
(
pageable
.
getPageNumber
()
-
1
)
*
pageable
.
getPageSize
();
toIndex
=
count
;
}
if
(
pageable
.
getPageSize
()
*
(
pageable
.
getPageNumber
()
-
1
)
>=
list
.
size
())
{
return
new
Page
<>(
pageable
,
0L
,
new
ArrayList
<>());
}
else
{
Page
<
T
>
tPage
=
new
Page
<>(
pageable
,
(
long
)
list
.
size
(),
new
ArrayList
<>(
list
).
subList
(
fromIndex
,
toIndex
));
int
totalPage
=
list
.
size
()
/
pageable
.
getPageSize
();
if
(
list
.
size
()
%
pageable
.
getPageSize
()
==
0
)
{
tPage
.
setTotalPages
(
totalPage
);
}
else
{
tPage
.
setTotalPages
(
totalPage
+
1
);
}
return
tPage
;
}
}
}
}
community-service/src/main/resources/mapper/community/ThemeEntityMapper.xml
View file @
c4ed5301
...
...
@@ -9,8 +9,6 @@
<result
column=
"title"
property=
"title"
/>
<result
column=
"theme_type"
property=
"themeType"
/>
<result
column=
"content"
property=
"content"
/>
<result
column=
"attach_type"
property=
"attachType"
/>
<result
column=
"attachment"
property=
"attachment"
/>
<result
column=
"author_id"
property=
"authorId"
/>
<result
column=
"former_theme_id"
property=
"formerThemeId"
/>
<result
column=
"topic_id"
property=
"topicId"
/>
...
...
community-service/src/main/resources/mapper/community/TopicEntityMapper.xml
View file @
c4ed5301
...
...
@@ -9,7 +9,7 @@
<result
column=
"topic_title"
property=
"topicTitle"
/>
<result
column=
"is_top"
property=
"isTop"
/>
<result
column=
"is_conceal"
property=
"isConceal"
/>
<result
column=
"view_
amount_modify"
property=
"viewAmountModify
"
/>
<result
column=
"view_
cnt_adjust"
property=
"viewCntAdjust
"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"delete_tag"
property=
"deleteTag"
/>
...
...
docs/create.sql
View file @
c4ed5301
...
...
@@ -80,7 +80,7 @@ CREATE TABLE `comment` (
CREATE
TABLE
`collection`
(
`id`
int
(
32
)
auto_increment
PRIMARY
KEY
COMMENT
'id'
,
`collection_type`
int
(
4
)
NOT
NULL
COMMENT
'类型,
1:点赞,2:收藏
'
,
`collection_type`
int
(
4
)
NOT
NULL
COMMENT
'类型,
类型 1:点赞主题,2:收藏主题 3:点赞评论
'
,
`user_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`target_id`
varchar
(
64
)
NOT
NULL
COMMENT
'评论的目标id'
,
`collection_time`
datetime
COMMENT
'收藏时间'
,
...
...
@@ -99,7 +99,7 @@ CREATE TABLE `topic` (
`topic_title`
varchar
(
64
)
NOT
NULL
COMMENT
'话题名称'
,
`is_top`
int
(
4
)
NOT
NULL
COMMENT
'是否置顶'
,
`is_conceal`
int
(
4
)
NOT
NULL
COMMENT
'是否隐藏'
,
`view_
amount_modify
`
bigint
NOT
NULL
DEFAULT
0
COMMENT
'浏览量调整'
,
`view_
cnt_adjust
`
bigint
NOT
NULL
DEFAULT
0
COMMENT
'浏览量调整'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
...
...
pom.xml
View file @
c4ed5301
...
...
@@ -169,6 +169,12 @@
<version>
1.7.0
</version>
</dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
1.2.13
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
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