1234567891011121314151617181920 |
- 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<String, NotifyEnum> notifyEnumConverter(){
- return new Converter<String, NotifyEnum>() {
- @Override
- public NotifyEnum convert(String s) {
- return NotifyEnum.match(s);
- }
- };
- }
- }
|