|
|
|
@ -66,40 +66,38 @@ public class ${entityName}Controller extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询所有数据
|
|
|
|
* 全部
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation("查询所有数据")
|
|
|
|
@ApiOperation("全部")
|
|
|
|
@GetMapping("/listAll")
|
|
|
|
@GetMapping("/listAll")
|
|
|
|
public AjaxResult listAll() {
|
|
|
|
public AjaxResult listAll() {
|
|
|
|
return AjaxResult.success(${entityName?uncap_first}Service.list());
|
|
|
|
return AjaxResult.success(${entityName?uncap_first}Service.list());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据id获取
|
|
|
|
* 详情
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation("根据id获取")
|
|
|
|
@ApiOperation("详情")
|
|
|
|
@GetMapping(value = "/{id}")
|
|
|
|
@GetMapping(value = "/{id}")
|
|
|
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
|
|
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
|
|
|
return AjaxResult.success(${entityName?uncap_first}Service.getById(id));
|
|
|
|
return AjaxResult.success(${entityName?uncap_first}Service.getById(id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 添加
|
|
|
|
* 新增
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param ${entityName?uncap_first}
|
|
|
|
* @param ${entityName?uncap_first}
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="添加", notes="添加")
|
|
|
|
@ApiOperation(value="新增", notes="新增")
|
|
|
|
@Log(title = "添加", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "新增", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping
|
|
|
|
@PostMapping
|
|
|
|
public AjaxResult add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
|
|
|
public AjaxResult add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
|
|
|
${entityName?uncap_first}Service.save(${entityName?uncap_first});
|
|
|
|
${entityName?uncap_first}Service.save(${entityName?uncap_first});
|
|
|
|
return AjaxResult.success("添加成功");
|
|
|
|
return AjaxResult.success("新增成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 编辑
|
|
|
|
* 编辑
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param ${entityName?uncap_first}
|
|
|
|
* @param ${entityName?uncap_first}
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -112,13 +110,12 @@ public class ${entityName}Controller extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 通过id删除
|
|
|
|
* 删除
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param id
|
|
|
|
* @param id
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Log(title = "通过id删除", businessType = BusinessType.DELETE)
|
|
|
|
@Log(title = "删除", businessType = BusinessType.DELETE)
|
|
|
|
@ApiOperation(value="通过id删除", notes="通过id删除")
|
|
|
|
@ApiOperation(value="删除", notes="删除")
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
public AjaxResult delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
public AjaxResult delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
${entityName?uncap_first}Service.removeById(id);
|
|
|
|
${entityName?uncap_first}Service.removeById(id);
|
|
|
|
@ -127,7 +124,6 @@ public class ${entityName}Controller extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 批量删除
|
|
|
|
* 批量删除
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param ids
|
|
|
|
* @param ids
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|