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
fa48c452
Commit
fa48c452
authored
Jul 22, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主题推荐算法重设计
parent
c6722016
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+1
-1
RecommendService.java
...in/java/com/tanpu/community/service/RecommendService.java
+2
-2
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+3
-4
No files found.
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
fa48c452
...
...
@@ -178,7 +178,7 @@ public class ThemeManager {
if
(
ThemeListTypeEnum
.
RECOMMEND
.
getCode
().
equals
(
req
.
getType
()))
{
//推荐
List
<
String
>
recommendThemeIds
=
recommendService
.
getRecommendThemes
(
req
.
getLastId
(),
req
.
getPageSize
(),
userId
);
themeEntities
=
themeService
.
queryByThemeIds
ExcludeUser
(
recommendThemeIds
,
null
,
req
.
getLastId
(),
req
.
getPageSize
()
);
themeEntities
=
themeService
.
queryByThemeIds
(
recommendThemeIds
);
themeEntities
=
RankUtils
.
sortThemeEntityByIds
(
themeEntities
,
recommendThemeIds
);
}
else
if
(
ThemeListTypeEnum
.
FOLLOW
.
getCode
().
equals
(
req
.
getType
()))
{
...
...
community-service/src/main/java/com/tanpu/community/service/RecommendService.java
View file @
fa48c452
...
...
@@ -67,8 +67,8 @@ public class RecommendService {
List
<
String
>
result
=
new
ArrayList
<>();
getResultList
(
hotThemeIds
,
0
,
newThemeIds
,
0
,
recThemeIds
,
0
,
returnedIds
,
result
,
pageSize
);
return
result
;
returnedIdsMap
.
put
(
userId
,
returnedIds
);
return
result
.
stream
().
limit
(
pageSize
).
collect
(
Collectors
.
toList
())
;
}
public
List
<
ThemeAnalysDO
>
getRecentThemeList
()
{
...
...
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
View file @
fa48c452
...
...
@@ -7,7 +7,6 @@ import com.tanpu.common.redis.RedisHelper;
import
com.tanpu.common.uuid.UuidGenHelper
;
import
com.tanpu.community.api.enums.DeleteTagEnum
;
import
com.tanpu.community.api.enums.ReportStatusEnum
;
import
com.tanpu.community.cache.RedisCache
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.mapper.community.ThemeMapper
;
import
com.tanpu.community.util.TimeUtils
;
...
...
@@ -19,14 +18,11 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
static
com
.
tanpu
.
community
.
api
.
constants
.
RedisKeyConstant
.
THEME_APPEAR_IN_SEARCH_LIST
;
@Service
public
class
ThemeService
{
...
...
@@ -200,6 +196,9 @@ public class ThemeService {
return
themeMapper
.
selectList
(
queryWrapper
);
}
/**
* 根据话题查询最新主题(可分页)
*
...
...
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