-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored code base to be fully reactive and added rating figure (WIP)
- Loading branch information
Showing
41 changed files
with
400 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 12 additions & 11 deletions
23
client/src/main/java/com/gdevxy/blog/client/contentful/ContentfulClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
package com.gdevxy.blog.client.contentful; | ||
|
||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
import com.gdevxy.blog.client.contentful.model.ComponentRichImage; | ||
import com.gdevxy.blog.client.contentful.model.PageBlogPost; | ||
import com.gdevxy.blog.client.contentful.model.PageBlogPostCollection; | ||
import com.gdevxy.blog.client.contentful.model.Pagination; | ||
import com.gdevxy.blog.client.contentful.model.RecentPageBlogPostCollection; | ||
|
||
import java.util.Optional; | ||
import java.util.Set; | ||
import io.smallrye.mutiny.Uni; | ||
|
||
public interface ContentfulClient { | ||
|
||
Optional<PageBlogPost> findBlogPost(String slug); | ||
Uni<PageBlogPost> findBlogPost(String slug); | ||
|
||
Optional<PageBlogPost> findBlogPost(String slug, String previewToken); | ||
Uni<PageBlogPost> findBlogPost(String slug, String previewToken); | ||
|
||
PageBlogPostCollection findBlogPosts(Pagination pagination, Set<String> tags); | ||
Uni<PageBlogPostCollection> findBlogPosts(Pagination pagination, Set<String> tags); | ||
|
||
PageBlogPostCollection findBlogPosts(Pagination pagination, Set<String> tags, String previewToken); | ||
Uni<PageBlogPostCollection> findBlogPosts(Pagination pagination, Set<String> tags, String previewToken); | ||
|
||
RecentPageBlogPostCollection findRecentBlogPosts(); | ||
Uni<RecentPageBlogPostCollection> findRecentBlogPosts(); | ||
|
||
RecentPageBlogPostCollection findRecentBlogPosts(String previewToken); | ||
Uni<RecentPageBlogPostCollection> findRecentBlogPosts(String previewToken); | ||
|
||
Optional<ComponentRichImage> findImage(String id); | ||
Uni<ComponentRichImage> findImage(String id); | ||
|
||
Optional<ComponentRichImage> findImage(String id, String previewToken); | ||
Uni<ComponentRichImage> findImage(String id, String previewToken); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 11 additions & 9 deletions
20
client/src/main/java/com/gdevxy/blog/client/gravatar/GravatarClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
package com.gdevxy.blog.client.gravatar; | ||
|
||
import com.gdevxy.blog.client.gravatar.model.Profile; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
|
||
import com.gdevxy.blog.client.gravatar.model.Profile; | ||
import io.smallrye.mutiny.Uni; | ||
import org.eclipse.microprofile.faulttolerance.Retry; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
@RegisterRestClient(configKey = "gravatar") | ||
public interface GravatarClient { | ||
|
||
@GET | ||
@Retry(maxRetries = 2) | ||
@Path("/v3/profiles/{id}") | ||
Profile findById(@PathParam("id") String id); | ||
@GET | ||
@Retry(maxRetries = 2) | ||
@Path("/v3/profiles/{id}") | ||
Uni<Profile> findById(@PathParam("id") String id); | ||
|
||
@GET | ||
@Retry(maxRetries = 2) | ||
@Path("/avatar/{id}") | ||
String findAvatarUrl(@PathParam("id") String id); | ||
@GET | ||
@Retry(maxRetries = 2) | ||
@Path("/avatar/{id}") | ||
Uni<String> findAvatarUrl(@PathParam("id") String id); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
query findImage($id: String!){ | ||
componentRichImage(id: $id) { | ||
sys { | ||
id | ||
} | ||
image { | ||
title | ||
description | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.