Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
b5125880
Commit
b5125880
authored
Jul 14, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成器调整
parent
c475c2f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
Entity.java.vm
...l/yifu-codegen/src/main/resources/template/Entity.java.vm
+20
-11
No files found.
yifu-visual/yifu-codegen/src/main/resources/template/Entity.java.vm
View file @
b5125880
...
...
@@ -42,20 +42,29 @@ import java.math.BigDecimal;
public
class
${
className
}
extends
BaseEntity
{
#
foreach
($
column
in
$
columns
)
##
排除部分字段
#
if
(
!$excludeColumns.contains($column.columnName))
/**
*
$
column
.
comments
*/
#
if
($
column
.
columnName
==
$
pk
.
columnName
)
@
TableId
(
type
=
IdType
.
ASSIGN_ID
)
#
end
@
ExcelAttribute
(
name
=
"$column.comments"
#
if
($
column
.
isNullable
==
'NO'
&&
$
column
.
attrType
!='LocalDate' && $column.attrType !='LocalDateTime'), isNotEmpty = true,errorInfo = "$column.comments不能为空"#end #if($column.maxLength), maxLength = $column.maxLength #end)
##
排除部分字段
#
if
(
!$excludeColumns.contains($column.columnName))
/**
*
$
column
.
comments
*/
#
if
($
column
.
columnName
==
$
pk
.
columnName
)
@
TableId
(
type
=
IdType
.
ASSIGN_ID
)
#
end
#
end
#
if
($
column
.
nullable
)
@
NotBlank
(
message
=
"$column.comments 不能为空"
)
#
end
#
if
($
column
.
maxLength
&&
$
column
.
attrType
==
'String'
)
@
Length
(
max
=$
column
.
maxLength
,
message
=
"$column.comments 不能超过$column.maxLength 个字符"
)
#
end
@
ExcelAttribute
(
name
=
"$column.comments"
#
if
($
column
.
nullable
),
isNotEmpty
=
true
,
errorInfo
=
"$column.comments 不能为空"
#
end
#
if
($
column
.
attrType
==
'LocalDate'
||
$
column
.
attrType
==
'LocalDateTime'
)
,
isDate
=
true
#
end
#
if
($
column
.
maxLength
),
maxLength
=
$
column
.
maxLength
#
end
)
@
Schema
(
description
=
"$column.comments"
#
if
($
column
.
hidden
),
hidden
=$
column
.
hidden
#
end
)
@
ExcelProperty
(
"$column.comments"
)
#
if
($
column
.
attrType
==
'LocalDate'
||
$
column
.
attrType
==
'LocalDateTime'
||
$
column
.
attrType
==
'Date'
)
private
Date
$
column
.
lowerAttrName
;
#
else
private
$
column
.
attrType
$
column
.
lowerAttrName
;
#
end
#
end
#
end
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment