package cn.pluss.platform;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;

import org.springframework.web.context.request.RequestContextListener;


@MapperScan("cn.pluss.platform.mapper")
@SpringBootApplication(scanBasePackages = "cn.pluss.platform")
@EnableRetry
@EnableAsync
public class WapApplication extends SpringBootServletInitializer{

    private static final Logger logger = LoggerFactory.getLogger(WapApplication.class);

    public static void main(String[] args) {

        SpringApplication.run(WapApplication.class, args);
        logger.info("WapApplication Service Start Success");
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(WapApplication.class);
    }

    @Bean
    public RequestContextListener requestContextListenerBean() {
        return new RequestContextListener();
    }
}
