This commit is contained in:
zhao 2024-07-23 14:20:48 +08:00
parent 2dbe52bce6
commit 7571d13450
4 changed files with 0 additions and 9 deletions

View File

@ -113,14 +113,10 @@ public class TBookCollectionController {
}
Integer userId = entity.getId(); // 直接使用已经获取的用户信息
// Check if the book has already been collected by the user
boolean isBookAlreadyCollected = tBookCollectionService.isBookAlreadyCollected(userId, bookId);
if (isBookAlreadyCollected) {
return Result.error("该书已经收藏过,不能重复收藏");
}
// If not already collected, proceed with saving the collection record
LocalDateTime currentTime = LocalDateTime.now();
ZoneId zoneId = ZoneId.systemDefault();
ZonedDateTime zdt = currentTime.atZone(zoneId);

View File

@ -24,8 +24,6 @@ public class TBookCommentEntity {
private String comment;
private Integer parentId;
private Date createTime;
private Date updateTime;

View File

@ -80,7 +80,6 @@ public class TBookCollectionServiceImpl extends BaseServiceImpl<TBookCollectionD
LambdaQueryWrapper<TBookCollectionEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(TBookCollectionEntity::getBookId, bookId);
wrapper.eq(TBookCollectionEntity::getUserId, userId);
return baseMapper.selectOne(wrapper);
}
@Override

View File

@ -26,8 +26,6 @@ public class TBookCommentVO implements Serializable {
private String comment;
private Integer parentId;
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;