Search in sources :

Example 1 with PostDisplayType

use of com.nixmash.blog.jpa.enums.PostDisplayType in project nixmash-blog by mintster.

the class JsoupServiceImpl method getTwitterImage.

private String getTwitterImage(PostDTO postDTO) {
    String twitterImage = applicationSettings.getTwitterImage();
    PostDisplayType postDisplayType = postDTO.getDisplayType();
    if (postDisplayType == PostDisplayType.MULTIPHOTO_POST || postDisplayType == PostDisplayType.SINGLEPHOTO_POST) {
        List<PostImage> postImages = postService.getPostImages(postDTO.getPostId());
        if (!postImages.isEmpty()) {
            PostImage postImage = postImages.get(0);
            twitterImage = postImage.getUrl() + postImage.getNewFilename();
        }
    }
    return twitterImage;
}
Also used : PostImage(com.nixmash.blog.jpa.model.PostImage) PostDisplayType(com.nixmash.blog.jpa.enums.PostDisplayType)

Aggregations

PostDisplayType (com.nixmash.blog.jpa.enums.PostDisplayType)1 PostImage (com.nixmash.blog.jpa.model.PostImage)1