package com.xhpc;

import com.xhpc.evcs.config.EvcsFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.PostConstruct;
import javax.servlet.Filter;

@EntityScan("com.xhpc")
@EnableJpaRepositories("com.xhpc")
@EnableFeignClients
@SpringBootApplication
@EnableScheduling
public class EvcsApplication {

    public static void main(String[] args) {

        SpringApplication.run(EvcsApplication.class, args);
    }

    @PostConstruct
    public void init() {

    }

    @Bean //duplicated to @Component annotation, make doFilter invoke twice, nah... gone?
    public Filter getEvcsFilter() {

        System.out.println(">>>> bean filter init <<<<");
        return new EvcsFilter();
    }

}
