return new PostCommentAPI().execute();
}
@Override
protected Result doExecute() throws DAOException, PartakeException {
UserEx user = ensureLogin();
ensureValidSessionToken();
String eventId = getValidEventIdParameter();
String comment = getParameter("comment");
if (StringUtils.isBlank(comment))
return renderInvalid(UserErrorCode.MISSING_COMMENT);
if (comment.length() > MAX_COMMENT_LENGTH)
return renderInvalid(UserErrorCode.INVALID_COMMENT_TOOLONG);
EventComment embryo = new EventComment(null, eventId, user.getId(), comment, true, TimeUtil.getCurrentDateTime());
new PostCommentTransaction(embryo).execute();
return renderOK();
}