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