Commit 612861c9555123b0eb623bf8e196a9b873e70ffc
1 parent
8db32978
增加 createReqVO.vm
增加 updateReqVO.vm 增加 respVO.vm
Showing
3 changed files
with
68 additions
and
0 deletions
src/main/resources/codegen/controller/vo/createReqVO.vm
0 → 100644
| 1 | +package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.annotations.*; | |
| 6 | +import javax.validation.constraints.*; | |
| 7 | + | |
| 8 | +@ApiModel("${table.classComment}创建 Request VO") | |
| 9 | +@Data | |
| 10 | +@EqualsAndHashCode(callSuper = true) | |
| 11 | +@ToString(callSuper = true) | |
| 12 | +public class ${table.className}CreateReqVO extends ${table.className}BaseVO { | |
| 13 | + | |
| 14 | +#foreach ($column in $columns) | |
| 15 | +#if (${column.createOperation} && (!${column.updateOperation} || !${column.listOperationResult}))##不是通用字段 | |
| 16 | + @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) | |
| 17 | +#if (!${column.nullable})#if (${field.fieldType} == 'String')## 判断 @NotEmpty 和 @NotNull 注解 | |
| 18 | + @NotEmpty(message = "${column.columnComment}不能为空") | |
| 19 | +#else | |
| 20 | + @NotNull(message = "${column.columnComment}不能为空") | |
| 21 | +#end | |
| 22 | +#end | |
| 23 | + private ${column.javaType} ${column.javaField}; | |
| 24 | + | |
| 25 | +#end | |
| 26 | +#end | |
| 27 | +} | ... | ... |
src/main/resources/codegen/controller/vo/respVO.vm
0 → 100644
| 1 | +package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.annotations.*; | |
| 6 | + | |
| 7 | +@ApiModel("${table.classComment} Response VO") | |
| 8 | +@Data | |
| 9 | +@EqualsAndHashCode(callSuper = true) | |
| 10 | +@ToString(callSuper = true) | |
| 11 | +public class ${table.className}RespVO extends ${table.className}BaseVO { | |
| 12 | + | |
| 13 | +#foreach ($column in $columns) | |
| 14 | +#if (${column.listOperationResult} && (!${column.createOperation} || !${column.updateOperation}))##不是通用字段 | |
| 15 | + @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) | |
| 16 | + private ${column.javaType} ${column.javaField}; | |
| 17 | + | |
| 18 | +#end | |
| 19 | +#end | |
| 20 | +} | ... | ... |
src/main/resources/codegen/controller/vo/updateReqVO.vm
0 → 100644
| 1 | +package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.annotations.*; | |
| 6 | +import javax.validation.constraints.*; | |
| 7 | + | |
| 8 | +@ApiModel("${table.classComment}更新 Request VO") | |
| 9 | +@Data | |
| 10 | +@EqualsAndHashCode(callSuper = true) | |
| 11 | +@ToString(callSuper = true) | |
| 12 | +public class ${table.className}UpdateReqVO extends ${table.className}BaseVO { | |
| 13 | + | |
| 14 | +#foreach ($column in $columns) | |
| 15 | +#if (${column.updateOperation} && (!${column.createOperation} || !${column.listOperationResult}))##不是通用字段 | |
| 16 | + @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) | |
| 17 | + private ${column.javaType} ${column.javaField}; | |
| 18 | + | |
| 19 | +#end | |
| 20 | +#end | |
| 21 | +} | ... | ... |