package com.flow.config; import com.flow.enums.NotifyEnum; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.converter.Converter; @Configuration public class ImConverterConfig { @Bean public Converter notifyEnumConverter(){ return new Converter() { @Override public NotifyEnum convert(String s) { return NotifyEnum.match(s); } }; } }