Search in sources :

Example 6 with UserCommentModel

use of com.serotonin.m2m2.web.mvc.rest.v1.model.comment.UserCommentModel in project ma-modules-public by infiniteautomation.

the class EventInstanceModel method getComments.

@JsonGetter
public List<UserCommentModel> getComments() {
    List<UserCommentModel> commentModels = new ArrayList<UserCommentModel>();
    List<UserCommentVO> comments = this.data.getEventComments();
    if (comments == null)
        return null;
    for (UserCommentVO comment : comments) {
        commentModels.add(new UserCommentModel(comment));
    }
    return commentModels;
}
Also used : UserCommentModel(com.serotonin.m2m2.web.mvc.rest.v1.model.comment.UserCommentModel) ArrayList(java.util.ArrayList) UserCommentVO(com.serotonin.m2m2.vo.comment.UserCommentVO) JsonGetter(com.fasterxml.jackson.annotation.JsonGetter)

Aggregations

UserCommentModel (com.serotonin.m2m2.web.mvc.rest.v1.model.comment.UserCommentModel)6 UserCommentVO (com.serotonin.m2m2.vo.comment.UserCommentVO)5 RestProcessResult (com.serotonin.m2m2.web.mvc.rest.v1.message.RestProcessResult)4 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 User (com.serotonin.m2m2.vo.User)3 URI (java.net.URI)2 JsonGetter (com.fasterxml.jackson.annotation.JsonGetter)1 JsonSetter (com.fasterxml.jackson.annotation.JsonSetter)1 InvalidRQLRestException (com.infiniteautomation.mango.rest.v2.exception.InvalidRQLRestException)1 RestValidationFailedException (com.serotonin.m2m2.web.mvc.rest.v1.exception.RestValidationFailedException)1 ArrayList (java.util.ArrayList)1