一、接口请求类注解
@RequestMapping("goods")
@GetMapping({"getAllGoods"})
@PostMapping("getGoodsByKeyword")
@RequestMapping({"{gcid}/getGoodsById"})
二、接收请求中的数据注解
@PathVariable
@RequestParam
@RequestBody
三、控制层、服务层、mapper层类的注解
@RestController
@Service
@Mapper
这篇文章主要介绍了在SpringMVC框架中,用于接口请求处理的一系列注解,如@RequestMapping用于定义请求路径,@GetMapping和@PostMapping分别对应HTTP的GET和POST请求。同时,@PathVariable用于获取URL路径变量,@RequestParam用于从请求参数中获取数据,@RequestBody则用于接收请求体中的JSON数据。此外,还提到了@Controller、@Service和@Mapper注解在控制层、服务层和数据访问层的作用。

638

被折叠的 条评论
为什么被折叠?



