From 612861c9555123b0eb623bf8e196a9b873e70ffc Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 6 Feb 2021 11:24:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20createReqVO.vm=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20updateReqVO.vm=20=E5=A2=9E=E5=8A=A0=20respVO.vm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codegen/controller/vo/createReqVO.vm | 27 +++++++++++++++++++ .../resources/codegen/controller/vo/respVO.vm | 20 ++++++++++++++ .../codegen/controller/vo/updateReqVO.vm | 21 +++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 src/main/resources/codegen/controller/vo/createReqVO.vm create mode 100644 src/main/resources/codegen/controller/vo/respVO.vm create mode 100644 src/main/resources/codegen/controller/vo/updateReqVO.vm diff --git a/src/main/resources/codegen/controller/vo/createReqVO.vm b/src/main/resources/codegen/controller/vo/createReqVO.vm new file mode 100644 index 0000000000..d59f20bbd4 --- /dev/null +++ b/src/main/resources/codegen/controller/vo/createReqVO.vm @@ -0,0 +1,27 @@ +package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("${table.classComment}创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ${table.className}CreateReqVO extends ${table.className}BaseVO { + +#foreach ($column in $columns) +#if (${column.createOperation} && (!${column.updateOperation} || !${column.listOperationResult}))##不是通用字段 + @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) +#if (!${column.nullable})#if (${field.fieldType} == 'String')## 判断 @NotEmpty 和 @NotNull 注解 + @NotEmpty(message = "${column.columnComment}不能为空") +#else + @NotNull(message = "${column.columnComment}不能为空") +#end +#end + private ${column.javaType} ${column.javaField}; + +#end +#end +} diff --git a/src/main/resources/codegen/controller/vo/respVO.vm b/src/main/resources/codegen/controller/vo/respVO.vm new file mode 100644 index 0000000000..9176c073f6 --- /dev/null +++ b/src/main/resources/codegen/controller/vo/respVO.vm @@ -0,0 +1,20 @@ +package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("${table.classComment} Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ${table.className}RespVO extends ${table.className}BaseVO { + +#foreach ($column in $columns) +#if (${column.listOperationResult} && (!${column.createOperation} || !${column.updateOperation}))##不是通用字段 + @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) + private ${column.javaType} ${column.javaField}; + +#end +#end +} diff --git a/src/main/resources/codegen/controller/vo/updateReqVO.vm b/src/main/resources/codegen/controller/vo/updateReqVO.vm new file mode 100644 index 0000000000..6108b4621e --- /dev/null +++ b/src/main/resources/codegen/controller/vo/updateReqVO.vm @@ -0,0 +1,21 @@ +package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("${table.classComment}更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ${table.className}UpdateReqVO extends ${table.className}BaseVO { + +#foreach ($column in $columns) +#if (${column.updateOperation} && (!${column.createOperation} || !${column.listOperationResult}))##不是通用字段 + @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) + private ${column.javaType} ${column.javaField}; + +#end +#end +}