Commit 8db3297800cce6813c1210a600a8c4b8319c034b

Authored by YunaiV
1 parent fade9bce

增加 baseVO.vm 模板

src/main/resources/codegen/controller/vo/baseVO.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 +/**
  9 +* ${table.classComment} Base VO,提供给添加、修改、详细的子 VO 使用
  10 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  11 +*/
  12 +@Data
  13 +public class ${table.className}BaseVO {
  14 +
  15 +#foreach ($column in $columns)
  16 +#if (${column.createOperation} && ${column.updateOperation} && ${column.listOperationResult})##通用操作
  17 + @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end)
  18 +#if (!${column.nullable})#if (${field.fieldType} == 'String')## 判断 @NotEmpty 和 @NotNull 注解
  19 + @NotEmpty(message = "${column.columnComment}不能为空")
  20 +#else
  21 + @NotNull(message = "${column.columnComment}不能为空")
  22 +#end
  23 +#end
  24 + private ${column.javaType} ${column.javaField};
  25 +
  26 +#end
  27 +#end
  28 +}
... ...