package com.keyware.shandan.dynacmicform.config.web;

import com.keyware.shandan.dynacmicform.core.DefaultDynamicFormEventListener;
import com.keyware.shandan.dynacmicform.core.DynamicFormEventListener;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@EnableAutoConfiguration
public class DynamicFormConfiguration implements WebMvcConfigurer {

    @Bean
    @ConditionalOnMissingBean(DynamicFormEventListener.class)
    public DynamicFormEventListener dynamicFormEventListener(){
        return new DefaultDynamicFormEventListener();
    }
}
