启动时报异常Consider defining a bean of type ‘xxx’ in your configuration.
异常原因:未加@Component,导致未检测到
解决方法:往类上加上【@Component】注解
如图: