老师,为啥我从Postman传过去的参数是这样的,说数据类型错了

老师,为啥我从Postman传过去的参数是这样的,说数据类型错了

https://img1.sycdn.imooc.com//climg/64c9bc380944e47e10600388.jpghttps://img1.sycdn.imooc.com//climg/64c9bc2d09aed7bc21160675.jpg

<update id="batchUpdateSellStatus">
  update ethan_mall_product
  set status = #{sellStatus}
  where id in
  <foreach collection="ids" close=")" item="id" open="(" separator=",">
  #{id}
  </foreach>
</update>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

2回答
会java泰酷辣 提问者 2023-08-02 10:37:59

解决了,sellStatus类型写错了

会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 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师