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
a6d5c8d4
Commit
a6d5c8d4
authored
Sep 24, 2021
by
王亚雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游客权限
parent
3314de2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+12
-11
No files found.
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
a6d5c8d4
...
@@ -505,19 +505,20 @@ public class ThemeManager {
...
@@ -505,19 +505,20 @@ public class ThemeManager {
}
else
if
(
ThemeListTypeEnum
.
FOLLOW
.
getCode
().
equals
(
req
.
getType
()))
{
}
else
if
(
ThemeListTypeEnum
.
FOLLOW
.
getCode
().
equals
(
req
.
getType
()))
{
if
(
StringUtils
.
isEmpty
(
req
.
getUserId
()))
{
if
(
StringUtils
.
isEmpty
(
req
.
getUserId
()))
{
throw
new
BizException
(
ResultCode
.
UNAUTHORIZED
.
getCode
(),
ResultCode
.
UNAUTHORIZED
.
getMsg
());
// 未登录情况下返回空数组
}
themes
=
Lists
.
newArrayListWithCapacity
(
0
);
// 根据关注列表查询,按时间倒序
}
else
{
List
<
String
>
fansList
=
followRelService
.
queryIdolsByFansId
(
req
.
getUserId
());
// 根据关注列表查询,按时间倒序
themes
=
themeService
.
queryByUserIdsCreateDesc
(
fansList
,
pageStart
,
pageSize
);
List
<
String
>
fansList
=
followRelService
.
queryIdolsByFansId
(
req
.
getUserId
());
themes
=
themeService
.
queryByUserIdsCreateDesc
(
fansList
,
pageStart
,
pageSize
);
if
(
CollectionUtils
.
isEmpty
(
excludeIds
)
&&
!
themes
.
isEmpty
())
{
// 说明是从头开始刷,则直接把最新的lastId放到redis中,保留一个月
if
(
CollectionUtils
.
isEmpty
(
excludeIds
)
&&
!
themes
.
isEmpty
())
{
Long
lastId
=
themes
.
stream
().
map
(
ThemeEntity:
:
getId
).
max
(
Long:
:
compareTo
).
get
();
// 说明是从头开始刷,则直接把最新的lastId放到redis中,保留一个月
redisCache
.
put
(
CACHE_IDOL_THEME_LAST_ID
+
req
.
getUserId
(),
lastId
,
60
*
60
*
24
*
7
*
4
);
Long
lastId
=
themes
.
stream
().
map
(
ThemeEntity:
:
getId
).
max
(
Long:
:
compareTo
).
get
();
redisCache
.
put
(
CACHE_IDOL_THEME_LAST_ID
+
req
.
getUserId
(),
lastId
,
60
*
60
*
24
*
7
*
4
);
// visitLogService.addPageView(userId, userId, VisitTypeEnum.FOLLOW_THEME_VIEW);
// visitLogService.addPageView(userId, userId, VisitTypeEnum.FOLLOW_THEME_VIEW);
}
}
}
}
else
if
(
ThemeListTypeEnum
.
TOPIC_HOT
.
getCode
().
equals
(
req
.
getType
()))
{
}
else
if
(
ThemeListTypeEnum
.
TOPIC_HOT
.
getCode
().
equals
(
req
.
getType
()))
{
// 根据话题查询热门
// 根据话题查询热门
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
{
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
{
...
...
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