代码生成字段编辑页面:插入选项勾选的话,BO字段上会加notblank/notnull的注解,去掉勾选后,字段都不生成了,有没有notblank/notnull注解应该是由必填列控制

This commit is contained in:
keyleaf 2021-05-22 23:02:06 +08:00
parent 1d38d51ac1
commit b1b6b651c2
2 changed files with 4 additions and 0 deletions

View File

@ -29,10 +29,12 @@ public class ${ClassName}AddBo {
#if($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
#end
#if($column.isRequired == 1)
#if($column.javaType == 'String')
@NotBlank(message = "$column.columnComment不能为空")
#else
@NotNull(message = "$column.columnComment不能为空")
#end
#end
private $column.javaType $column.javaField;
#end

View File

@ -29,10 +29,12 @@ public class ${ClassName}EditBo {
#if($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
#end
#if($column.isRequired == 1)
#if($column.javaType == 'String')
@NotBlank(message = "$column.columnComment不能为空")
#else
@NotNull(message = "$column.columnComment不能为空")
#end
#end
private $column.javaType $column.javaField;
#end