ImConverterConfig.java 560 B

1234567891011121314151617181920
  1. package com.flow.config;
  2. import com.flow.enums.NotifyEnum;
  3. import org.springframework.context.annotation.Bean;
  4. import org.springframework.context.annotation.Configuration;
  5. import org.springframework.core.convert.converter.Converter;
  6. @Configuration
  7. public class ImConverterConfig {
  8. @Bean
  9. public Converter<String, NotifyEnum> notifyEnumConverter(){
  10. return new Converter<String, NotifyEnum>() {
  11. @Override
  12. public NotifyEnum convert(String s) {
  13. return NotifyEnum.match(s);
  14. }
  15. };
  16. }
  17. }