springboot 控制器接收json对象

添加依赖

    <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","删除成功");

    }
    原文作者:weijie
    原文地址: https://segmentfault.com/a/1190000018736075
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞