ApplicationContext applicationContext = SpringContextUtils.getApplicationContext();
//将applicationContext转换为ConfigurableApplicationContext
ConfigurableApplicationContext configurableApplicationContext = (ConfigurableApplicationContext) applicationContext;
// 获取bean工厂并转换为DefaultListableBeanFactory
DefaultListableBeanFactory defaultListableBeanFactory = (DefaultListableBeanFactory) configurableApplicationContext.getBeanFactory();
this.defaultListableBeanFactory = defaultListableBeanFactory;
String[] beanNamesForType = defaultListableBeanFactory.getBeanNamesForType(PayClient.class);
System.out.println("beanNamesForType:" + Arrays.toString(beanNamesForType));
// defaultListableBeanFactory.removeBeanDefinition("com.example.zuul.feign.PayClient");
defaultListableBeanFactory.removeBeanDefinition(beanNamesForType[0]);
// 通过BeanDefi