master
周文涛 2 years ago
parent 925fb82593
commit f59325c5ae

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

Loading…
Cancel
Save