@Resource assembles the injection according to the name by default. Only when a bean matching the name is not found, it will assemble the injection according to the type;
@Autowired is injected by type assembly by default. If you want to transfer injection by name, you need to use it in conjunction with @Qualifier;