Search in sources :

Example 1 with Comment

use of com.wayn.common.core.domain.shop.Comment in project waynboot-mall by wayn111.

the class CommentServiceImpl method saveComment.

@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveComment(CommentVO commentVO) {
    Comment comment = new Comment();
    BeanUtils.copyProperties(commentVO, comment);
    comment.setCreateTime(new Date());
    comment.setHasPicture(comment.getPicUrls().length > 0);
    if (!save(comment)) {
        throw new BusinessException("保存评论信息失败");
    }
    return iOrderGoodsService.update().set("comment", comment.getId()).eq("id", commentVO.getOrderGoodsId()).update();
}
Also used : Comment(com.wayn.common.core.domain.shop.Comment) BusinessException(com.wayn.common.exception.BusinessException) Date(java.util.Date) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

Comment (com.wayn.common.core.domain.shop.Comment)1 BusinessException (com.wayn.common.exception.BusinessException)1 Date (java.util.Date)1 Transactional (org.springframework.transaction.annotation.Transactional)1