From 2f43331ce82e134ef1560808743e25881145c81b Mon Sep 17 00:00:00 2001 From: "Yangkai.Shen" <237497819@qq.com> Date: Tue, 26 Mar 2019 21:27:14 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/template/Controller.java.vm | 17 +++++++++++++---- .../src/main/resources/template/Entity.java.vm | 9 +++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/spring-boot-demo-codegen/src/main/resources/template/Controller.java.vm b/spring-boot-demo-codegen/src/main/resources/template/Controller.java.vm index bceb66b..18c604c 100755 --- a/spring-boot-demo-codegen/src/main/resources/template/Controller.java.vm +++ b/spring-boot-demo-codegen/src/main/resources/template/Controller.java.vm @@ -44,7 +44,10 @@ public class ${className}Controller { */ @GetMapping("") @ApiOperation(value = "分页查询${comments}", notes = "分页查询${comments}") - @ApiImplicitParams({@ApiImplicitParam(name = "page", value = "分页参数", required = true), @ApiImplicitParam(name = "${classname}", value = "查询条件", required = true)}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "分页参数", required = true), + @ApiImplicitParam(name = "${classname}", value = "查询条件", required = true) + }) public R list${className}(Page page, ${className} ${classname}) { return new R<>(${classname}Service.page(page,Wrappers.query(${classname}))); } @@ -57,7 +60,9 @@ public class ${className}Controller { */ @GetMapping("/{${pk.lowerAttrName}}") @ApiOperation(value = "通过id查询${comments}", notes = "通过id查询${comments}") - @ApiImplicitParams({@ApiImplicitParam(name = "${pk.lowerAttrName}", value = "主键id", required = true)}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "${pk.lowerAttrName}", value = "主键id", required = true) + }) public R get${className}(@PathVariable("${pk.lowerAttrName}") ${pk.attrType} ${pk.lowerAttrName}){ return new R<>(${classname}Service.getById(${pk.lowerAttrName})); } @@ -83,7 +88,9 @@ public class ${className}Controller { @ApiLog("修改${comments}") @PutMapping("/{${pk.lowerAttrName}}") @ApiOperation(value = "修改${comments}", notes = "修改${comments}") - @ApiImplicitParams({@ApiImplicitParam(name = "${pk.lowerAttrName}", value = "主键id", required = true)}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "${pk.lowerAttrName}", value = "主键id", required = true) + }) public R update${className}(@PathVariable ${pk.attrType} ${pk.lowerAttrName}, @RequestBody ${className} ${classname}){ return new R<>(${classname}Service.updateById(${classname})); } @@ -96,7 +103,9 @@ public class ${className}Controller { @ApiLog("删除${comments}") @DeleteMapping("/{${pk.lowerAttrName}}") @ApiOperation(value = "删除${comments}", notes = "删除${comments}") - @ApiImplicitParams({@ApiImplicitParam(name = "${pk.lowerAttrName}", value = "主键id", required = true)}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "${pk.lowerAttrName}", value = "主键id", required = true) + }) public R delete${className}(@PathVariable ${pk.attrType} ${pk.lowerAttrName}){ return new R<>(${classname}Service.removeById(${pk.lowerAttrName})); } diff --git a/spring-boot-demo-codegen/src/main/resources/template/Entity.java.vm b/spring-boot-demo-codegen/src/main/resources/template/Entity.java.vm index 7b93435..77d8590 100755 --- a/spring-boot-demo-codegen/src/main/resources/template/Entity.java.vm +++ b/spring-boot-demo-codegen/src/main/resources/template/Entity.java.vm @@ -7,8 +7,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; .${moduleName}.entity; -#if(${hasBigDecimal}) -#end + #if(${hasBigDecimal}) + #end /** *

@@ -24,7 +24,8 @@ import lombok.EqualsAndHashCode; * @modified: ${author} */ @Data -@TableName("${tableName}") @ApiModel(description = "${comments}") +@TableName("${tableName}") +@ApiModel(description = "${comments}") @EqualsAndHashCode(callSuper = true) public class ${className} extends Model<${className}> { private static final long serialVersionUID = 1L; @@ -36,7 +37,7 @@ public class ${className} extends Model<${className}> { #if($column.columnName == $pk.columnName) @TableId #end - @ApiModelProperty(value = "$column.comments") + @ApiModelProperty(value = "$column.comments") private $column.attrType $column.lowerAttrName; #end