Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
4d11b76b
Unverified
提交
4d11b76b
authored
4月 09, 2023
作者:
芋道源码
提交者:
Gitee
4月 09, 2023
浏览文件
操作
浏览文件
下载
差异文件
!32 修复代码生成模板中未更新至swagger3的bug
Merge pull request !32 from sukun/master
上级
32ea8f52
251c217a
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
78 行增加
和
64 行删除
+78
-64
controller.vm
.../src/main/resources/codegen/java/controller/controller.vm
+41
-31
_column.vm
.../src/main/resources/codegen/java/controller/vo/_column.vm
+4
-2
baseVO.vm
...z/src/main/resources/codegen/java/controller/vo/baseVO.vm
+4
-4
createReqVO.vm
.../main/resources/codegen/java/controller/vo/createReqVO.vm
+5
-5
excelVO.vm
.../src/main/resources/codegen/java/controller/vo/excelVO.vm
+5
-6
exportReqVO.vm
.../main/resources/codegen/java/controller/vo/exportReqVO.vm
+5
-4
pageReqVO.vm
...rc/main/resources/codegen/java/controller/vo/pageReqVO.vm
+5
-4
respVO.vm
...z/src/main/resources/codegen/java/controller/vo/respVO.vm
+4
-3
updateReqVO.vm
.../main/resources/codegen/java/controller/vo/updateReqVO.vm
+5
-5
没有找到文件。
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
};
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
import
javax
.
annotation
.
Resource
;
import
org
.
springframework
.
validation
.
annotation
.
Validated
;
#
if
($
sceneEnum
.
scene
==
1
)
import
org
.
springframework
.
security
.
access
.
prepost
.
PreAuthorize
;#
end
import
io
.
swagger
.
annotations
.*;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
Operation
;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
Parameter
;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
tags
.
Tag
;
import
ja
vax
.
validation
.
constraints
.*
;
import
ja
vax
.
validation
.*
;
import
ja
vax
.
servlet
.
http
.*
;
import
ja
karta
.
annotation
.
Resource
;
import
ja
karta
.
servlet
.
http
.
HttpServletResponse
;
import
ja
karta
.
validation
.
Valid
;
import
java
.
util
.*;
import
java
.
io
.
IOException
;
...
...
@@ -22,12 +24,13 @@ import ${ExcelUtilsClassName};
import
${
OperateLogClassName
};
import
static
${
OperateTypeEnumClassName
}.*;
import
${
basePackage
}.
framework
.
operatelog
.
core
.
annotations
.
OperateLog
;
import
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
.*;
import
${
basePackage
}.
module
.${
table
.
moduleName
}.
dal
.
dataobject
.${
table
.
businessName
}.${
table
.
className
}
DO
;
import
${
basePackage
}.
module
.${
table
.
moduleName
}.
convert
.${
table
.
businessName
}.${
table
.
className
}
Convert
;
import
${
basePackage
}.
module
.${
table
.
moduleName
}.
service
.${
table
.
businessName
}.${
table
.
className
}
Service
;
@
Api
(
tags
=
"${sceneEnum.name} - ${table.classComment}"
)
@
Tag
(
name
=
"${sceneEnum.name} - ${table.classComment}"
)
@
RestController
##
二级的
businessName
暂时不算在
HTTP
路径上,可以根据需要写
@
RequestMapping
(
"/${table.moduleName}/${simpleClassName_strikeCase}"
)
...
...
@@ -38,72 +41,79 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
private
${
table
.
className
}
Service
${
classNameVar
}
Service
;
@
PostMapping
(
"/create"
)
@
ApiOperation
(
"创建${table.classComment}"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:create')"
)#
end
@
Operation
(
summary
=
"创建${table.classComment}"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:create')"
)
#
end
public
CommonResult
<${
primaryColumn
.
javaType
}>
create
${
simpleClassName
}(@
Valid
@
RequestBody
${
sceneEnum
.
prefixClass
}${
table
.
className
}
CreateReqVO
createReqVO
)
{
return
success
(${
classNameVar
}
Service
.
create
${
simpleClassName
}(
createReqVO
));
}
@
PutMapping
(
"/update"
)
@
ApiOperation
(
"更新${table.classComment}"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:update')"
)#
end
@
Operation
(
summary
=
"更新${table.classComment}"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:update')"
)
#
end
public
CommonResult
<
Boolean
>
update
${
simpleClassName
}(@
Valid
@
RequestBody
${
sceneEnum
.
prefixClass
}${
table
.
className
}
UpdateReqVO
updateReqVO
)
{
${
classNameVar
}
Service
.
update
${
simpleClassName
}(
updateReqVO
);
return
success
(
true
);
}
@
DeleteMapping
(
"/delete"
)
@
ApiOperation
(
"删除${table.classComment}"
)
@
ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
dataTypeClass
=
${
primaryColumn
.
javaType
}.
class
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:delete')"
)#
end
@
Operation
(
summary
=
"删除${table.classComment}"
)
@
Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:delete')"
)
#
end
public
CommonResult
<
Boolean
>
delete
${
simpleClassName
}(@
RequestParam
(
"id"
)
${
primaryColumn
.
javaType
}
id
)
{
${
classNameVar
}
Service
.
delete
${
simpleClassName
}(
id
);
return
success
(
true
);
}
@
GetMapping
(
"/get"
)
@
ApiOperation
(
"获得${table.classComment}"
)
@
ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
${
primaryColumn
.
javaType
}.
class
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:query')"
)#
end
@
Operation
(
summary
=
"获得${table.classComment}"
)
@
Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:query')"
)
#
end
public
CommonResult
<${
sceneEnum
.
prefixClass
}${
table
.
className
}
RespVO
>
get
${
simpleClassName
}(@
RequestParam
(
"id"
)
${
primaryColumn
.
javaType
}
id
)
{
${
table
.
className
}
DO
${
classNameVar
}
=
${
classNameVar
}
Service
.
get
${
simpleClassName
}(
id
);
return
success
(${
table
.
className
}
Convert
.
INSTANCE
.
convert
(${
classNameVar
}));
}
@
GetMapping
(
"/list"
)
@
ApiOperation
(
"获得${table.classComment}列表"
)
@
ApiImplicitParam
(
name
=
"ids"
,
value
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
,
dataTypeClass
=
List
.
class
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:query')"
)#
end
@
Operation
(
summary
=
"获得${table.classComment}列表"
)
@
Parameter
(
name
=
"ids"
,
description
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:query')"
)
#
end
public
CommonResult
<
List
<${
sceneEnum
.
prefixClass
}${
table
.
className
}
RespVO
>>
get
${
simpleClassName
}
List
(@
RequestParam
(
"ids"
)
Collection
<${
primaryColumn
.
javaType
}>
ids
)
{
List
<${
table
.
className
}
DO
>
list
=
${
classNameVar
}
Service
.
get
${
simpleClassName
}
List
(
ids
);
return
success
(${
table
.
className
}
Convert
.
INSTANCE
.
convertList
(
list
));
}
@
GetMapping
(
"/page"
)
@
ApiOperation
(
"获得${table.classComment}分页"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:query')"
)#
end
@
Operation
(
summary
=
"获得${table.classComment}分页"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:query')"
)
#
end
public
CommonResult
<
PageResult
<${
sceneEnum
.
prefixClass
}${
table
.
className
}
RespVO
>>
get
${
simpleClassName
}
Page
(@
Valid
${
sceneEnum
.
prefixClass
}${
table
.
className
}
PageReqVO
pageVO
)
{
PageResult
<${
table
.
className
}
DO
>
pageResult
=
${
classNameVar
}
Service
.
get
${
simpleClassName
}
Page
(
pageVO
);
return
success
(${
table
.
className
}
Convert
.
INSTANCE
.
convertPage
(
pageResult
));
}
@
GetMapping
(
"/export-excel"
)
@
ApiOperation
(
"导出${table.classComment} Excel"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:export')"
)#
end
@
Operation
(
summary
=
"导出${table.classComment} Excel"
)
#
if
($
sceneEnum
.
scene
==
1
)
@
PreAuthorize
(
"@ss.hasPermission('${permissionPrefix}:export')"
)
#
end
@
OperateLog
(
type
=
EXPORT
)
public
void
export
${
simpleClassName
}
Excel
(@
Valid
${
sceneEnum
.
prefixClass
}${
table
.
className
}
ExportReqVO
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
List
<${
table
.
className
}
DO
>
list
=
${
classNameVar
}
Service
.
get
${
simpleClassName
}
List
(
exportReqVO
);
//
导出
Excel
List
<${
sceneEnum
.
prefixClass
}${
table
.
className
}
ExcelVO
>
datas
=
${
table
.
className
}
Convert
.
INSTANCE
.
convertList02
(
list
);
ExcelUtils
.
write
(
response
,
"${table.classComment}.xls"
,
"数据"
,
${
sceneEnum
.
prefixClass
}${
table
.
className
}
ExcelVO
.
class
,
datas
);
ExcelUtils
.
write
(
response
,
"${table.classComment}.xls"
,
"数据"
,
${
sceneEnum
.
prefixClass
}${
table
.
className
}
ExcelVO
.
class
,
datas
);
}
}
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm
浏览文件 @
4d11b76b
## @formatter:off
## 提供给 baseVO、createVO、updateVO 生成字段
@
ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true
#end#if ("$!column.example" != ""), example = "${column.example}"#end)
@
Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED
#end#if ("$!column.example" != ""), example = "${column.example}"#end)
#if (!${column.nullable})## 判断 @NotEmpty 和 @NotNull 注解
#if (${field.fieldType} == 'String')
@NotEmpty(message = "${column.columnComment}不能为空")
...
...
@@ -10,4 +11,4 @@
#if (${column.javaType} == "LocalDateTime")## 时间类型
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
#end
private ${column.javaType} ${column.javaField};
private ${column.javaType} ${column.javaField};
\ No newline at end of file
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
;
import
lombok
.*;
...
...
@@ -10,12 +11,11 @@ import java.math.BigDecimal;
import
java
.
time
.
LocalDateTime
;
#
end
#
end
import
io
.
swagger
.
annotations
.*
;
import
ja
vax
.
validation
.
constraints
.*;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Schema
;
import
ja
karta
.
validation
.
constraints
.*;
##
处理
Date
字段的引入
#
foreach
($
column
in
$
columns
)
#
if
(${
column
.
createOperation
}
&&
${
column
.
updateOperation
}
&&
${
column
.
listOperationResult
}
&&
${
column
.
javaType
}
==
"LocalDateTime"
)##
时间类型
#
if
(${
column
.
createOperation
}
&&
${
column
.
updateOperation
}
&&
${
column
.
listOperationResult
}
&&
${
column
.
javaType
}
==
"LocalDateTime"
)##
时间类型
import
org
.
springframework
.
format
.
annotation
.
DateTimeFormat
;
import
static
${
DateUtilsClassName
}.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
...
...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/createReqVO.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
;
import
lombok
.*;
import
java
.
util
.*;
import
io
.
swagger
.
annotations
.*
;
import
ja
vax
.
validation
.
constraints
.*;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Schema
;
import
ja
karta
.
validation
.
constraints
.*;
##
处理
Date
字段的引入
#
foreach
($
column
in
$
columns
)
#
if
(${
column
.
createOperation
}
&&
(
!${column.updateOperation} || !${column.listOperationResult})
&&
${
column
.
javaType
}
==
"LocalDateTime"
)##
时间类型
#
if
(${
column
.
createOperation
}
&&
(
!${column.updateOperation} || !${column.listOperationResult}) && ${column.javaType} == "LocalDateTime")## 时间类型
import
org
.
springframework
.
format
.
annotation
.
DateTimeFormat
;
import
java
.
time
.
LocalDateTime
;
import
static
${
DateUtilsClassName
}.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
...
...
@@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
#
end
#
end
@
ApiModel
(
"${sceneEnum.name} - ${table.classComment}创建 Request VO"
)
@
Schema
(
name
=
"${sceneEnum.name} - ${table.classComment}创建 Request VO"
)
@
Data
@
EqualsAndHashCode
(
callSuper
=
true
)
@
ToString
(
callSuper
=
true
)
...
...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
;
import
lombok
.*;
...
...
@@ -10,8 +11,6 @@ import java.math.BigDecimal;
import
java
.
time
.
LocalDateTime
;
#
end
#
end
import
io
.
swagger
.
annotations
.*;
import
com
.
alibaba
.
excel
.
annotation
.
ExcelProperty
;
#
foreach
($
column
in
$
columns
)
#
if
(
"$!column.dictType"
!= "")## 有设置数据字典
...
...
@@ -23,10 +22,10 @@ import ${DictConvertClassName};
#
end
/**
*
${
table
.
classComment
}
Excel
VO
*
*
@
author
${
table
.
author
}
*/
*
${
table
.
classComment
}
Excel
VO
*
*
@
author
${
table
.
author
}
*/
@
Data
public
class
${
sceneEnum
.
prefixClass
}${
table
.
className
}
ExcelVO
{
...
...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
;
import
lombok
.*;
import
java
.
util
.*;
import
io
.
swagger
.
annotations
.*
;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Schema
;
import
${
PageParamClassName
};
##
处理
Date
字段的引入
#
foreach
($
column
in
$
columns
)
...
...
@@ -16,18 +17,18 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
#
end
##
字段模板
#
macro
(
columnTpl
$
prefix
$
prefixStr
)
@
ApiModelProperty
(
value
=
"${prefixStr}${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
@
Schema
(
description
=
"${prefixStr}${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
private
${
column
.
javaType
}#
if
(
"$!prefix"
!= "") ${prefix}${JavaField}#else ${column.javaField}#end;
#
end
@
ApiModel
(
valu
e
=
"${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO"
,
description
=
"参数和 ${table.className}PageReqVO 是一致的"
)
@
Schema
(
nam
e
=
"${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO"
,
description
=
"参数和 ${table.className}PageReqVO 是一致的"
)
@
Data
public
class
${
sceneEnum
.
prefixClass
}${
table
.
className
}
ExportReqVO
{
#
foreach
($
column
in
$
columns
)
#
if
(${
column
.
listOperation
})##
查询操作
#
if
(${
column
.
listOperationCondition
}
==
"BETWEEN"
)##
情况一,
Between
的时候
@
ApiModelProperty
(
value
=
"${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
@
Schema
(
description
=
"${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
@
DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
${
column
.
javaType
}[]
${
column
.
javaField
};
#
else
##
情况二,非
Between
的时间
...
...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
;
import
lombok
.*;
import
java
.
util
.*;
import
io
.
swagger
.
annotations
.*
;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Schema
;
import
${
PageParamClassName
};
##
处理
Date
字段的引入
#
foreach
($
column
in
$
columns
)
...
...
@@ -16,11 +17,11 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
#
end
##
字段模板
#
macro
(
columnTpl
$
prefix
$
prefixStr
)
@
ApiModelProperty
(
value
=
"${prefixStr}${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
@
Schema
(
description
=
"${prefixStr}${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
private
${
column
.
javaType
}#
if
(
"$!prefix"
!= "") ${prefix}${JavaField}#else ${column.javaField}#end;
#
end
@
ApiModel
(
"${sceneEnum.name} - ${table.classComment}分页 Request VO"
)
@
Schema
(
name
=
"${sceneEnum.name} - ${table.classComment}分页 Request VO"
)
@
Data
@
EqualsAndHashCode
(
callSuper
=
true
)
@
ToString
(
callSuper
=
true
)
...
...
@@ -29,7 +30,7 @@ public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PagePar
#
foreach
($
column
in
$
columns
)
#
if
(${
column
.
listOperation
})##
查询操作
#
if
(${
column
.
listOperationCondition
}
==
"BETWEEN"
)##
情况一,
Between
的时候
@
ApiModelProperty
(
value
=
"${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
@
Schema
(
description
=
"${column.columnComment}"
#
if
(
"$!column.example"
!= ""), example = "${column.example}"#end)
@
DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
${
column
.
javaType
}[]
${
column
.
javaField
};
#
else
##
情况二,非
Between
的时间
...
...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
;
import
lombok
.*;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Schema
;
#
foreach
($
column
in
$
columns
)
#
if
(${
column
.
javaType
}
==
"LocalDateTime"
)
import
java
.
time
.
LocalDateTime
;
#
break
#
end
#
end
import
io
.
swagger
.
annotations
.*;
@
ApiModel
(
"${sceneEnum.name} - ${table.classComment} Response VO"
)
@
Schema
(
name
=
"${sceneEnum.name} - ${table.classComment} Response VO"
)
@
Data
@
EqualsAndHashCode
(
callSuper
=
true
)
@
ToString
(
callSuper
=
true
)
...
...
@@ -17,7 +18,7 @@ public class ${sceneEnum.prefixClass}${table.className}RespVO extends ${sceneEnu
#
foreach
($
column
in
$
columns
)
#
if
(${
column
.
listOperationResult
}
&&
(
!${column.createOperation} || !${column.updateOperation}))##不是通用字段
@
ApiModelProperty
(
value
=
"${column.columnComment}"
#
if
(
!${column.nullable}), required = true
#end#if ("$!column.example" != ""), example = "${column.example}"#end)
@
Schema
(
description
=
"${column.columnComment}"
#
if
(
!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED
#end#if ("$!column.example" != ""), example = "${column.example}"#end)
private
${
column
.
javaType
}
${
column
.
javaField
};
#
end
...
...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/updateReqVO.vm
浏览文件 @
4d11b76b
##
@
formatter
:
off
package
${
basePackage
}.
module
.${
table
.
moduleName
}.
controller
.${
sceneEnum
.
basePackage
}.${
table
.
businessName
}.
vo
;
import
lombok
.*;
import
java
.
util
.*;
import
io
.
swagger
.
annotations
.*
;
import
ja
vax
.
validation
.
constraints
.*;
import
io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Schema
;
import
ja
karta
.
validation
.
constraints
.*;
##
处理
Date
字段的引入
#
foreach
($
column
in
$
columns
)
#
if
(${
column
.
updateOperation
}
&&
(
!${column.createOperation} || !${column.listOperationResult})
&&
${
column
.
javaType
}
==
"LocalDateTime"
)##
时间类型
#
if
(${
column
.
updateOperation
}
&&
(
!${column.createOperation} || !${column.listOperationResult}) && ${column.javaType} == "LocalDateTime")## 时间类型
import
org
.
springframework
.
format
.
annotation
.
DateTimeFormat
;
import
java
.
time
.
LocalDateTime
;
import
static
${
DateUtilsClassName
}.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
...
...
@@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
#
end
#
end
@
ApiModel
(
"${sceneEnum.name} - ${table.classComment}更新 Request VO"
)
@
Schema
(
name
=
"${sceneEnum.name} - ${table.classComment}更新 Request VO"
)
@
Data
@
EqualsAndHashCode
(
callSuper
=
true
)
@
ToString
(
callSuper
=
true
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论