| | |
| | | @Transactional |
| | | @Log(title = "助餐信息-添加", businessType = BusinessType.INSERT) |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> save(@RequestBody TAssistedDining entity) { |
| | | assistedDiningService.save(entity); |
| | | public R<Boolean> save(@RequestBody TAssistedDining dto) { |
| | | assistedDiningService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "修改") |
| | | @Log(title = "助餐信息-修改", businessType = BusinessType.UPDATE) |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody TAssistedDining entity) { |
| | | assistedDiningService.updateById(entity); |
| | | public R<Boolean> edit(@RequestBody TAssistedDining dto) { |
| | | assistedDiningService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "助餐信息-删除", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "助餐信息-删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R delete(@RequestParam String ids) { |
| | | List<Integer> res = Arrays.stream(ids.split(",")).map(Integer::parseInt).collect(Collectors.toList()); |
| | | // 转换成Integer |
| | | assistedDiningService.removeBatchByIds(res); |
| | | return R.ok(); |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(assistedDiningService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除助餐信息 |
| | | */ |
| | | @Log(title = "助餐信息-批量删除", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "助餐信息-批量删除") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(assistedDiningService.removeByIds(ids)); |
| | | } |
| | | @ApiOperation(value = "查看详情") |
| | | @GetMapping(value = "/detail") |
| | | public R<TAssistedDining> detail(Integer id) { |
| | | public R<TAssistedDining> detail(String id) { |
| | | return R.ok(assistedDiningService.getById( id)); |
| | | } |
| | | } |