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 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 a RedditService bean configured with OAuth2 client properties and a custom HTTP request interceptor.
      Parameters:
      oAuth2ClientProperties - the OAuth2 client properties
      redditProperties - the Reddit properties containing API host and user agent
      objectMapper - the Jackson ObjectMapper for JSON serialization/deserialization
      Returns:
      a configured RedditService instance