package com.reptileclient.jlifeapp;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
//import com.bstek.ureport.console.UReportServlet;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;


/**
 * @author fuxubing
 */
@EnableScheduling
@EnableAsync
@EnableRetry
@MapperScan("com.reptileclient.jlifeapp.dao")
//@ImportResource("classpath:context.xml")
@SpringBootApplication(exclude = {DruidDataSourceAutoConfigure.class})
public class PostorderApplication {

    public static void main(String[] args) {
        SpringApplication.run(PostorderApplication.class, args);
    }


    @Autowired
    private RestTemplateBuilder builder;

    /**
     * @return 使用RestTemplateBuilder来实例化RestTemplate对象，spring默认已经注入了RestTemplateBuilder实例
     */
    @Bean
    public RestTemplate restTemplate() {
        return builder.build();
    }

	/*
	 * @Bean public ServletRegistrationBean buildUReportServlet() { return new
	 * ServletRegistrationBean(new UReportServlet(), "/ureport/*"); }
	 */


}

