提交 | 用户 | age
|
9e1c8d
|
1 |
package com.hx.other.service.config; |
G |
2 |
|
|
3 |
import org.springframework.beans.factory.config.BeanDefinition; |
|
4 |
import org.springframework.beans.factory.support.BeanDefinitionRegistry; |
|
5 |
import org.springframework.context.annotation.AnnotationBeanNameGenerator; |
|
6 |
|
|
7 |
/** |
|
8 |
* 重置bean名称生成策略,可以不同包同名策略 |
|
9 |
* @author cmg |
|
10 |
* @Date 2023-04-19 |
|
11 |
*/ |
|
12 |
public class UniqueNameGenerator extends AnnotationBeanNameGenerator { |
|
13 |
|
|
14 |
@Override |
|
15 |
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { |
|
16 |
//全限定类名 |
|
17 |
String beanName = definition.getBeanClassName(); |
|
18 |
return beanName; |
|
19 |
} |
|
20 |
} |