/**

  • 保存商品信息 */ @RequestMapping("/save") public R save(@RequestBody ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request) { shangpinxinxi.setId(System.currentTimeMillis() + new Double(Math.floor(Math.random() * 1000)).longValue()); shangpinxinxiService.insert(shangpinxinxi); return R.ok(); }

/**

  • 新增商品信息 */ @RequestMapping("/add") public R add(@RequestBody ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request) { shangpinxinxi.setId(System.currentTimeMillis() + new Double(Math.floor(Math.random() * 1000)).longValue()); shangpinxinxiService.insert(shangpinxinxi); return R.ok(); }

/**

  • 修改商品信息 */ @RequestMapping("/update") @Transactional public R update(@RequestBody ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request) { shangpinxinxiService.updateById(shangpinxinxi); return R.ok(); }

/**

  • 删除商品信息 */ @RequestMapping("/delete") public R delete(@RequestBody Long[] ids) { shangpinxinxiService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); }
商品信息管理接口 - 保存、新增、修改、删除

原文地址: https://www.cveoy.top/t/topic/oAZ3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录