| | |
| | | //todo 评论内风险校验,评论内容可以是图片资源,考虑增加一个contextType字段用来区分资源类型 |
| | | CommentPo commentPo = new CommentPo(); |
| | | BeanUtils.copyProperties(commentDTO, commentPo); |
| | | if(StringUtils.isEmpty(commentDTO.getParentId())|| commentDTO.getParentId()<=0){ |
| | | commentPo.setParentId(0); |
| | | } |
| | | commentPo.setState(true); |
| | | commentPo.create(SecurityUtils.getUserId()); |
| | | if (commentPoMapper.insert(commentPo) <= 0) { |
| | |
| | | //获取用户信息 |
| | | CustomerDTO currentCustomer = customerMapper.getCurrentCustomer(commentDTO.getCreateBy()); |
| | | if(!ObjectUtils.isEmpty(currentCustomer)){ |
| | | commentDTO.setCommentUserName(currentCustomer.getNickName()); |
| | | commentDTO.setCommentUserName(currentCustomer.getName()); |
| | | commentDTO.setPicture(currentCustomer.getCover()); |
| | | User user = userService.findByTel(currentCustomer.getTel(), Constants.USER_TYPE.customer.name()); |
| | | if(!ObjectUtils.isEmpty(user)){ |