由于项目应用,这里整理项目中遇到的注解。
1、展现层
@Controller、@RequestMapping、@RestController、@ResponseBody 参考:
SpringBoot 中常用注解@Controller/@RestController/@RequestMapping介绍
SpringMVC-@RequestMapping的参数和用法
2、@PostConstruct、@PreConstruct
Java开发之@PostConstruct和@PreConstruct注解
被@PostConstruct修饰的方法会在服务器加载Servlet的时候运行,并且只会被服务器调用一次,类似于Serclet的inti()方法。被@PostConstruct修饰的方法会在构造函数之后,init()方法之前运行。
@PathVariable
https://blog.youkuaiyun.com/shuduti/article/details/53540142