老师,为啥我从Postman传过去的参数是这样的,说数据类型错了
<update id="batchUpdateSellStatus"> update ethan_mall_product set status = #{sellStatus} where id in <foreach collection="ids" close=")" item="id" open="(" separator=","> #{id} </foreach> </update>
3
收起
正在回答 回答被采纳积分+1
2回答
会java泰酷辣
2023-08-02 10:27:58
@ApiOperation("后台批量上下架接口") @PostMapping("/admin/product/batchUpdateSellStatus") public ApiRestResponse batchUpdateSellStatus(@RequestParam Integer[] ids,@RequestParam Integer[] sellStatus){ productService.batchUpdateSellStatus(ids,sellStatus); return ApiRestResponse.success(); }
@Override public void batchUpdateSellStatus(Integer[] ids,Integer[] sellStatus){ productMapper.batchUpdateSellStatus(ids,sellStatus); }
确认方法应该是没问题的,之前发送的请求都没这种情况
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星