模板调整
This commit is contained in:
@@ -51,6 +51,9 @@ public class ${table.controllerName} {
|
||||
|
||||
<% if(isNotEmpty(controllerMethods.list)){ %>
|
||||
@GetMapping(value = "/list")
|
||||
<% if(!restControllerStyle){ %>
|
||||
@ResponseBody
|
||||
<% } %>
|
||||
public CommonResult.Pagination<${table.entityName}> list(Page<${table.entityName}> page) {
|
||||
CommonResult.Pagination<${table.entityName}> pagination = CommonResult.Pagination.init();
|
||||
page.transferOrderField(${table.entityName}.class);
|
||||
@@ -61,6 +64,9 @@ public class ${table.controllerName} {
|
||||
|
||||
<% if(isNotEmpty(controllerMethods.getById)){ %>
|
||||
@GetMapping(value = "/{id}")
|
||||
<% if(!restControllerStyle){ %>
|
||||
@ResponseBody
|
||||
<% } %>
|
||||
public CommonResult.Single<${table.entityName}> getById(@PathVariable("id") Serializable id) {
|
||||
CommonResult.Single<${table.entityName}> single = CommonResult.Single.init();
|
||||
return single.data(${serviceInstanceName}.getById(id)).message("查询成功");
|
||||
@@ -68,6 +74,9 @@ public class ${table.controllerName} {
|
||||
<% } %>
|
||||
|
||||
<% if(isNotEmpty(controllerMethods.create)){ %>
|
||||
<% if(!restControllerStyle){ %>
|
||||
@ResponseBody
|
||||
<% } %>
|
||||
@PostMapping(value = "/insert")
|
||||
public CommonResult.Single<${table.entityName}> insert(${table.entityName} ${entityInstanceName}) {
|
||||
CommonResult.Single<${table.entityName}> single = CommonResult.Single.init();
|
||||
@@ -78,6 +87,9 @@ public class ${table.controllerName} {
|
||||
|
||||
<% if(isNotEmpty(controllerMethods.delete)){ %>
|
||||
@GetMapping(value = "/delete/{id}")
|
||||
<% if(!restControllerStyle){ %>
|
||||
@ResponseBody
|
||||
<% } %>
|
||||
public CommonResult.Single<Serializable> delete(@PathVariable("id") Serializable id) {
|
||||
CommonResult.Single<Serializable> single = CommonResult.Single.init();
|
||||
${serviceInstanceName}.removeById(id);
|
||||
@@ -87,6 +99,9 @@ public class ${table.controllerName} {
|
||||
|
||||
<% if(isNotEmpty(controllerMethods.update)){ %>
|
||||
@PostMapping(value = "/update")
|
||||
<% if(!restControllerStyle){ %>
|
||||
@ResponseBody
|
||||
<% } %>
|
||||
public CommonResult.Single<${table.entityName}> update(${table.entityName} ${entityInstanceName}) {
|
||||
CommonResult.Single<${table.entityName}> single = CommonResult.Single.init();
|
||||
${serviceInstanceName}.updateById(${entityInstanceName});
|
||||
|
||||
Reference in New Issue
Block a user