【发布时间】:2019-10-16 23:18:48
【问题描述】:
如果IDs,我想实现删除列表的端点
@DeleteMapping("/contracts/remove/{id}")
public ResponseEntity<?> remove(@PathVariable Integer id) {
contractsTerminalsService.delete(id);
return ResponseEntity.noContent().build();
}
如何发送这样的 ID 列表:
POST /api/contracts/bulk_delete
with body { ids: [1,5,6] }
实现这一点的正确方法是什么?
【问题讨论】:
-
这里有一个完整的解决方案pastebin.com/Q0Awn1CQ
标签: java spring spring-boot spring-restcontroller