springboot 控制器接收json对象

朴有天虹 2019-07-01

添加依赖

<dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <version>2.4</version>
        <classifier>jdk15</classifier>
    </dependency>

controller 添加代码

public ResultVo deleteSomeUser(@RequestBody  JSONObject jsonObject){
        List<String> ids = (List)jsonObject.getJSONArray("ids");
        userService.deleteSomeUser(ids);
        return new ResultVo("200","删除成功");

    }

相关推荐

adonislu / 0评论 2020-01-17