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
18750bc6
Commit
18750bc6
authored
Jul 22, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加举报字段
parent
2298b759
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
53 deletions
+94
-53
CommentQo.java
...main/java/com/tanpu/community/api/beans/qo/CommentQo.java
+12
-0
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+1
-1
HomePageController.java
...va/com/tanpu/community/controller/HomePageController.java
+7
-7
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+1
-1
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+19
-8
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+33
-32
BatchFeignCallService.java
...va/com/tanpu/community/service/BatchFeignCallService.java
+7
-0
RankService.java
...rc/main/java/com/tanpu/community/service/RankService.java
+14
-4
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/CommentQo.java
View file @
18750bc6
...
@@ -40,4 +40,16 @@ public class CommentQo {
...
@@ -40,4 +40,16 @@ public class CommentQo {
@ApiModelProperty
(
value
=
"2级评论"
)
@ApiModelProperty
(
value
=
"2级评论"
)
private
List
<
CommentLv2Qo
>
commentLv2Qos
;
private
List
<
CommentLv2Qo
>
commentLv2Qos
;
//认证标签相关
@ApiModelProperty
(
"认证标签用-用户等级体系 0 游客 1注册用户 10投资人 20 探普理顾 30 探普专家理顾 40 交易理财师 50 首席投顾"
)
private
Integer
levelGrade
;
@ApiModelProperty
(
"认证标签用-当levelGrade=10有值 1投资萌新 2投资达人"
)
private
String
userInvestorType
;
@ApiModelProperty
(
"认证标签用-用户类型 1普通账号 2机构账号 3机构人员"
)
private
Integer
userType
;
@ApiModelProperty
(
"认证标签用-所属机构id"
)
private
String
belongUserOrgId
;
@ApiModelProperty
(
"认证标签用-所属机构名"
)
private
String
belongUserOrgName
;
}
}
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
View file @
18750bc6
...
@@ -45,7 +45,7 @@ public class CommentController {
...
@@ -45,7 +45,7 @@ public class CommentController {
@AuthLogin
@AuthLogin
@PostMapping
(
value
=
"/queryComment"
)
@PostMapping
(
value
=
"/queryComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@Validated
@RequestBody
QueryCommentReq
req
)
{
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@Validated
@RequestBody
QueryCommentReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
...
...
community-service/src/main/java/com/tanpu/community/controller/HomePageController.java
View file @
18750bc6
...
@@ -40,16 +40,16 @@ public class HomePageController {
...
@@ -40,16 +40,16 @@ public class HomePageController {
@ApiOperation
(
value
=
"个人中心 查询"
)
@ApiOperation
(
value
=
"个人中心 查询"
)
@GetMapping
(
value
=
"/queryUserInfoNew"
)
@GetMapping
(
value
=
"/queryUserInfoNew"
)
@AuthLogin
@AuthLogin
public
CommonResp
<
UserInfoNew
>
queryUsersListNew
(
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
){
public
CommonResp
<
UserInfoNew
>
queryUsersListNew
(
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
)
{
String
userIdMyself
=
userHolder
.
getUserId
();
String
userIdMyself
=
userHolder
.
getUserId
();
return
CommonResp
.
success
(
homePageManager
.
queryUsersListNew
(
userIdMyself
,
userId
));
return
CommonResp
.
success
(
homePageManager
.
queryUsersListNew
(
userIdMyself
,
userId
));
}
}
// 理财师客户列表查询 (供圈子服务调用)
// 理财师客户列表查询 (供圈子服务调用)
@ApiOperation
(
value
=
"个人中心 理财师客户列表查询"
)
@ApiOperation
(
value
=
"个人中心 理财师客户列表查询"
)
@GetMapping
(
value
=
"/queryUserCustomerList"
)
@GetMapping
(
value
=
"/queryUserCustomerList"
)
@AuthLogin
@AuthLogin
public
CommonResp
<
List
<
Customer
>>
queryUserCustomerList
(){
public
CommonResp
<
List
<
Customer
>>
queryUserCustomerList
()
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
return
CommonResp
.
success
(
homePageManager
.
queryUserCustomerList
(
userId
));
return
CommonResp
.
success
(
homePageManager
.
queryUserCustomerList
(
userId
));
}
}
...
@@ -61,7 +61,7 @@ public class HomePageController {
...
@@ -61,7 +61,7 @@ public class HomePageController {
@AuthLogin
@AuthLogin
public
CommonResp
<
Page
<
FollowQo
>>
queryFollowList
(
@RequestBody
QueryFollowReq
req
)
{
public
CommonResp
<
Page
<
FollowQo
>>
queryFollowList
(
@RequestBody
QueryFollowReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
return
CommonResp
.
success
(
homePageManager
.
queryFollow
(
req
,
userId
));
return
CommonResp
.
success
(
homePageManager
.
queryFollow
(
req
,
userId
));
}
}
@PostMapping
(
value
=
"/addIdol"
)
@PostMapping
(
value
=
"/addIdol"
)
...
@@ -69,7 +69,7 @@ public class HomePageController {
...
@@ -69,7 +69,7 @@ public class HomePageController {
@ResponseBody
@ResponseBody
public
CommonResp
addIdol
(
@RequestBody
FollowRelReq
req
)
{
public
CommonResp
addIdol
(
@RequestBody
FollowRelReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
homePageManager
.
addFollowRel
(
req
,
userId
);
homePageManager
.
addFollowRel
(
req
,
userId
);
return
CommonResp
.
success
();
return
CommonResp
.
success
();
}
}
...
@@ -77,9 +77,9 @@ public class HomePageController {
...
@@ -77,9 +77,9 @@ public class HomePageController {
@ApiOperation
(
"用户的帖子列表"
)
@ApiOperation
(
"用户的帖子列表"
)
@ResponseBody
@ResponseBody
@AuthLogin
@AuthLogin
public
CommonResp
<
List
<
ThemeQo
>>
likeList
(
@Validated
@RequestBody
QueryRecordThemeReq
req
){
public
CommonResp
<
List
<
ThemeQo
>>
likeList
(
@Validated
@RequestBody
QueryRecordThemeReq
req
)
{
String
userId
=
userHolder
.
getUserId
();
String
userId
=
userHolder
.
getUserId
();
return
CommonResp
.
success
(
themeManager
.
queryThemesByUser
(
req
,
userId
));
return
CommonResp
.
success
(
themeManager
.
queryThemesByUser
(
req
,
userId
));
}
}
}
}
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
18750bc6
...
@@ -39,7 +39,7 @@ public class ThemeController {
...
@@ -39,7 +39,7 @@ public class ThemeController {
}
}
@AuthLogin
@AuthLogin
@ApiOperation
(
"
圈子首页
-推荐/关注/热门/最新"
)
@ApiOperation
(
"
主题列表
-推荐/关注/热门/最新"
)
@PostMapping
(
value
=
"/list"
)
@PostMapping
(
value
=
"/list"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
List
<
ThemeQo
>>
selectInterestList
(
@Validated
@RequestBody
ThemeListReq
req
)
{
public
CommonResp
<
List
<
ThemeQo
>>
selectInterestList
(
@Validated
@RequestBody
ThemeListReq
req
)
{
...
...
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
18750bc6
package
com
.
tanpu
.
community
.
manager
;
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.LikeCommentReq
;
import
com.tanpu.community.api.beans.req.comment.LikeCommentReq
;
import
com.tanpu.community.api.beans.vo.feign.fatools.UserInfoNew
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CollectionTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.api.enums.CommentTypeEnum
;
import
com.tanpu.community.api.enums.OperationTypeEnum
;
import
com.tanpu.community.api.enums.OperationTypeEnum
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.
dao.entity.user.UserInfoEntity
;
import
com.tanpu.community.
feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.service.CollectionService
;
import
com.tanpu.community.service.CollectionService
;
import
com.tanpu.community.service.CommentService
;
import
com.tanpu.community.service.CommentService
;
import
com.tanpu.community.service.HomePageService
;
import
com.tanpu.community.service.UserInfoService
;
import
com.tanpu.community.service.UserInfoService
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -29,7 +31,7 @@ public class CommentManager {
...
@@ -29,7 +31,7 @@ public class CommentManager {
private
CommentService
commentService
;
private
CommentService
commentService
;
@Autowired
@Autowired
private
HomePageService
homePageService
;
private
FeignClientForFatools
feignClientForFatools
;
@Autowired
@Autowired
private
CollectionService
collectionService
;
private
CollectionService
collectionService
;
...
@@ -63,10 +65,19 @@ public class CommentManager {
...
@@ -63,10 +65,19 @@ public class CommentManager {
for
(
CommentQo
commentQo
:
commentQos
)
{
for
(
CommentQo
commentQo
:
commentQos
)
{
//用户信息
//用户信息
String
authorId
=
commentQo
.
getAuthorId
();
String
authorId
=
commentQo
.
getAuthorId
();
UserInfoEntity
userInfo
=
userInfoService
.
queryUserById
(
authorId
);
CommonResp
<
UserInfoNew
>
userInfoNewCommonResp
=
feignClientForFatools
.
queryUsersListNew
(
authorId
);
if
(
userInfoNewCommonResp
.
isNotSuccess
())
{
throw
new
BizException
(
"内部接口调用失败"
);
}
UserInfoNew
userInfo
=
userInfoNewCommonResp
.
getData
();
if
(
userInfo
!=
null
)
{
if
(
userInfo
!=
null
)
{
commentQo
.
setUserImg
(
userInfo
.
getUiHeadimgMp
());
commentQo
.
setUserImg
(
userInfo
.
getHeadImageUrl
());
commentQo
.
setNickName
(
userInfo
.
getUiUsernameMp
());
commentQo
.
setNickName
(
userInfo
.
getNickName
());
commentQo
.
setUserType
(
userInfo
.
getUserType
());
commentQo
.
setLevelGrade
(
userInfo
.
getLevelGrade
());
commentQo
.
setUserInvestorType
(
userInfo
.
getUserInvestorType
());
commentQo
.
setBelongUserOrgId
(
userInfo
.
getBelongUserOrgId
());
commentQo
.
setBelongUserOrgName
(
userInfo
.
getBelongUserOrgName
());
}
}
//是否点赞及点赞数
//是否点赞及点赞数
String
commentId
=
commentQo
.
getCommentId
();
String
commentId
=
commentQo
.
getCommentId
();
...
@@ -80,8 +91,8 @@ public class CommentManager {
...
@@ -80,8 +91,8 @@ public class CommentManager {
// commentQo.setCommentLv2Qos(commentLv2Qos);
// commentQo.setCommentLv2Qos(commentLv2Qos);
}
}
//排序:点赞降序+时间降序
//排序:点赞降序+时间降序
return
commentQos
.
stream
().
sorted
(
Comparator
.
comparing
(
CommentQo:
:
getLikeCount
,
Comparator
.
reverseOrder
()).
return
commentQos
.
stream
().
sorted
(
Comparator
.
comparing
(
CommentQo:
:
getLikeCount
,
Comparator
.
reverseOrder
()).
thenComparing
(
CommentQo:
:
getUpdateTime
,
Comparator
.
reverseOrder
()))
thenComparing
(
CommentQo:
:
getUpdateTime
,
Comparator
.
reverseOrder
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
18750bc6
...
@@ -4,10 +4,7 @@ import com.google.common.collect.Sets;
...
@@ -4,10 +4,7 @@ import com.google.common.collect.Sets;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.community.api.beans.qo.ESThemeQo
;
import
com.tanpu.community.api.beans.qo.*
;
import
com.tanpu.community.api.beans.qo.FormerThemeQo
;
import
com.tanpu.community.api.beans.qo.ThemeContentQo
;
import
com.tanpu.community.api.beans.qo.ThemeQo
;
import
com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq
;
import
com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq
;
import
com.tanpu.community.api.beans.req.theme.*
;
import
com.tanpu.community.api.beans.req.theme.*
;
import
com.tanpu.community.api.beans.resp.CreateThemeResp
;
import
com.tanpu.community.api.beans.resp.CreateThemeResp
;
...
@@ -102,17 +99,7 @@ public class ThemeManager {
...
@@ -102,17 +99,7 @@ public class ThemeManager {
public
CreateThemeResp
publishTheme
(
CreateThemeReq
req
,
String
userId
)
{
public
CreateThemeResp
publishTheme
(
CreateThemeReq
req
,
String
userId
)
{
//直播类型做转播检查
//直播类型做转播检查
List
<
ThemeContentReq
>
contents
=
req
.
getContent
();
List
<
ThemeContentReq
>
contents
=
req
.
getContent
();
for
(
ThemeContentReq
content
:
contents
)
{
liveRelayCheck
(
userId
,
contents
);
if
(
content
!=
null
&&
content
.
getType
().
equals
(
RelTypeEnum
.
LIVE
.
type
))
{
CommonResp
<
Set
<
String
>>
notRelayResp
=
feignClientForFatools
.
getNotRelaySet
(
userId
,
Sets
.
newHashSet
(
content
.
getValue
()));
if
(!
notRelayResp
.
isSuccess
())
{
throw
new
BizException
(
"转播失败"
);
}
if
(
CollectionUtils
.
isEmpty
(
notRelayResp
.
getData
()))
{
throw
new
BizException
(
"9999"
,
"很抱歉!您需要购买或报名成功后才可以添加这个直播哦~"
);
}
}
}
//保存主题表
//保存主题表
ThemeEntity
themeEntity
=
new
ThemeEntity
();
ThemeEntity
themeEntity
=
new
ThemeEntity
();
...
@@ -149,6 +136,7 @@ public class ThemeManager {
...
@@ -149,6 +136,7 @@ public class ThemeManager {
}
}
/**
/**
* 返回主题列表
* 返回主题列表
*
*
...
@@ -159,7 +147,7 @@ public class ThemeManager {
...
@@ -159,7 +147,7 @@ public class ThemeManager {
public
List
<
ThemeQo
>
queryThemes
(
ThemeListReq
req
,
String
userId
)
{
public
List
<
ThemeQo
>
queryThemes
(
ThemeListReq
req
,
String
userId
)
{
List
<
ThemeEntity
>
themeEntities
=
new
ArrayList
<>();
List
<
ThemeEntity
>
themeEntities
=
new
ArrayList
<>();
if
(
ThemeListTypeEnum
.
RECOMMEND
.
getCode
().
equals
(
req
.
getType
()))
{
if
(
ThemeListTypeEnum
.
RECOMMEND
.
getCode
().
equals
(
req
.
getType
()))
{
//
TODO:
推荐
//推荐
// themeEntities = themeService.selectExcludeUser(userId, req.getLastId(), req.getPageSize());
// themeEntities = themeService.selectExcludeUser(userId, req.getLastId(), req.getPageSize());
List
<
String
>
recommendThemeIds
=
rankService
.
getHotAndNewThemes
(
100
,
100
);
List
<
String
>
recommendThemeIds
=
rankService
.
getHotAndNewThemes
(
100
,
100
);
themeEntities
=
themeService
.
queryByThemeIdsExcludeUser
(
recommendThemeIds
,
userId
,
req
.
getLastId
(),
req
.
getPageSize
());
themeEntities
=
themeService
.
queryByThemeIdsExcludeUser
(
recommendThemeIds
,
userId
,
req
.
getLastId
(),
req
.
getPageSize
());
...
@@ -170,11 +158,12 @@ public class ThemeManager {
...
@@ -170,11 +158,12 @@ public class ThemeManager {
themeEntities
=
themeService
.
queryByUserIds
(
fansList
,
req
.
getLastId
(),
req
.
getPageSize
());
themeEntities
=
themeService
.
queryByUserIds
(
fansList
,
req
.
getLastId
(),
req
.
getPageSize
());
}
else
if
(
ThemeListTypeEnum
.
TOPIC_HOT
.
getCode
().
equals
(
req
.
getType
()))
{
}
else
if
(
ThemeListTypeEnum
.
TOPIC_HOT
.
getCode
().
equals
(
req
.
getType
()))
{
//
TODO
根据话题查询热门
//根据话题查询热门
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
throw
new
BizException
(
"TopicId为空"
);
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
throw
new
BizException
(
"TopicId为空"
);
List
<
ThemeAnalysDO
>
rankThemeList
=
rankService
.
getRankThemeList
(
req
.
getTopicId
());
themeEntities
=
themeService
.
queryByTopic
(
req
.
getTopicId
(),
req
.
getLastId
(),
req
.
getPageSize
());
themeEntities
=
themeService
.
queryByTopic
(
req
.
getTopicId
(),
req
.
getLastId
(),
req
.
getPageSize
());
}
else
if
(
ThemeListTypeEnum
.
TOPIC_LATEST
.
getCode
().
equals
(
req
.
getType
()))
{
}
else
if
(
ThemeListTypeEnum
.
TOPIC_LATEST
.
getCode
().
equals
(
req
.
getType
()))
{
//
TODO
根据话题查询最新
//根据话题查询最新
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
throw
new
BizException
(
"TopicId为空"
);
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
throw
new
BizException
(
"TopicId为空"
);
themeEntities
=
themeService
.
queryByTopic
(
req
.
getTopicId
(),
req
.
getLastId
(),
req
.
getPageSize
());
themeEntities
=
themeService
.
queryByTopic
(
req
.
getTopicId
(),
req
.
getLastId
(),
req
.
getPageSize
());
}
}
...
@@ -307,7 +296,6 @@ public class ThemeManager {
...
@@ -307,7 +296,6 @@ public class ThemeManager {
return
CreateThemeResp
.
builder
().
themeId
(
themeEntity
.
getThemeId
()).
build
();
return
CreateThemeResp
.
builder
().
themeId
(
themeEntity
.
getThemeId
()).
build
();
}
}
// 屏蔽(用户)
// 屏蔽(用户)
public
void
blockUser
(
String
blockUser
,
String
userId
)
{
public
void
blockUser
(
String
blockUser
,
String
userId
)
{
BlackListEntity
selectOne
=
blackListService
.
selectOne
(
blockUser
,
userId
,
BlockTypeEnum
.
USER
.
getCode
());
BlackListEntity
selectOne
=
blackListService
.
selectOne
(
blockUser
,
userId
,
BlockTypeEnum
.
USER
.
getCode
());
...
@@ -316,11 +304,6 @@ public class ThemeManager {
...
@@ -316,11 +304,6 @@ public class ThemeManager {
}
}
}
}
// 解除屏蔽(用户)
public
void
unblockUser
(
String
blockUser
,
String
userId
)
{
//todo
}
// 屏蔽(主题)
// 屏蔽(主题)
public
void
blockTheme
(
String
themeId
,
String
userId
)
{
public
void
blockTheme
(
String
themeId
,
String
userId
)
{
blackListService
.
addBlock
(
themeId
,
userId
,
BlockTypeEnum
.
THEME
);
blackListService
.
addBlock
(
themeId
,
userId
,
BlockTypeEnum
.
THEME
);
...
@@ -353,11 +336,11 @@ public class ThemeManager {
...
@@ -353,11 +336,11 @@ public class ThemeManager {
//组装主题详情
//组装主题详情
private
void
buildThemeQoExtraInfo
(
String
userId
,
ThemeQo
themeQo
)
{
private
void
buildThemeQoExtraInfo
(
String
userId
,
ThemeQo
themeQo
)
{
String
themeId
=
themeQo
.
getThemeId
();
//封装转发对象
//封装转发对象
buildFormerTheme
(
themeQo
);
buildFormerTheme
(
themeQo
);
String
themeId
=
themeQo
.
getThemeId
();
//是否关注作者
//是否关注作者
String
authorId
=
themeQo
.
getAuthorId
();
String
authorId
=
themeQo
.
getAuthorId
();
...
@@ -374,7 +357,6 @@ public class ThemeManager {
...
@@ -374,7 +357,6 @@ public class ThemeManager {
themeQo
.
setHasCollect
(
collectionEntity
!=
null
);
themeQo
.
setHasCollect
(
collectionEntity
!=
null
);
//点赞,收藏,转发
//点赞,收藏,转发
Integer
likeCount
=
collectionService
.
getCountByTypeAndId
(
themeId
,
CollectionTypeEnum
.
LIKE_THEME
);
Integer
likeCount
=
collectionService
.
getCountByTypeAndId
(
themeId
,
CollectionTypeEnum
.
LIKE_THEME
);
// Integer bookCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.COLLECT_THEME);
Integer
commentCount
=
commentService
.
getCommentCountByThemeId
(
themeId
);
Integer
commentCount
=
commentService
.
getCommentCountByThemeId
(
themeId
);
Integer
forwardCount
=
themeService
.
getForwardCountById
(
themeId
);
Integer
forwardCount
=
themeService
.
getForwardCountById
(
themeId
);
themeQo
.
setCommentCount
(
commentCount
);
themeQo
.
setCommentCount
(
commentCount
);
...
@@ -405,10 +387,6 @@ public class ThemeManager {
...
@@ -405,10 +387,6 @@ public class ThemeManager {
themeService
.
deleteById
(
themeId
);
themeService
.
deleteById
(
themeId
);
}
}
//投诉(主题)
public
void
complaint
(
String
themeId
,
String
user
)
{
//TODO
}
public
Integer
getFollowUpdateCount
(
String
userId
)
{
public
Integer
getFollowUpdateCount
(
String
userId
)
{
LocalDateTime
lastViewTime
=
visitSummaryService
.
queryLatestViewFollow
(
userId
);
LocalDateTime
lastViewTime
=
visitSummaryService
.
queryLatestViewFollow
(
userId
);
...
@@ -416,7 +394,10 @@ public class ThemeManager {
...
@@ -416,7 +394,10 @@ public class ThemeManager {
return
themeService
.
queryCountFromLastTime
(
fansList
,
lastViewTime
);
return
themeService
.
queryCountFromLastTime
(
fansList
,
lastViewTime
);
}
}
/**
* 腾讯云-内容检测
* @param content
*/
private
void
checkContent
(
String
content
)
{
private
void
checkContent
(
String
content
)
{
// 腾讯云接口最多支持5000文字校验,超过5000执行2次
// 腾讯云接口最多支持5000文字校验,超过5000执行2次
// 检查内容是否涉黄违法
// 检查内容是否涉黄违法
...
@@ -433,4 +414,24 @@ public class ThemeManager {
...
@@ -433,4 +414,24 @@ public class ThemeManager {
return
;
return
;
}
}
/**
* 直播类型做转播检查
* @param userId
* @param contents
*/
private
void
liveRelayCheck
(
String
userId
,
List
<
ThemeContentReq
>
contents
)
{
for
(
ThemeContentReq
content
:
contents
)
{
if
(
content
!=
null
&&
content
.
getType
().
equals
(
RelTypeEnum
.
LIVE
.
type
))
{
CommonResp
<
Set
<
String
>>
notRelayResp
=
feignClientForFatools
.
getNotRelaySet
(
userId
,
Sets
.
newHashSet
(
content
.
getValue
()));
if
(!
notRelayResp
.
isSuccess
())
{
throw
new
BizException
(
"转播失败"
);
}
if
(
CollectionUtils
.
isEmpty
(
notRelayResp
.
getData
()))
{
throw
new
BizException
(
"9999"
,
"很抱歉!您需要购买或报名成功后才可以添加这个直播哦~"
);
}
}
}
}
}
}
community-service/src/main/java/com/tanpu/community/service/BatchFeignCallService.java
View file @
18750bc6
...
@@ -34,6 +34,9 @@ import javax.annotation.Resource;
...
@@ -34,6 +34,9 @@ import javax.annotation.Resource;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
* 批量调用Feign查询接口
*/
@Service
@Service
public
class
BatchFeignCallService
{
public
class
BatchFeignCallService
{
...
@@ -373,13 +376,17 @@ public class BatchFeignCallService {
...
@@ -373,13 +376,17 @@ public class BatchFeignCallService {
Map
<
String
,
String
>
topicMap
)
{
Map
<
String
,
String
>
topicMap
)
{
for
(
ThemeQo
themeQo
:
themeQos
)
{
for
(
ThemeQo
themeQo
:
themeQos
)
{
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getTopicId
())
&&
topicMap
.
containsKey
(
themeQo
.
getTopicId
()))
{
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getTopicId
())
&&
topicMap
.
containsKey
(
themeQo
.
getTopicId
()))
{
//话题标题
themeQo
.
setTopicTitle
(
topicMap
.
get
(
themeQo
.
getTopicId
()));
themeQo
.
setTopicTitle
(
topicMap
.
get
(
themeQo
.
getTopicId
()));
}
}
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getAuthorId
())
&&
userMap
.
containsKey
(
themeQo
.
getAuthorId
()))
{
if
(!
StringUtils
.
isEmpty
(
themeQo
.
getAuthorId
())
&&
userMap
.
containsKey
(
themeQo
.
getAuthorId
()))
{
//用户信息
UserInfoNew
userInfo
=
userMap
.
get
(
themeQo
.
getAuthorId
());
UserInfoNew
userInfo
=
userMap
.
get
(
themeQo
.
getAuthorId
());
//昵称头像简介
themeQo
.
setNickName
(
userInfo
.
getNickName
());
themeQo
.
setNickName
(
userInfo
.
getNickName
());
themeQo
.
setUserImg
(
userInfo
.
getHeadImageUrl
());
themeQo
.
setUserImg
(
userInfo
.
getHeadImageUrl
());
themeQo
.
setUserIntroduction
(
userInfo
.
getIntroduction
());
themeQo
.
setUserIntroduction
(
userInfo
.
getIntroduction
());
//认证标签相关
themeQo
.
setUserType
(
userInfo
.
getUserType
());
themeQo
.
setUserType
(
userInfo
.
getUserType
());
themeQo
.
setLevelGrade
(
userInfo
.
getLevelGrade
());
themeQo
.
setLevelGrade
(
userInfo
.
getLevelGrade
());
themeQo
.
setUserInvestorType
(
userInfo
.
getUserInvestorType
());
themeQo
.
setUserInvestorType
(
userInfo
.
getUserInvestorType
());
...
...
community-service/src/main/java/com/tanpu/community/service/RankService.java
View file @
18750bc6
...
@@ -28,7 +28,7 @@ public class RankService {
...
@@ -28,7 +28,7 @@ public class RankService {
private
VisitSummaryService
visitSummaryService
;
private
VisitSummaryService
visitSummaryService
;
private
List
<
String
>
rankThemeList
=
new
ArrayList
<>();
private
List
<
ThemeAnalysDO
>
rankThemeList
=
new
ArrayList
<>();
private
List
<
TopicRankQo
>
rankTopicList
=
new
ArrayList
<>();
private
List
<
TopicRankQo
>
rankTopicList
=
new
ArrayList
<>();
private
List
<
TopicRankQo
>
rankTopicListTop4
=
new
ArrayList
<>();
private
List
<
TopicRankQo
>
rankTopicListTop4
=
new
ArrayList
<>();
...
@@ -56,7 +56,7 @@ public class RankService {
...
@@ -56,7 +56,7 @@ public class RankService {
//打分
//打分
Map
<
ThemeAnalysDO
,
Double
>
map
=
themeAnalysDOS
.
stream
().
collect
(
Collectors
.
toMap
(
o
->
o
,
ThemeAnalysDO:
:
getScore
));
Map
<
ThemeAnalysDO
,
Double
>
map
=
themeAnalysDOS
.
stream
().
collect
(
Collectors
.
toMap
(
o
->
o
,
ThemeAnalysDO:
:
getScore
));
//排序
//排序
rankThemeList
=
map
.
entrySet
().
stream
().
sorted
(
Map
.
Entry
.
comparingByValue
(
Comparator
.
reverseOrder
())).
map
(
e
->
e
.
getKey
()
.
getThemeId
()
).
collect
(
Collectors
.
toList
());
rankThemeList
=
map
.
entrySet
().
stream
().
sorted
(
Map
.
Entry
.
comparingByValue
(
Comparator
.
reverseOrder
())).
map
(
e
->
e
.
getKey
()).
collect
(
Collectors
.
toList
());
}
}
...
@@ -102,7 +102,7 @@ public class RankService {
...
@@ -102,7 +102,7 @@ public class RankService {
* @return
* @return
*/
*/
public
List
<
String
>
getHotAndNewThemes
(
Integer
hotCount
,
Integer
newCount
)
{
public
List
<
String
>
getHotAndNewThemes
(
Integer
hotCount
,
Integer
newCount
)
{
Set
<
String
>
hotThemeIds
=
this
.
rankThemeList
.
stream
().
limit
(
hotCount
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
hotThemeIds
=
this
.
rankThemeList
.
stream
().
limit
(
hotCount
).
map
(
ThemeAnalysDO:
:
getThemeId
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
newThemeIds
=
themeService
.
selectExcludeUser
(
null
,
null
,
newCount
)
Set
<
String
>
newThemeIds
=
themeService
.
selectExcludeUser
(
null
,
null
,
newCount
)
.
stream
().
map
(
ThemeEntity:
:
getThemeId
).
collect
(
Collectors
.
toSet
());
.
stream
().
map
(
ThemeEntity:
:
getThemeId
).
collect
(
Collectors
.
toSet
());
hotThemeIds
.
addAll
(
newThemeIds
);
hotThemeIds
.
addAll
(
newThemeIds
);
...
@@ -124,7 +124,10 @@ public class RankService {
...
@@ -124,7 +124,10 @@ public class RankService {
}
}
public
List
<
String
>
getRankThemeList
()
{
public
List
<
ThemeAnalysDO
>
getRankThemeList
()
{
if
(
this
.
rankThemeList
.
size
()==
0
){
rankThemes
();
}
return
rankThemeList
;
return
rankThemeList
;
}
}
...
@@ -141,4 +144,11 @@ public class RankService {
...
@@ -141,4 +144,11 @@ public class RankService {
}
}
return
rankTopicListTop4
;
return
rankTopicListTop4
;
}
}
public
List
<
ThemeAnalysDO
>
getRankThemeList
(
String
topicId
)
{
if
(
this
.
rankThemeList
.
size
()==
0
){
this
.
rankThemes
();
}
return
rankThemeList
.
stream
().
filter
(
o
->
o
.
getTopicId
().
equals
(
topicId
)).
collect
(
Collectors
.
toList
());
}
}
}
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