Browse Source

📝 更新 README.md

pull/1/head
Yangkai.Shen 5 years ago
parent
commit
2f43331ce8
2 changed files with 18 additions and 8 deletions
  1. +13
    -4
      spring-boot-demo-codegen/src/main/resources/template/Controller.java.vm
  2. +5
    -4
      spring-boot-demo-codegen/src/main/resources/template/Entity.java.vm

+ 13
- 4
spring-boot-demo-codegen/src/main/resources/template/Controller.java.vm View File

@@ -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}));
}


+ 5
- 4
spring-boot-demo-codegen/src/main/resources/template/Entity.java.vm View File

@@ -7,8 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;

.${moduleName}.entity;
#if(${hasBigDecimal})
#end
#if(${hasBigDecimal})
#end

/**
* <p>
@@ -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



Loading…
Cancel
Save