Search in sources :

Example 1 with CommentDTO

use of pl.morecraft.dev.settler.web.dto.CommentDTO in project Settler by EmhyrVarEmreis.

the class CommentService method getByPrivilegeObject.

public ResponseEntity<List<CommentDTO>> getByPrivilegeObject(Long objectId) {
    PrivilegeObject privilegeObject = privilegeObjectRepository.findOne(objectId);
    if (privilegeObject == null) {
        return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
    }
    List<Comment> commentList = getByPrivilegeObject(privilegeObject);
    List<CommentDTO> commentDTOList = getListPageConverter().convert(commentList, CommentDTO.class);
    return new ResponseEntity<>(commentDTOList, HttpStatus.OK);
}
Also used : PrivilegeObject(pl.morecraft.dev.settler.domain.PrivilegeObject) Comment(pl.morecraft.dev.settler.domain.Comment) QComment(pl.morecraft.dev.settler.domain.QComment) ResponseEntity(org.springframework.http.ResponseEntity) CommentDTO(pl.morecraft.dev.settler.web.dto.CommentDTO)

Aggregations

ResponseEntity (org.springframework.http.ResponseEntity)1 Comment (pl.morecraft.dev.settler.domain.Comment)1 PrivilegeObject (pl.morecraft.dev.settler.domain.PrivilegeObject)1 QComment (pl.morecraft.dev.settler.domain.QComment)1 CommentDTO (pl.morecraft.dev.settler.web.dto.CommentDTO)1