| | |
| | | @RequestMapping(value = "/item/add/auth") |
| | | @ManagerAuth |
| | | public R add(Item item) { |
| | | |
| | | item.setHostId(getHostId()); |
| | | item.setCreateBy(getUserId()); |
| | | item.setCreateTime(new Date()); |
| | |
| | | |
| | | @RequestMapping(value = "/item/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam String param){ |
| | | List<Item> list = JSONArray.parseArray(param, Item.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | public R delete(@RequestParam("ids[]") String param){ |
| | | if (param != null){ |
| | | itemService.delete(new EntityWrapper<Item>() |
| | | .eq("id",param)); |
| | | } |
| | | for (Item entity : list){ |
| | | itemService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | // List<Item> list = JSONArray.parseArray(param, Item.class); |
| | | // if (Cools.isEmpty(list)){ |
| | | // return R.error(); |
| | | // } |
| | | // for (Item entity : list){ |
| | | // itemService.delete(new EntityWrapper<>(entity)); |
| | | // } |
| | | return R.ok(); |
| | | } |
| | | |