class EcoNewsCommentServiceImpl implements EcoNewsCommentService {

    @Override
    @Transactional
    public void update(String text, Long id, User user) {
        EcoNewsComment comment = ecoNewsCommentRepo.findById(id)
            .orElseThrow(() -> new NotFoundException(ErrorMessage.COMMENT_NOT_FOUND_EXCEPTION));
        if (!user.getId().equals(comment.getUser().getId())) {
            throw new BadRequestException(ErrorMessage.NOT_A_CURRENT_USER);
        }
        comment.setText(text);
        ecoNewsCommentRepo.save(comment);
    }

}