Spring Boot 注释

1.
@RestController
@RestController ≈ @Controller + @ResponseBody
在Controller文件 public class xxxx 前面加
用于返回
2.
@RequestMapping(value =  "/hello",method = RequestMethod.GET)
@RequestMapping  用于设置访问的方法  使用GET还是POST等

3.
返回直接用return

4.
@Value("${cupSize}")
private String cupSize;

@Value调用配置文件
配置文件可以不用写数据类型,在调用出来后用private设置数据类型为String或者Int
原文地址:https://www.cnblogs.com/hkgov/p/7659121.html