init project

This commit is contained in:
ldj_willow
2022-07-06 18:32:05 +08:00
parent 87ed66116e
commit e0498895f2
750 changed files with 68267 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package org.nl.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ConversionServiceFactoryBean;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.converter.Converter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.HashSet;
import java.util.Set;
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
/**
* 配置全局日期转换器
*/
@Bean
@Autowired
public ConversionService getConversionService(StringConverter dateConverter){
ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
Set<Converter> converters = new HashSet<Converter>();
converters.add(dateConverter);
factoryBean.setConverters(converters);
return factoryBean.getObject();
}
}