|
@@ -478,7 +478,7 @@ public class BookServiceImpl implements BookService {
|
|
example.page(vo.getPage(), vo.getSize());
|
|
example.page(vo.getPage(), vo.getSize());
|
|
List<UserRecentlyRead> userRecentlyReads = userRecentlyReadMapper.selectByExample(example);
|
|
List<UserRecentlyRead> userRecentlyReads = userRecentlyReadMapper.selectByExample(example);
|
|
|
|
|
|
- if (userRecentlyReads == null) {
|
|
|
|
|
|
+ if (userRecentlyReads == null || userRecentlyReads.size() == 0) {
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -715,10 +715,9 @@ public class BookServiceImpl implements BookService {
|
|
|
|
|
|
public User getUserById(Long id) {
|
|
public User getUserById(Long id) {
|
|
User user = userMapper.selectByPrimaryKey(id);
|
|
User user = userMapper.selectByPrimaryKey(id);
|
|
- int freeCount = getFreeCountFromCharges(getFreeCharges(id));
|
|
|
|
|
|
+ int freeCount = cacheService.getFreeCoinCache(id);
|
|
if (user.getFreeKandian() != freeCount) {
|
|
if (user.getFreeKandian() != freeCount) {
|
|
user.setFreeKandian(freeCount);
|
|
user.setFreeKandian(freeCount);
|
|
-
|
|
|
|
// 更新免费看点
|
|
// 更新免费看点
|
|
User user1 = new User();
|
|
User user1 = new User();
|
|
user1.setId(user.getId());
|
|
user1.setId(user.getId());
|
|
@@ -829,4 +828,7 @@ public class BookServiceImpl implements BookService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public Integer getFreeCoin(Long id) {
|
|
|
|
+ return getFreeCountFromCharges(getFreeCharges(id));
|
|
|
|
+ }
|
|
}
|
|
}
|