Search in sources :

Example 1 with GitHubStats

use of com.nixmash.blog.jpa.model.GitHubStats in project nixmash-blog by mintster.

the class GitHubTests method validateGithubStatsCache.

@Test
public void validateGithubStatsCache() throws Exception {
    assertNotNull(githubCache);
    GitHubStats gitHubStats = webUI.getCurrentGitHubStats();
    githubCache.get("getCurrentGitHubStats");
    assertThat(((GitHubStats) githubCache.get("getCurrentGitHubStats").get()).getFollowers(), greaterThan(-1));
}
Also used : GitHubStats(com.nixmash.blog.jpa.model.GitHubStats) Test(org.junit.Test)

Example 2 with GitHubStats

use of com.nixmash.blog.jpa.model.GitHubStats in project nixmash-blog by mintster.

the class GeneralController method home.

// endregion
// region Pages
@RequestMapping(value = "/", method = GET)
public String home(Model model) {
    String springVersion = webUI.parameterizedMessage("home.spring.version", SpringBootVersion.getVersion());
    model.addAttribute("springVersion", springVersion);
    GitHubStats gitHubStats = webUI.getCurrentGitHubStats();
    if (gitHubStats != null) {
        model.addAttribute("showGitHubStats", true);
        model.addAttribute("gitHubStats", gitHubStats);
    }
    if (webUI.isNixMash()) {
        SiteImage siteImage = siteService.getHomeBanner();
        model.addAttribute("siteImage", siteImage);
    }
    Slice<Post> posts = postService.getPublishedPosts(0, 10);
    if (posts.getContent().size() > 0)
        model.addAttribute("posts", posts);
    return HOME_VIEW;
}
Also used : GitHubStats(com.nixmash.blog.jpa.model.GitHubStats) Post(com.nixmash.blog.jpa.model.Post) SiteImage(com.nixmash.blog.jpa.model.SiteImage)

Aggregations

GitHubStats (com.nixmash.blog.jpa.model.GitHubStats)2 Post (com.nixmash.blog.jpa.model.Post)1 SiteImage (com.nixmash.blog.jpa.model.SiteImage)1 Test (org.junit.Test)1