Commit b52b6de8 authored by 刘基明's avatar 刘基明

rank log round

parent eeee44b2
......@@ -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
......@@ -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);
}
}
}
......@@ -101,16 +101,16 @@ recommend:
rank:
theme:
viewRate: 0.11
forwardRate: 31
commentRate: 21
likeRaten: 11
collectRate: 31
userWeightRate: 0.91
initialWeight: 1.011
timeRate: 0.21
viewRate: 0.1
forwardRate: 3
commentRate: 2
likeRaten: 1
collectRate: 3
userWeightRate: 0.9
initialWeight: 1.0
timeRate: 0.2
topic:
viewRate: 21
discussRate: 31
themeRate: 31
timeRate: 11
viewRate: 2
discussRate: 3
themeRate: 3
timeRate: 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment