Swagger传递List类型

    @ApiOperation(value = "角色列表修改",notes = "角色列表修改:\n" +
            " @ApiImplicitParam(type = \"query\", name = \"id\", value = \"编号\",required = true),\n" +
            "            @ApiImplicitParam(type = \"query\",name = \"name\",value = \"角色名\"),\n" +
            "            @ApiImplicitParam(type = \"query\", name = \"remark\",value = \"角色备注\"),\n" +
            "            @ApiImplicitParam(type = \"query\", name = \"lastUpdateBy\",value = \"修改者\"),\n" +
            "            @ApiImplicitParam(type = \"query\", name = \"delFlag\",value = \"删除标志,-1删除,0正常\")")
    @ApiImplicitParams({
//            @ApiImplicitParam(type = "query", name = "id", value = "编号",required = true),
//            @ApiImplicitParam(type = "query",name = "name",value = "角色名"),
//            @ApiImplicitParam(type = "query", name = "remark",value = "角色备注"),
//            @ApiImplicitParam(type = "query", name = "lastUpdateBy",value = "修改者"),
//            @ApiImplicitParam(type = "query", name = "delFlag",value = "删除标志,-1删除,0正常")

    })
    @PostMapping("/update/list")
    public HttpResult update( @RequestBody List<SysRole> sysRoles){
        try{
            List<SysRole> sysRoless = new ArrayList<>();

            for(Object sysRole: sysRoles){
                System.out.println(sysRole.toString());
                //sysRole.setLastUpdateTime(new Date());
            }
            //sysRoleService.update(sysRoles);
            return HttpResult.ok(sysRoles);
        }catch (Exception e){
            e.printStackTrace();
            return HttpResult.error("角色修改失败");
        }
    }

你可能感兴趣的:(Swagger传递List类型)