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
56768478
Commit
56768478
authored
Feb 18, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.3.1' into 'dev'
V2.3.1 See merge request
!45
parents
ce909d9e
3617c248
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
170 additions
and
23 deletions
+170
-23
CommentQo.java
...main/java/com/tanpu/community/api/beans/qo/CommentQo.java
+7
-0
TopicAttachement.java
...va/com/tanpu/community/api/beans/qo/TopicAttachement.java
+23
-0
TopicPageDetailQo.java
...a/com/tanpu/community/api/beans/qo/TopicPageDetailQo.java
+45
-0
TopicRankQo.java
...in/java/com/tanpu/community/api/beans/qo/TopicRankQo.java
+3
-0
CreateCommentReq.java
...npu/community/api/beans/req/comment/CreateCommentReq.java
+10
-5
TopicController.java
.../java/com/tanpu/community/controller/TopicController.java
+3
-3
CodeAutoGenerator.java
.../main/java/com/tanpu/community/dao/CodeAutoGenerator.java
+1
-1
CommentEntity.java
...m/tanpu/community/dao/entity/community/CommentEntity.java
+13
-1
CommentMapper.java
...m/tanpu/community/dao/mapper/community/CommentMapper.java
+1
-1
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+36
-8
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+6
-1
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+8
-0
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+12
-2
CommentEntityMapper.xml
...c/main/resources/mapper/community/CommentEntityMapper.xml
+1
-0
TopicFollowRelEntityMapper.xml
...resources/mapper/community/TopicFollowRelEntityMapper.xml
+1
-1
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/CommentQo.java
View file @
56768478
...
@@ -23,6 +23,12 @@ public class CommentQo {
...
@@ -23,6 +23,12 @@ public class CommentQo {
@ApiModelProperty
(
value
=
"作者id"
)
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
private
String
authorId
;
@ApiModelProperty
(
value
=
"回复对象的用户id,根据这个来判断是否有回复对象"
)
private
String
replyUserId
;
@ApiModelProperty
(
value
=
"回复对象的用户名"
)
private
String
replyUserName
;
@ApiModelProperty
(
value
=
"点赞次数"
)
@ApiModelProperty
(
value
=
"点赞次数"
)
private
Integer
likeCount
;
private
Integer
likeCount
;
...
@@ -44,6 +50,7 @@ public class CommentQo {
...
@@ -44,6 +50,7 @@ public class CommentQo {
@ApiModelProperty
(
value
=
"是否讨论区管理员"
)
@ApiModelProperty
(
value
=
"是否讨论区管理员"
)
private
boolean
isManager
;
private
boolean
isManager
;
// 认证标签相关
// 认证标签相关
@ApiModelProperty
(
"认证标签用-用户等级体系 0 游客 1注册用户 10投资人 20 探普理顾 30 探普专家理顾 40 交易理财师 50 首席投顾"
)
@ApiModelProperty
(
"认证标签用-用户等级体系 0 游客 1注册用户 10投资人 20 探普理顾 30 探普专家理顾 40 交易理财师 50 首席投顾"
)
private
Integer
levelGrade
;
private
Integer
levelGrade
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicAttachement.java
0 → 100644
View file @
56768478
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@ApiModel
(
value
=
"主题关联产品"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
TopicAttachement
{
@ApiModelProperty
(
value
=
"RelTypeEnum类型,108:文本,88:产品 3:直播 6:短视频 303:新版课程-音频,304: 新版课程-视频,109:单图(长文) 110:多图(讨论)"
)
private
String
type
;
@ApiModelProperty
(
value
=
"对象详情"
)
private
AttachmentDetailVo
detail
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicPageDetailQo.java
0 → 100644
View file @
56768478
package
com
.
tanpu
.
community
.
api
.
beans
.
qo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
"热点话题对象"
)
public
class
TopicPageDetailQo
{
@ApiModelProperty
(
value
=
"话题ID"
)
private
String
topicId
;
@ApiModelProperty
(
value
=
"话题名称"
)
private
String
topicTitle
;
@ApiModelProperty
(
value
=
"阅读量"
)
private
Integer
viewCount
;
@ApiModelProperty
(
value
=
"讨论量"
)
private
Integer
disscussCount
;
@ApiModelProperty
(
value
=
"阅读量-格式化"
)
private
String
formatViewCount
;
@ApiModelProperty
(
value
=
"讨论量-格式化"
)
private
String
formatDisscussCount
;
@ApiModelProperty
(
value
=
"话题介绍"
)
private
String
topicDesc
;
@ApiModelProperty
(
value
=
"封面"
)
private
String
coverImg
;
@ApiModelProperty
(
value
=
"是否专属 0否,1是"
)
private
Integer
specialPermission
;
@ApiModelProperty
(
value
=
"是否有权限"
)
private
boolean
hasPermission
;
@ApiModelProperty
(
value
=
"关联产品"
)
private
List
<
TopicAttachement
>
attachments
;
}
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicRankQo.java
View file @
56768478
...
@@ -48,6 +48,9 @@ public class TopicRankQo {
...
@@ -48,6 +48,9 @@ public class TopicRankQo {
@ApiModelProperty
(
value
=
"是否专属 0否,1是"
)
@ApiModelProperty
(
value
=
"是否专属 0否,1是"
)
private
Integer
specialPermission
;
private
Integer
specialPermission
;
@ApiModelProperty
(
value
=
"是否有权限"
)
private
boolean
hasPermission
;
private
Integer
minutesTillNow
;
private
Integer
minutesTillNow
;
private
Double
score
;
private
Double
score
;
...
...
community-api/src/main/java/com/tanpu/community/api/beans/req/comment/CreateCommentReq.java
View file @
56768478
...
@@ -14,11 +14,6 @@ public class CreateCommentReq {
...
@@ -14,11 +14,6 @@ public class CreateCommentReq {
@ApiModelProperty
(
value
=
"主题Id"
)
@ApiModelProperty
(
value
=
"主题Id"
)
private
String
themeId
;
private
String
themeId
;
@ApiModelProperty
(
value
=
"一级评论id(对主题的一级评论,此项为空)"
)
private
String
parentId
;
@ApiModelProperty
(
value
=
"回复对象的id(非对评论回复时,此项为空)"
)
private
String
replyId
;
@NotBlank
(
message
=
"评论内容不能为空"
)
@NotBlank
(
message
=
"评论内容不能为空"
)
@ApiModelProperty
(
value
=
"评论内容"
)
@ApiModelProperty
(
value
=
"评论内容"
)
...
@@ -27,4 +22,14 @@ public class CreateCommentReq {
...
@@ -27,4 +22,14 @@ public class CreateCommentReq {
@ApiModelProperty
(
value
=
"同步转发,1 同步 ,0 不同步(默认)"
)
@ApiModelProperty
(
value
=
"同步转发,1 同步 ,0 不同步(默认)"
)
private
int
syncForward
=
0
;
private
int
syncForward
=
0
;
@ApiModelProperty
(
value
=
"回复对象的commentId(非对评论回复时,此项为空)"
)
private
String
replyId
;
@ApiModelProperty
(
value
=
"回复对象的userid"
)
private
String
replyUserId
;
@ApiModelProperty
(
value
=
"一级评论id(对主题的一级评论,此项为空,目前未使用)"
)
private
String
parentId
;
}
}
community-service/src/main/java/com/tanpu/community/controller/TopicController.java
View file @
56768478
...
@@ -51,7 +51,7 @@ public class TopicController {
...
@@ -51,7 +51,7 @@ public class TopicController {
}
}
@GetMapping
(
value
=
"/detailPage"
)
@GetMapping
(
value
=
"/detailPage"
)
@ApiOperation
(
"话题详情页
顶部
"
)
@ApiOperation
(
"话题详情页"
)
public
CommonResp
<
TopicRankQo
>
getDetail
(
@RequestParam
String
topicId
)
{
public
CommonResp
<
TopicRankQo
>
getDetail
(
@RequestParam
String
topicId
)
{
return
topicManager
.
getDetail
(
topicId
);
return
topicManager
.
getDetail
(
topicId
);
}
}
...
@@ -66,9 +66,9 @@ public class TopicController {
...
@@ -66,9 +66,9 @@ public class TopicController {
@AuthLogin
@AuthLogin
@PostMapping
(
value
=
"/follow"
)
@PostMapping
(
value
=
"/follow"
)
@ApiOperation
(
"
首页顶部话题标题列
"
)
@ApiOperation
(
"
关注话题(讨论区)
"
)
public
CommonResp
<
Void
>
follow
(
@RequestBody
FollowTopicReq
req
)
{
public
CommonResp
<
Void
>
follow
(
@RequestBody
FollowTopicReq
req
)
{
topicManager
.
follow
(
req
,
userHolder
.
getUserId
());
topicManager
.
follow
Topic
(
req
,
userHolder
.
getUserId
());
return
CommonResp
.
success
();
return
CommonResp
.
success
();
}
}
...
...
community-service/src/main/java/com/tanpu/community/dao/CodeAutoGenerator.java
View file @
56768478
...
@@ -23,7 +23,7 @@ public class CodeAutoGenerator {
...
@@ -23,7 +23,7 @@ public class CodeAutoGenerator {
String
mysqlPassword
=
"@imeng123"
;
String
mysqlPassword
=
"@imeng123"
;
String
jdbcUrl
=
"jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community"
;
String
jdbcUrl
=
"jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community"
;
// String[] tables = new String[]{"theme"};
// String[] tables = new String[]{"theme"};
String
[]
tables
=
new
String
[]{
"
topic_follow_rel
"
};
String
[]
tables
=
new
String
[]{
"
comment
"
};
String
basePackage
=
"com.tanpu.community"
;
String
basePackage
=
"com.tanpu.community"
;
String
mapperPackage
=
"dao.mapper.community"
;
String
mapperPackage
=
"dao.mapper.community"
;
String
entityPackage
=
"dao.entity.community"
;
String
entityPackage
=
"dao.entity.community"
;
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/CommentEntity.java
View file @
56768478
...
@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
...
@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
* </p>
* </p>
*
*
* @author xudong
* @author xudong
* @since 202
1-07-2
8
* @since 202
2-02-1
8
*/
*/
@TableName
(
"comment"
)
@TableName
(
"comment"
)
@ApiModel
(
value
=
"CommentEntity对象"
,
description
=
"评论"
)
@ApiModel
(
value
=
"CommentEntity对象"
,
description
=
"评论"
)
...
@@ -54,6 +54,9 @@ public class CommentEntity implements Serializable {
...
@@ -54,6 +54,9 @@ public class CommentEntity implements Serializable {
@ApiModelProperty
(
value
=
"回复评论id"
)
@ApiModelProperty
(
value
=
"回复评论id"
)
private
String
replyId
;
private
String
replyId
;
@ApiModelProperty
(
value
=
"回复对象的用户id"
)
private
String
replyUserId
;
@ApiModelProperty
(
value
=
"审核状态 0:初始值 1:已通过(管理后台使用)"
)
@ApiModelProperty
(
value
=
"审核状态 0:初始值 1:已通过(管理后台使用)"
)
private
Integer
reviewStatus
;
private
Integer
reviewStatus
;
...
@@ -131,6 +134,14 @@ public class CommentEntity implements Serializable {
...
@@ -131,6 +134,14 @@ public class CommentEntity implements Serializable {
this
.
replyId
=
replyId
;
this
.
replyId
=
replyId
;
}
}
public
String
getReplyUserId
()
{
return
replyUserId
;
}
public
void
setReplyUserId
(
String
replyUserId
)
{
this
.
replyUserId
=
replyUserId
;
}
public
Integer
getReviewStatus
()
{
public
Integer
getReviewStatus
()
{
return
reviewStatus
;
return
reviewStatus
;
}
}
...
@@ -182,6 +193,7 @@ public class CommentEntity implements Serializable {
...
@@ -182,6 +193,7 @@ public class CommentEntity implements Serializable {
", themeId="
+
themeId
+
", themeId="
+
themeId
+
", parentId="
+
parentId
+
", parentId="
+
parentId
+
", replyId="
+
replyId
+
", replyId="
+
replyId
+
", replyUserId="
+
replyUserId
+
", reviewStatus="
+
reviewStatus
+
", reviewStatus="
+
reviewStatus
+
", reportStatus="
+
reportStatus
+
", reportStatus="
+
reportStatus
+
", createTime="
+
createTime
+
", createTime="
+
createTime
+
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/CommentMapper.java
View file @
56768478
...
@@ -16,7 +16,7 @@ import java.util.List;
...
@@ -16,7 +16,7 @@ import java.util.List;
* </p>
* </p>
*
*
* @author xudong
* @author xudong
* @since 202
1-07-22
* @since 202
2-02-18
*/
*/
public
interface
CommentMapper
extends
BaseMapper
<
CommentEntity
>
{
public
interface
CommentMapper
extends
BaseMapper
<
CommentEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
56768478
...
@@ -11,6 +11,7 @@ import com.tanpu.community.api.beans.req.topic.TopicSearchReq;
...
@@ -11,6 +11,7 @@ import com.tanpu.community.api.beans.req.topic.TopicSearchReq;
import
com.tanpu.community.api.enums.OperationTypeEnum
;
import
com.tanpu.community.api.enums.OperationTypeEnum
;
import
com.tanpu.community.api.enums.TopicSpecialPermissionEnum
;
import
com.tanpu.community.api.enums.TopicSpecialPermissionEnum
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicFollowRelEntity
;
import
com.tanpu.community.dao.mapper.community.TopicFollowRelMapper
;
import
com.tanpu.community.dao.mapper.community.TopicFollowRelMapper
;
import
com.tanpu.community.service.RankService
;
import
com.tanpu.community.service.RankService
;
import
com.tanpu.community.service.ThemeService
;
import
com.tanpu.community.service.ThemeService
;
...
@@ -52,7 +53,10 @@ public class TopicManager {
...
@@ -52,7 +53,10 @@ public class TopicManager {
public
Page
<
TopicRankQo
>
getAllTopicBriefInfo
(
TopicSearchReq
req
)
{
public
Page
<
TopicRankQo
>
getAllTopicBriefInfo
(
TopicSearchReq
req
)
{
// 全量排序,内存分页
// 全量排序,内存分页
List
<
TopicRankQo
>
topicList
=
rankService
.
getRankTopicList
(
req
.
getSearchKeyword
());
List
<
TopicRankQo
>
topicList
=
rankService
.
getRankTopicList
(
req
.
getSearchKeyword
());
return
PageUtils
.
page
(
req
.
getPage
(),
topicList
);
Page
<
TopicRankQo
>
result
=
PageUtils
.
page
(
req
.
getPage
(),
topicList
);
// 添加权限
topicService
.
batchCheckPermission
(
result
.
getContent
(),
userHolder
.
getUserId
());
return
result
;
}
}
/**
/**
...
@@ -64,12 +68,12 @@ public class TopicManager {
...
@@ -64,12 +68,12 @@ public class TopicManager {
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
// 查库
// 查库
List
<
TopicFollowQo
>
topicFollowQos
=
topicService
.
queryFollowTopic
(
userId
);
List
<
TopicFollowQo
>
topicFollowQos
=
topicService
.
queryFollowTopic
(
userId
);
// 从缓存中获取浏览量
//
先
从缓存中获取浏览量
Map
<
String
,
TopicRankQo
>
topicMap
=
rankService
.
getRankTopicList
(
null
).
stream
().
collect
(
Collectors
.
toMap
(
TopicRankQo:
:
getTopicId
,
o
->
o
,
(
a
,
b
)
->
a
));
Map
<
String
,
TopicRankQo
>
topicMap
=
rankService
.
getRankTopicList
(
null
).
stream
().
collect
(
Collectors
.
toMap
(
TopicRankQo:
:
getTopicId
,
o
->
o
,
(
a
,
b
)
->
a
));
topicFollowQos
.
stream
().
forEach
(
o
->
{
topicFollowQos
.
stream
().
forEach
(
o
->
{
TopicRankQo
topicRankQo
=
topicMap
.
get
(
o
.
getTopicId
());
TopicRankQo
topicRankQo
=
topicMap
.
get
(
o
.
getTopicId
());
BeanUtils
.
copyProperties
(
topicRankQo
,
o
);
BeanUtils
.
copyProperties
(
topicRankQo
,
o
);
});
});
...
@@ -86,6 +90,7 @@ public class TopicManager {
...
@@ -86,6 +90,7 @@ public class TopicManager {
/**
/**
* 话题详情页
* 话题详情页
*
* @param topicId
* @param topicId
* @return
* @return
*/
*/
...
@@ -109,8 +114,8 @@ public class TopicManager {
...
@@ -109,8 +114,8 @@ public class TopicManager {
String
permission
=
"专业版会员"
;
String
permission
=
"专业版会员"
;
//
return "暂无权限参与此话题~您可联系官方客服 021- 了解详情";
return
"暂无权限参与此话题~您可联系官方客服 021- 了解详情"
;
return
"该话题仅限"
+
permission
+
"可参与哦~"
;
//
return "该话题仅限" + permission + "可参与哦~";
}
}
/**
/**
...
@@ -121,17 +126,40 @@ public class TopicManager {
...
@@ -121,17 +126,40 @@ public class TopicManager {
*/
*/
private
boolean
checkPermission
(
String
topicId
,
String
userId
)
{
private
boolean
checkPermission
(
String
topicId
,
String
userId
)
{
return
true
;
TopicEntity
topicEntity
=
topicService
.
queryOnlineTopicById
(
topicId
);
if
(
TopicSpecialPermissionEnum
.
FALSE
.
equals
(
topicEntity
.
getSpecialPermission
()))
{
return
true
;
}
TopicFollowRelEntity
topicFollowRelEntity
=
topicFollowRelMapper
.
queryOneByTopicIdAndUserId
(
topicId
,
userId
);
if
(
topicFollowRelEntity
!=
null
)
{
return
true
;
}
else
{
return
false
;
}
}
}
public
void
follow
(
FollowTopicReq
req
,
String
userId
)
{
/**
* 关注/取关 话题
*
* @param req
* @param userId
* @return
*/
public
CommonResp
<
Void
>
followTopic
(
FollowTopicReq
req
,
String
userId
)
{
// 检验话题权限是否专属
TopicEntity
topicEntity
=
topicService
.
queryOnlineTopicById
(
req
.
getTopicId
());
if
(
TopicSpecialPermissionEnum
.
TRUE
.
equals
(
topicEntity
.
getSpecialPermission
()))
{
return
CommonResp
.
error
(
ErrorCodeConstant
.
ILLEGAL_ARGEMENT
.
getCode
(),
"专属话题不支持关注"
);
}
if
(
OperationTypeEnum
.
CONFIRM
.
getCode
().
equals
(
req
.
getType
()))
{
if
(
OperationTypeEnum
.
CONFIRM
.
getCode
().
equals
(
req
.
getType
()))
{
topicService
.
addFollowTopic
(
req
.
getTopicId
(),
userId
);
topicService
.
addFollowTopic
(
req
.
getTopicId
(),
userId
);
}
else
if
(
OperationTypeEnum
.
CANCEL
.
getCode
().
equals
(
req
.
getType
()))
{
}
else
if
(
OperationTypeEnum
.
CANCEL
.
getCode
().
equals
(
req
.
getType
()))
{
topicService
.
deleteFollowTopic
(
req
.
getTopicId
(),
userId
);
topicService
.
deleteFollowTopic
(
req
.
getTopicId
(),
userId
);
}
}
return
CommonResp
.
success
();
}
}
}
}
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
View file @
56768478
...
@@ -312,7 +312,7 @@ public class ThemeService {
...
@@ -312,7 +312,7 @@ public class ThemeService {
ThemeEntity
themeEntity
=
themeMapper
.
queryOneByTopicIdOrderByUpdateTimeDesc
(
topicId
);
ThemeEntity
themeEntity
=
themeMapper
.
queryOneByTopicIdOrderByUpdateTimeDesc
(
topicId
);
if
(
themeEntity
!=
null
)
{
if
(
themeEntity
!=
null
)
{
ThemeQo
themeQo
=
ConvertUtil
.
themeEntityToQo
(
themeEntity
);
ThemeQo
themeQo
=
ConvertUtil
.
themeEntityToQo
(
themeEntity
);
topic
.
setLastTheme
(
themeQo
.
getAuthorId
()
+
themeQo
.
content
.
get
(
0
).
getValue
());
topic
.
setLastTheme
(
getUserName
(
themeQo
.
getAuthorId
())
+
":"
+
themeQo
.
content
.
get
(
0
).
getValue
());
topic
.
setLastThemeTime
(
TimeUtils
.
format
(
themeEntity
.
getUpdateTime
()));
topic
.
setLastThemeTime
(
TimeUtils
.
format
(
themeEntity
.
getUpdateTime
()));
}
}
...
@@ -330,4 +330,9 @@ public class ThemeService {
...
@@ -330,4 +330,9 @@ public class ThemeService {
}
}
}
}
private
String
getUserName
(
String
authorId
)
{
return
"理财师Jack"
;
}
}
}
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
56768478
...
@@ -3,6 +3,7 @@ package com.tanpu.community.service;
...
@@ -3,6 +3,7 @@ package com.tanpu.community.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.common.uuid.UuidGenHelper
;
import
com.tanpu.common.uuid.UuidGenHelper
;
import
com.tanpu.community.api.beans.qo.TopicFollowQo
;
import
com.tanpu.community.api.beans.qo.TopicFollowQo
;
import
com.tanpu.community.api.beans.qo.TopicRankQo
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.api.enums.StatusEnum
;
import
com.tanpu.community.api.enums.StatusEnum
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
...
@@ -11,6 +12,7 @@ import com.tanpu.community.dao.mapper.community.TopicFollowRelMapper;
...
@@ -11,6 +12,7 @@ import com.tanpu.community.dao.mapper.community.TopicFollowRelMapper;
import
com.tanpu.community.dao.mapper.community.TopicMapper
;
import
com.tanpu.community.dao.mapper.community.TopicMapper
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -121,4 +123,10 @@ public class TopicService {
...
@@ -121,4 +123,10 @@ public class TopicService {
topicFollowRelMapper
.
updateById
(
searchResult
);
topicFollowRelMapper
.
updateById
(
searchResult
);
}
}
}
}
public
void
batchCheckPermission
(
List
<
TopicRankQo
>
content
,
String
userId
)
{
if
(
StringUtils
.
isBlank
(
userId
)){
}
}
}
}
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
56768478
...
@@ -14,8 +14,9 @@ import com.tanpu.community.api.beans.vo.KafkaDurationUptMsg;
...
@@ -14,8 +14,9 @@ import com.tanpu.community.api.beans.vo.KafkaDurationUptMsg;
import
com.tanpu.community.api.beans.vo.feign.fatools.UserInfoResp
;
import
com.tanpu.community.api.beans.vo.feign.fatools.UserInfoResp
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.api.enums.NotificationTypeEnum
;
import
com.tanpu.community.api.enums.NotificationTypeEnum
;
import
com.tanpu.community.
dao.entity.NotificationLikeDO
;
import
com.tanpu.community.
api.enums.TopicSpecialPermissionEnum
;
import
com.tanpu.community.dao.entity.NotificationForwardDO
;
import
com.tanpu.community.dao.entity.NotificationForwardDO
;
import
com.tanpu.community.dao.entity.NotificationLikeDO
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.FileRecordEntity
;
import
com.tanpu.community.dao.entity.community.FileRecordEntity
;
import
com.tanpu.community.dao.entity.community.NotificationEntity
;
import
com.tanpu.community.dao.entity.community.NotificationEntity
;
...
@@ -23,8 +24,8 @@ import com.tanpu.community.dao.entity.community.ThemeAttachmentEntity;
...
@@ -23,8 +24,8 @@ import com.tanpu.community.dao.entity.community.ThemeAttachmentEntity;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.VisitLogEntity
;
import
com.tanpu.community.dao.entity.community.VisitLogEntity
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.StringUtils
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.time.ZoneOffset
;
...
@@ -122,6 +123,12 @@ public class ConvertUtil {
...
@@ -122,6 +123,12 @@ public class ConvertUtil {
if
(
TimeUtils
.
calMinuteTillNow
(
topicEntity
.
getCreateTime
())
<
60
*
24
)
{
if
(
TimeUtils
.
calMinuteTillNow
(
topicEntity
.
getCreateTime
())
<
60
*
24
)
{
topicRankQo
.
setType
(
TopicStatusEnum
.
NEWEST
.
getCode
());
topicRankQo
.
setType
(
TopicStatusEnum
.
NEWEST
.
getCode
());
}
}
// 根据是否专属设置默认权限
if
(
TopicSpecialPermissionEnum
.
FALSE
.
getCode
().
equals
(
topicEntity
.
getSpecialPermission
())){
topicRankQo
.
setHasPermission
(
true
);
}
else
{
topicRankQo
.
setHasPermission
(
false
);
}
topicRankQo
.
setMinutesTillNow
((
int
)
TimeUtils
.
calMinuteTillNow
(
topicEntity
.
getCreateTime
()));
topicRankQo
.
setMinutesTillNow
((
int
)
TimeUtils
.
calMinuteTillNow
(
topicEntity
.
getCreateTime
()));
return
topicRankQo
;
return
topicRankQo
;
}
}
...
@@ -152,6 +159,9 @@ public class ConvertUtil {
...
@@ -152,6 +159,9 @@ public class ConvertUtil {
BeanUtils
.
copyProperties
(
entity
,
qo
);
BeanUtils
.
copyProperties
(
entity
,
qo
);
qo
.
setContent
(
OtherUtil
.
blockPhoneAndEmail
(
entity
.
getContent
()));
qo
.
setContent
(
OtherUtil
.
blockPhoneAndEmail
(
entity
.
getContent
()));
qo
.
setUpdateTime
(
TimeUtils
.
getTimestampOfDateTime
(
entity
.
getUpdateTime
()));
qo
.
setUpdateTime
(
TimeUtils
.
getTimestampOfDateTime
(
entity
.
getUpdateTime
()));
if
(
StringUtils
.
isBlank
(
entity
.
getReplyUserId
())){
qo
.
setReplyUserId
(
null
);
}
return
qo
;
return
qo
;
}
}
...
...
community-service/src/main/resources/mapper/community/CommentEntityMapper.xml
View file @
56768478
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<result
column=
"theme_id"
property=
"themeId"
/>
<result
column=
"theme_id"
property=
"themeId"
/>
<result
column=
"parent_id"
property=
"parentId"
/>
<result
column=
"parent_id"
property=
"parentId"
/>
<result
column=
"reply_id"
property=
"replyId"
/>
<result
column=
"reply_id"
property=
"replyId"
/>
<result
column=
"reply_user_id"
property=
"replyUserId"
/>
<result
column=
"review_status"
property=
"reviewStatus"
/>
<result
column=
"review_status"
property=
"reviewStatus"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
...
...
community-service/src/main/resources/mapper/community/TopicFollowRelEntityMapper.xml
View file @
56768478
...
@@ -37,6 +37,6 @@
...
@@ -37,6 +37,6 @@
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from topic_follow_rel
from topic_follow_rel
where topic_id=#{topicId} and user_id=#{userId}
where topic_id=#{topicId} and user_id=#{userId}
and delete_tag = 0
</select>
</select>
</mapper>
</mapper>
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