1.方法如下

 @ResponseBody
    @RequestMapping(value = "/updateByPrimaryKey/{id}",method = RequestMethod.GET)
    public CommonResult updateByPrimaryKey(
            @PathVariable("id") long id,@RequestBody PmsBrand pmsBrand){
        LOGGER.debug("id"+"sssss");
        CommonResult commonResult;
        int i = pmsBrandService.updateByPrimaryKey(id, pmsBrand);
        if(i>0){
            commonResult=   CommonResult.success(pmsBrand);
        }else{
            commonResult= CommonResult.failed("操作失败");
        }
        return  commonResult;
    }

2.测试流程

postman spring @PathVariable和@RequestBody怎么测试

 

相关文章: