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
ccbb4e3a
Commit
ccbb4e3a
authored
Aug 05, 2021
by
张辰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://47.100.44.39:10001/tp-backend/tanpu-community
into dev
parents
4dccb4b9
b52b6de8
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 @
ccbb4e3a
...
@@ -2,6 +2,7 @@ package com.tanpu.community.dao.mapper.community;
...
@@ -2,6 +2,7 @@ package com.tanpu.community.dao.mapper.community;
import
com.tanpu.community.dao.entity.community.RankLogEntity
;
import
com.tanpu.community.dao.entity.community.RankLogEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
/**
/**
...
@@ -14,6 +15,6 @@ import org.apache.ibatis.annotations.Select;
...
@@ -14,6 +15,6 @@ import org.apache.ibatis.annotations.Select;
*/
*/
public
interface
RankLogMapper
extends
BaseMapper
<
RankLogEntity
>
{
public
interface
RankLogMapper
extends
BaseMapper
<
RankLogEntity
>
{
@Select
(
"select max(round) from rank_log"
)
@Select
(
"select max(round) from rank_log
where type = #{type}
"
)
Long
selectMaxRound
();
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 @
ccbb4e3a
...
@@ -30,7 +30,7 @@ public class RankLogService {
...
@@ -30,7 +30,7 @@ public class RankLogService {
return
;
return
;
}
}
Long
round
=
rankLogMapper
.
selectMaxRound
();
Long
round
=
rankLogMapper
.
selectMaxRound
(
RankLogTypeEnum
.
TOPIC
.
getCode
()
);
round
=
round
==
null
?
0L
:
round
+
1
;
round
=
round
==
null
?
0L
:
round
+
1
;
//分页插入
//分页插入
...
@@ -55,6 +55,10 @@ public class RankLogService {
...
@@ -55,6 +55,10 @@ public class RankLogService {
if
(
CollectionUtils
.
isEmpty
(
themeList
))
{
if
(
CollectionUtils
.
isEmpty
(
themeList
))
{
return
;
return
;
}
}
Long
round
=
rankLogMapper
.
selectMaxRound
(
RankLogTypeEnum
.
THEME
.
getCode
());
round
=
round
==
null
?
0L
:
round
+
1
;
//分页插入
//分页插入
for
(
int
i
=
0
;
i
*
pageSize
<
themeList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
*
pageSize
<
themeList
.
size
();
i
++)
{
int
pageStart
=
i
*
pageSize
;
int
pageStart
=
i
*
pageSize
;
...
@@ -66,8 +70,10 @@ public class RankLogService {
...
@@ -66,8 +70,10 @@ public class RankLogService {
.
content
(
JsonUtil
.
toJson
(
sublist
))
.
content
(
JsonUtil
.
toJson
(
sublist
))
.
pageNumber
(
i
+
1
)
.
pageNumber
(
i
+
1
)
.
pageSize
(
sublist
.
size
())
.
pageSize
(
sublist
.
size
())
.
round
(
round
)
.
build
();
.
build
();
rankLogMapper
.
insert
(
entity
);
rankLogMapper
.
insert
(
entity
);
}
}
}
}
}
}
community-service/src/main/resources/application-dev.yml
View file @
ccbb4e3a
...
@@ -101,16 +101,16 @@ recommend:
...
@@ -101,16 +101,16 @@ recommend:
rank
:
rank
:
theme
:
theme
:
viewRate
:
0.1
1
viewRate
:
0.1
forwardRate
:
3
1
forwardRate
:
3
commentRate
:
2
1
commentRate
:
2
likeRaten
:
1
1
likeRaten
:
1
collectRate
:
3
1
collectRate
:
3
userWeightRate
:
0.9
1
userWeightRate
:
0.9
initialWeight
:
1.0
11
initialWeight
:
1.0
timeRate
:
0.2
1
timeRate
:
0.2
topic
:
topic
:
viewRate
:
2
1
viewRate
:
2
discussRate
:
3
1
discussRate
:
3
themeRate
:
3
1
themeRate
:
3
timeRate
:
1
1
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