package com.storlead.sales.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addFormatters(FormatterRegistry registry) {
        // 注册String类型的转换器，自动去除前后空格
        registry.addConverter(String.class, String.class, source -> source == null ? null : source.trim());
    }
}
