package com.lovecoding.Helloworld;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(HelloworldProperties.class)
public class HelloWorldServiceAutoconfigure {

    @Autowired
    HelloworldProperties helloworldProperties;

    @Bean
    public HelloWorldService getHelloWorldService(){

        System.out.println( "HelloWorldService 装配类被执行了------------------" );

        HelloWorldServiceImpl helloWorldService = new HelloWorldServiceImpl();
        helloWorldService.setHelloworldProperties(helloworldProperties);
        return helloWorldService;
    }

}
