SpringBoot+Swagger2个人心得
@PathVariable 注解
@ApiOperation(value = "根据id删除学生信息", notes = "删除对应id的学生信息")
@ApiImplicitParam(name = "id",value = "id" ,paramType = "path",required = true,dataType = "Integer")
@RequestMapping(value = "{id}",method = RequestMethod.DELETE)
public Integer delete(@PathVariable Integer id){
logger.info("开始删除学生信息");
return userService.delete(id);
}
该注解可将RequestMapping 中的value(id)作为参数传到方法里,好像还有另一个作用 但我此时并不够了解,待以后理解清楚再来进行修补。