Map<String, Object> params = new HashMap<>();
Template tmpl = Template.getTemplate(request);
if (!tmpl.isSessionAuthorized()) {
throw new AccessViolationException("нет авторизации");
}
params.put("msgid", msgid);
Comment comment = commentService.getById(msgid);
if (comment.isDeleted()) {
throw new UserErrorException("комментарий уже удален");
}
int topicId = comment.getTopicId();
Topic topic = messageDao.getById(topicId);
if (topic.isDeleted()) {
throw new AccessViolationException("тема удалена");
}
params.put("topic", topic);
CommentList comments = commentService.getCommentList(topic, tmpl.isModeratorSession());