使用Integer包装类:由于基本数据类型不能直接作为HTTP响应体返回,你可以将其封装为引用类型Integer,然后通过@ResponseBody注解将其转换为JSON或其他格式返回给客户端。示例:java@RestControllerpublic class MyController { @GetMapping public Inte...
PostMapping和GetMapping封装了method=“”,限制了method,更加规范化。_ü榔鞯牡刂防甘淙氲刂罚梦实_RL都是get请求,因此如果以post定义方法,那么由于请求与实现的不一致,会返回405错误,method not allowed, The specified HTTP method is not allo...