zyh
This commit is contained in:
parent
2dbe52bce6
commit
7571d13450
|
@ -113,14 +113,10 @@ public class TBookCollectionController {
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer userId = entity.getId(); // 直接使用已经获取的用户信息
|
Integer userId = entity.getId(); // 直接使用已经获取的用户信息
|
||||||
|
|
||||||
// Check if the book has already been collected by the user
|
|
||||||
boolean isBookAlreadyCollected = tBookCollectionService.isBookAlreadyCollected(userId, bookId);
|
boolean isBookAlreadyCollected = tBookCollectionService.isBookAlreadyCollected(userId, bookId);
|
||||||
if (isBookAlreadyCollected) {
|
if (isBookAlreadyCollected) {
|
||||||
return Result.error("该书已经收藏过,不能重复收藏");
|
return Result.error("该书已经收藏过,不能重复收藏");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not already collected, proceed with saving the collection record
|
|
||||||
LocalDateTime currentTime = LocalDateTime.now();
|
LocalDateTime currentTime = LocalDateTime.now();
|
||||||
ZoneId zoneId = ZoneId.systemDefault();
|
ZoneId zoneId = ZoneId.systemDefault();
|
||||||
ZonedDateTime zdt = currentTime.atZone(zoneId);
|
ZonedDateTime zdt = currentTime.atZone(zoneId);
|
||||||
|
|
|
@ -24,8 +24,6 @@ public class TBookCommentEntity {
|
||||||
|
|
||||||
private String comment;
|
private String comment;
|
||||||
|
|
||||||
private Integer parentId;
|
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
|
@ -80,7 +80,6 @@ public class TBookCollectionServiceImpl extends BaseServiceImpl<TBookCollectionD
|
||||||
LambdaQueryWrapper<TBookCollectionEntity> wrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<TBookCollectionEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
wrapper.eq(TBookCollectionEntity::getBookId, bookId);
|
wrapper.eq(TBookCollectionEntity::getBookId, bookId);
|
||||||
wrapper.eq(TBookCollectionEntity::getUserId, userId);
|
wrapper.eq(TBookCollectionEntity::getUserId, userId);
|
||||||
|
|
||||||
return baseMapper.selectOne(wrapper);
|
return baseMapper.selectOne(wrapper);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,8 +26,6 @@ public class TBookCommentVO implements Serializable {
|
||||||
|
|
||||||
private String comment;
|
private String comment;
|
||||||
|
|
||||||
private Integer parentId;
|
|
||||||
|
|
||||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user