-
-
Notifications
You must be signed in to change notification settings - Fork 57
/
SaveVO.vm
53 lines (47 loc) · 1.68 KB
/
SaveVO.vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#if($StringUtils.isNotBlank($tablesConfig.voPackageName))
package $tablesConfig.voPackageName;
#end
#set($useLombok = $tablesConfig.isUseLombok())
#set($useSwaggerUI = $tablesConfig.isUseSwaggerUIComment())
#set($serializable = $tablesConfig.isSerializable())
#if($useLombok)
import lombok.Data;
#end
#if($useSwaggerUI)
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
#end
import ${stringHelper.getJakartaEEClassNameOrNot(${useJakartaEE}, "NotNull")};
import ${stringHelper.getJakartaEEClassNameOrNot(${useJakartaEE}, "NotBlank")};
import ${stringHelper.getJakartaEEClassNameOrNot(${useJakartaEE}, "NotEmpty")};
#if($useLombok)
@Data
#end
#if($useSwaggerUI)
@ApiModel("$LocaleContextHolder.format("controller_save") $table.tableComment")
#end
public class ${table.entityName}${tablesConfig.voSuffixName} #if($serializable) implements java.io.Serializable #end {
#if($serializable)
private static final long serialVersionUID = 1L;
#end
#foreach($column in $table.columns)
#if($tablesConfig.isUseFieldComment() && !$column.columnComment.isEmpty())
/**
* $column.getColumnComment()
*/
#end
#if(!$column.isNullable())
@NotNull(message = "$column.fieldName can not null")
#end
#if($column.isNotBlank())
@NotBlank(message = "$column.fieldName can not blank")
#end
#if($column.isNotEmpty())
@NotEmpty(message = "$column.fieldName can not empty")
#end
#if($useSwaggerUI && !$column.columnComment.isEmpty())
@ApiModelProperty("$column.columnComment")
#end
private $column.javaDataType.name $column.fieldName;
#end
}