|
@@ -40,28 +40,33 @@ public class ${table.controllerName} {
|
|
|
|
|
|
@PostMapping
|
|
|
public Boolean save(@RequestBody ${entity} ${table.entityPath}) {
|
|
|
- return ${table.entityPath}Service.saveOrUpdate(${table.entityPath});
|
|
|
+ return ${table.entityPath}Service.saveOrUpdate(${table.entityPath});
|
|
|
}
|
|
|
|
|
|
@DeleteMapping("/{id}")
|
|
|
public Boolean delete(@PathVariable Integer id) {
|
|
|
- return ${table.entityPath}Service.removeById(id);
|
|
|
+ return ${table.entityPath}Service.removeById(id);
|
|
|
}
|
|
|
|
|
|
@GetMapping
|
|
|
public List<${entity}> findAll() {
|
|
|
- return ${table.entityPath}Service.list();
|
|
|
+ return ${table.entityPath}Service.list();
|
|
|
}
|
|
|
|
|
|
@GetMapping("/{id}")
|
|
|
public ${entity} findOne(@PathVariable Integer id) {
|
|
|
- return ${table.entityPath}Service.getById(id);
|
|
|
+ return ${table.entityPath}Service.getById(id);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
public Page<${entity}> findPage(@RequestParam Integer pageNum,
|
|
|
@RequestParam Integer pageSize) {
|
|
|
- return ${table.entityPath}Service.page(new Page<>(pageNum, pageSize));
|
|
|
+ return ${table.entityPath}Service.page(new Page<>(pageNum, pageSize));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/delete/batch")
|
|
|
+ public Boolean deleteBatch(List<Integer> ids) {
|
|
|
+ return ${table.entityPath}Service.removeBatchByIds(ids);
|
|
|
}
|
|
|
}
|
|
|
</#if>
|