All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.kilmajster.blog.config.MinimalBlogAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 0.3
Show newest version
package io.github.kilmajster.blog.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.github.kilmajster.blog.controller.FileBasedBlogController;
import io.github.kilmajster.blog.data.PostsFileBasedRepository;

@Configuration
public class MinimalBlogAutoConfiguration {

  @Bean
  @ConditionalOnBean(MinimalBlog.class)
  public FileBasedBlogController blogController(@Autowired MinimalBlog minimalBlog) {
    return new FileBasedBlogController(minimalBlog);
  }

  @Bean
  @ConditionalOnBean(MinimalBlog.class)
  public PostsFileBasedRepository postsRepository(@Autowired MinimalBlog minimalBlog) {
    return new PostsFileBasedRepository();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy