@SpringBootApplication
public class StudySpringEnableAnnotationApplication {
public static void main(String[] args) {
SpringApplication.run(StudySpringEnableAnnotationApplication.class, args);
}
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface EnableRestTemplate {
}
@Configuration
public class RestTemplateConfiguration {
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Import(RestTemplateConfiguration.class)
public @interface EnableRestTemplate {
}
@SpringBootApplication
@EnableRestTemplate
public class StudySpringEnableAnnotationApplication {
public static void main(String[] args) {
SpringApplication.run(StudySpringEnableAnnotationApplication.class, args);
}
}