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
0c2e35e0
Commit
0c2e35e0
authored
Jul 27, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回参数
parent
41edd7d9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
234 additions
and
128 deletions
+234
-128
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+3
-2
VisitSummaryManager.java
...java/com/tanpu/community/manager/VisitSummaryManager.java
+0
-8
VisitSummaryService.java
...java/com/tanpu/community/service/VisitSummaryService.java
+1
-1
create.sql
docs/create.sql
+230
-117
No files found.
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
0c2e35e0
...
@@ -186,6 +186,7 @@ public class ThemeManager {
...
@@ -186,6 +186,7 @@ public class ThemeManager {
// 查询主题列表:推荐/关注/热门/最新
// 查询主题列表:推荐/关注/热门/最新
public
ThemeListResp
queryThemes
(
ThemeListReq
req
,
String
userId
)
{
public
ThemeListResp
queryThemes
(
ThemeListReq
req
,
String
userId
)
{
Integer
pageStart
=
(
req
.
page
.
pageNumber
-
1
)
*
req
.
page
.
pageSize
;
Integer
pageStart
=
(
req
.
page
.
pageNumber
-
1
)
*
req
.
page
.
pageSize
;
Integer
pageSize
=
req
.
page
.
pageSize
;
Integer
realSize
=
req
.
page
.
pageSize
*
2
;
Integer
realSize
=
req
.
page
.
pageSize
*
2
;
List
<
ThemeEntity
>
themes
=
new
ArrayList
<>();
List
<
ThemeEntity
>
themes
=
new
ArrayList
<>();
...
@@ -207,7 +208,7 @@ public class ThemeManager {
...
@@ -207,7 +208,7 @@ public class ThemeManager {
throw
new
BizException
(
"TopicId为空"
);
throw
new
BizException
(
"TopicId为空"
);
}
}
List
<
String
>
rankThemeIds
=
rankService
.
getRankThemeListByTopic
(
req
.
getTopicId
()).
subList
(
pageStart
,
real
Size
);
List
<
String
>
rankThemeIds
=
rankService
.
getRankThemeListByTopic
(
req
.
getTopicId
()).
subList
(
pageStart
,
page
Size
);
themes
=
themeService
.
queryByThemeIds
(
rankThemeIds
);
themes
=
themeService
.
queryByThemeIds
(
rankThemeIds
);
themes
=
RankUtils
.
sortThemeEntityByIds
(
themes
,
rankThemeIds
);
themes
=
RankUtils
.
sortThemeEntityByIds
(
themes
,
rankThemeIds
);
...
@@ -216,7 +217,7 @@ public class ThemeManager {
...
@@ -216,7 +217,7 @@ public class ThemeManager {
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
{
if
(
StringUtils
.
isEmpty
(
req
.
getTopicId
()))
{
throw
new
BizException
(
"TopicId为空"
);
throw
new
BizException
(
"TopicId为空"
);
}
}
themes
=
themeService
.
queryNewestByTopic
(
req
.
topicId
,
req
.
page
.
pageNumber
,
real
Size
);
themes
=
themeService
.
queryNewestByTopic
(
req
.
topicId
,
req
.
page
.
pageNumber
,
page
Size
);
}
}
// filter用户自己的
// filter用户自己的
...
...
community-service/src/main/java/com/tanpu/community/manager/VisitSummaryManager.java
View file @
0c2e35e0
package
com
.
tanpu
.
community
.
manager
;
package
com
.
tanpu
.
community
.
manager
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.community.api.beans.vo.KafkaDurationUptMsg
;
import
com.tanpu.community.api.beans.vo.KafkaDurationUptMsg
;
import
com.tanpu.community.api.enums.VisitTypeEnum
;
import
com.tanpu.community.dao.entity.community.VisitSummaryEntity
;
import
com.tanpu.community.dao.entity.community.VisitSummaryEntity
;
import
com.tanpu.community.service.VisitSummaryService
;
import
com.tanpu.community.service.VisitSummaryService
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.ConvertUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.elasticsearch.common.recycler.Recycler
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.kafka.annotation.KafkaListener
;
import
org.springframework.kafka.annotation.KafkaListener
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
@Slf4j
@Slf4j
@Service
@Service
public
class
VisitSummaryManager
{
public
class
VisitSummaryManager
{
...
@@ -28,9 +23,6 @@ public class VisitSummaryManager {
...
@@ -28,9 +23,6 @@ public class VisitSummaryManager {
@Autowired
@Autowired
private
VisitSummaryService
visitSummaryService
;
private
VisitSummaryService
visitSummaryService
;
@Autowired
private
UserHolder
userHolder
;
@KafkaListener
(
topics
=
kafakTopic
)
@KafkaListener
(
topics
=
kafakTopic
)
public
void
updateVisitSummary
(
String
message
)
{
public
void
updateVisitSummary
(
String
message
)
{
...
...
community-service/src/main/java/com/tanpu/community/service/VisitSummaryService.java
View file @
0c2e35e0
...
@@ -37,7 +37,7 @@ public class VisitSummaryService {
...
@@ -37,7 +37,7 @@ public class VisitSummaryService {
.
stream
().
map
(
VisitSummaryEntity:
:
getRefId
).
distinct
().
collect
(
Collectors
.
toList
());
.
stream
().
map
(
VisitSummaryEntity:
:
getRefId
).
distinct
().
collect
(
Collectors
.
toList
());
return
ListUtils
.
subtract
(
refIds
,
visited
);
return
ListUtils
.
subtract
(
refIds
,
visited
);
}
}
public
List
<
String
>
queryUseVisited
(
String
userId
)
{
public
List
<
String
>
queryUse
r
Visited
(
String
userId
)
{
List
<
String
>
visited
=
visitSummaryMapper
.
selectList
(
new
LambdaQueryWrapper
<
VisitSummaryEntity
>()
List
<
String
>
visited
=
visitSummaryMapper
.
selectList
(
new
LambdaQueryWrapper
<
VisitSummaryEntity
>()
.
eq
(
VisitSummaryEntity:
:
getVisitorId
,
userId
))
.
eq
(
VisitSummaryEntity:
:
getVisitorId
,
userId
))
...
...
docs/create.sql
View file @
0c2e35e0
This diff is collapsed.
Click to expand it.
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