From 8db3297800cce6813c1210a600a8c4b8319c034b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 6 Feb 2021 10:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20baseVO.vm=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/codegen/controller/vo/baseVO.vm | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/resources/codegen/controller/vo/baseVO.vm diff --git a/src/main/resources/codegen/controller/vo/baseVO.vm b/src/main/resources/codegen/controller/vo/baseVO.vm new file mode 100644 index 000000000..e0f64fc3f --- /dev/null +++ b/src/main/resources/codegen/controller/vo/baseVO.vm @@ -0,0 +1,28 @@ +package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* ${table.classComment} Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class ${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 +}