Java注解

***************请求映射类**************

@RequestMapping("")//修饰类或接口,以get或post方式请求。
@PostMapping("")//修饰类或接口,以post方式请求。
@GetMapping("")//修饰类或接口,以get方式请求。

***************入参约束类**************

@RequestBody //修饰参数接收类,用对象接收以json串传入的数据

***************返回约束类**************

@RestController(修饰Controller,返回json数据,无法返回jsp、html页面) = @Controller + @ResponseBody(修饰方法返回值类)

***************引入或实例化对象**************

@Slf4j //修饰类,实例化日志对象log并引入
@Autowired //修饰变量,实例化变量


原文地址:https://www.cnblogs.com/shijianchuzhenzhi/p/11982814.html