1. @SpringBootApplication
  2. @EnableEurekaClient
  3. @ComponentScan("com.fo")

@ComponentScan(“com.fo”) 加了以下注解都会被ComponentScan扫描到 @Component @Configuration @Bean @Service

使用@Service注解, 将这个Service交给Spring来管理

  1. @Service
  2. @Resource 或者 @Autowired

Mapper扫描注解

  1. @MapperScan("com.fo.server.mapper")

读取自定义配置项

  1. @Value("${test.hello}")
  2. private String testHello;

请求注解

  1. @RequestMapping("/Test")
  2. @GetMapping("/Test")
  3. @PostMapping("/Test")

Aspect AOP

  1. @Aspect
  2. @Component
  3. // Component是SpringBoot 最基本的注解就是表示你要把这个类交给spring来管理