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
b52b6de8
Commit
b52b6de8
authored
Aug 05, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rank log round
parent
eeee44b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
RankLogMapper.java
...m/tanpu/community/dao/mapper/community/RankLogMapper.java
+4
-3
RankLogService.java
...main/java/com/tanpu/community/service/RankLogService.java
+7
-1
application-dev.yml
community-service/src/main/resources/application-dev.yml
+12
-12
No files found.
community-service/src/main/java/com/tanpu/community/dao/mapper/community/RankLogMapper.java
View file @
b52b6de8
...
...
@@ -2,6 +2,7 @@ package com.tanpu.community.dao.mapper.community;
import
com.tanpu.community.dao.entity.community.RankLogEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
/**
...
...
@@ -14,6 +15,6 @@ import org.apache.ibatis.annotations.Select;
*/
public
interface
RankLogMapper
extends
BaseMapper
<
RankLogEntity
>
{
@Select
(
"select max(round) from rank_log"
)
Long
selectMaxRound
();
}
@Select
(
"select max(round) from rank_log
where type = #{type}
"
)
Long
selectMaxRound
(
@Param
(
"type"
)
Integer
type
);
}
\ No newline at end of file
community-service/src/main/java/com/tanpu/community/service/RankLogService.java
View file @
b52b6de8
...
...
@@ -30,7 +30,7 @@ public class RankLogService {
return
;
}
Long
round
=
rankLogMapper
.
selectMaxRound
();
Long
round
=
rankLogMapper
.
selectMaxRound
(
RankLogTypeEnum
.
TOPIC
.
getCode
()
);
round
=
round
==
null
?
0L
:
round
+
1
;
//分页插入
...
...
@@ -55,6 +55,10 @@ public class RankLogService {
if
(
CollectionUtils
.
isEmpty
(
themeList
))
{
return
;
}
Long
round
=
rankLogMapper
.
selectMaxRound
(
RankLogTypeEnum
.
THEME
.
getCode
());
round
=
round
==
null
?
0L
:
round
+
1
;
//分页插入
for
(
int
i
=
0
;
i
*
pageSize
<
themeList
.
size
();
i
++)
{
int
pageStart
=
i
*
pageSize
;
...
...
@@ -66,8 +70,10 @@ public class RankLogService {
.
content
(
JsonUtil
.
toJson
(
sublist
))
.
pageNumber
(
i
+
1
)
.
pageSize
(
sublist
.
size
())
.
round
(
round
)
.
build
();
rankLogMapper
.
insert
(
entity
);
}
}
}
community-service/src/main/resources/application-dev.yml
View file @
b52b6de8
...
...
@@ -101,16 +101,16 @@ recommend:
rank
:
theme
:
viewRate
:
0.1
1
forwardRate
:
3
1
commentRate
:
2
1
likeRaten
:
1
1
collectRate
:
3
1
userWeightRate
:
0.9
1
initialWeight
:
1.0
11
timeRate
:
0.2
1
viewRate
:
0.1
forwardRate
:
3
commentRate
:
2
likeRaten
:
1
collectRate
:
3
userWeightRate
:
0.9
initialWeight
:
1.0
timeRate
:
0.2
topic
:
viewRate
:
2
1
discussRate
:
3
1
themeRate
:
3
1
timeRate
:
1
1
viewRate
:
2
discussRate
:
3
themeRate
:
3
timeRate
:
1
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