DevBootApplication.java.ftl 2.2 KB
Newer Older
ibizdev's avatar
ibizdev committed
1 2 3 4 5 6 7 8 9
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
package ${pub.getPKGCodeName()};

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Configuration;
10
import org.springframework.context.annotation.Import;
ibizdev's avatar
ibizdev committed
11 12 13
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
sq3536's avatar
sq3536 committed
14 15
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
16
import org.springframework.context.annotation.ComponentScan;
sq3536's avatar
sq3536 committed
17
import java.util.List;
ibizdev's avatar
ibizdev committed
18 19 20 21 22 23

@Slf4j
@EnableDiscoveryClient
@Configuration
@EnableTransactionManagement
@EnableFeignClients(basePackages = {"${pub.getPKGCodeName()}" })
24 25 26 27 28 29 30 31 32 33 34 35 36 37
@SpringBootApplication(exclude = {
        <#assign bmogo=false>
        <#if sys.getAllPSDataEntities()??>
        <#list sys.getAllPSDataEntities() as de>
            <#if de.getStorageMode()?? && de.getStorageMode()==2>
                <#assign bmogo=true>
                <#break >
            </#if>
        </#list>
        </#if>
        <#if bmogo==false>
            org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
        </#if>
})
38 39 40 41 42
@ComponentScan(basePackages = {"${pub.getPKGCodeName()}"}
//        ,excludeFilters={
//                @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="${pub.getPKGCodeName()}.xxx.rest.xxx"),
//        }
)
43 44 45
@Import({
        org.springframework.cloud.openfeign.FeignClientsConfiguration.class
})
sq3536's avatar
sq3536 committed
46
public class DevBootApplication extends WebMvcConfigurerAdapter{
ibizdev's avatar
ibizdev committed
47 48 49 50

    public static void main(String[] args) {
        SpringApplication.run(DevBootApplication.class,args);
    }
sq3536's avatar
sq3536 committed
51 52 53 54 55 56

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        super.addArgumentResolvers(argumentResolvers);
        argumentResolvers.add(new ${pub.getPKGCodeName()}.util.web.SearchContextHandlerMethodArgumentResolver());
    }
ibizdev's avatar
ibizdev committed
57
}