Class RedditConfiguration
java.lang.Object
io.github.yvasyliev.telegramforwarderbot.configuration.RedditConfiguration
@Configuration
@EnableConfigurationProperties(org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties.class)
public class RedditConfiguration
extends Object
Configuration class for setting up the Reddit service client.
This configuration uses OAuth2 for authentication and sets up a RedditService
bean
that can be used to interact with the Reddit API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionredditService
(org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties oAuth2ClientProperties, RedditProperties redditProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates aRedditService
bean configured with OAuth2 client properties and a custom HTTP request interceptor.
-
Constructor Details
-
RedditConfiguration
public RedditConfiguration()
-
-
Method Details
-
redditService
@Bean public RedditService redditService(org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties oAuth2ClientProperties, RedditProperties redditProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates aRedditService
bean configured with OAuth2 client properties and a custom HTTP request interceptor.- Parameters:
oAuth2ClientProperties
- the OAuth2 client propertiesredditProperties
- the Reddit properties containing API host and user agentobjectMapper
- the Jackson ObjectMapper for JSON serialization/deserialization- Returns:
- a configured
RedditService
instance
-