Commit 620dec6b authored by 刘基明's avatar 刘基明

删除无用方法

parent d6bea770
......@@ -91,20 +91,6 @@ public class TopicManager {
}
public void modifyViewCount(String topicId, Long modifyMount) {
TopicEntity topicEntity = topicService.queryById(topicId);
if (topicEntity == null) {
throw new BizException("找不到话题,id:" + topicId);
}
topicService.modifyViewCount(topicId, modifyMount);
if (modifyMount > 0) {
redisService.incr(RedisKeyConstant.TOPIC_TOTAL_VIEW_COUNT_ + topicId, modifyMount);
} else {
redisService.decr(RedisKeyConstant.TOPIC_TOTAL_VIEW_COUNT_ + topicId, -modifyMount);
}
}
public void refreshRedisCache() {
List<TopicEntity> topicEntities = topicService.queryAll();
......
......@@ -93,15 +93,6 @@ public class TopicService {
return topicMapper.selectList(new LambdaQueryWrapper<TopicEntity>().in(TopicEntity::getTopicId, topicIds));
}
public void modifyViewCount(String topicId, long Count) {
TopicEntity topicEntity = queryById(topicId);
Long oldCount = topicEntity.getViewCntAdjust();
topicEntity.setViewAmountModify(topicEntity.getViewCntAdjust() + Count);
topicMapper.update(topicEntity, new LambdaUpdateWrapper<TopicEntity>()
.eq(TopicEntity::getViewCntAdjust, oldCount));
return;
}
public TopicEntity queryByTitile(String topicTitle) {
return topicMapper.selectOne(new LambdaQueryWrapper<TopicEntity>().eq(TopicEntity::getTopicTitle, topicTitle));
}
......
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