// @SpringBootApplication 注解 包含了 @SpringBootConfiguration、 @EnableAutoConfiguration 和 @ComponentScan // 开启了包扫描 配置 和 自动配置功能 @SpringBootApplication
// RestController 注解是 Spring4.0 版本的一个注解, // 功能相当于,@Controller 注解和 @ResponseBody 注解之和。 @RestController
// 用来请求地址的url映射 @RequestMapping(value = "/hi")
// 配置属性类 @ConfigurationProperties(prefix = "my")
// 加 Component 注解 // Spring Boot 在启动时 通过包扫描 将 该类作为一个 Bean 注入 Ioc 容器中 @Component
// 读取 ConfigBean 类的属性 @RestController // 指明 ConfigBean 类 @EnableConfigurationProperties({ConfigBean.class})
// 主要意思是指明该配置文件的路径 @Configuration @PropertySource(value = "classpath:test.properties") @ConfigurationProperties(prefix = "com.forezp")
// 它可以对类成员变量、方法及构造函数进行标注 // 让 spring 完成 bean 自动装配的工作。 @Autowired