Package models

Examples of models.IssueComment


    @Transactional
    @With(AnonymousCheckAction.class)
    @IsAllowed(Operation.READ)
    public static Result voteComment(String user, String project, Long number, Long commentId) {
        IssueComment issueComment = IssueComment.find.byId(commentId);
        if (issueComment == null) {
            return notFound("issue.comment.error.vote");
        }

        issueComment.addVoter(UserApp.currentUser());

        return redirect(RouteUtil.getUrl(issueComment));
    }
View Full Code Here


    @Transactional
    @With(AnonymousCheckAction.class)
    @IsAllowed(Operation.READ)
    public static Result unvoteComment(String user, String project, Long number, Long commentId) {
        IssueComment issueComment = IssueComment.find.byId(commentId);
        if (issueComment == null) {
            return notFound("issue.comment.error.unvote");
        }

        if (!issueComment.voters.contains(UserApp.currentUser())) {
            return notFound("issue.comment.error.have.not.voted");
        }

        issueComment.removeVoter(UserApp.currentUser());

        return redirect(RouteUtil.getUrl(issueComment));
    }
View Full Code Here

TOP

Related Classes of models.IssueComment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.