From 7c47fd47c1514b44435d501f593f8b9a3af81ea1 Mon Sep 17 00:00:00 2001 From: baayso Date: Tue, 25 Apr 2023 21:28:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=EF=BC=9A=E8=A7=A3=E5=86=B3Java=E4=BB=A3=E7=A0=81DO=E5=92=8CVO?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E8=AD=A6=E5=91=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/codegen/java/controller/vo/_column.vm | 2 +- .../main/resources/codegen/java/controller/vo/baseVO.vm | 6 +++--- .../resources/codegen/java/controller/vo/pageReqVO.vm | 2 ++ .../src/main/resources/codegen/java/dal/do.vm | 2 ++ .../src/main/resources/codegen/java/test/serviceTest.vm | 8 ++++---- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm index 89a8e348f..98b09f272 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm @@ -1,5 +1,5 @@ ## 提供给 baseVO、createVO、updateVO 生成字段 - @Schema(description = "${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}不能为空") diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm index e2c1f0b39..cc612e337 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm @@ -24,9 +24,9 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; #end /** -* ${table.classComment} Base VO,提供给添加、修改、详细的子 VO 使用 -* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 -*/ + * ${table.classComment} Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ @Data public class ${sceneEnum.prefixClass}${table.className}BaseVO { diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm index 6f9868da3..39a8e7684 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm @@ -26,6 +26,8 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @ToString(callSuper = true) public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PageParam { + private static final long serialVersionUID = 1L; + #foreach ($column in $columns) #if (${column.listOperation})##查询操作 #if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm index d551d4b30..4d2157d97 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm @@ -28,6 +28,8 @@ import ${BaseDOClassName}; @AllArgsConstructor public class ${table.className}DO extends BaseDO { + private static final long serialVersionUID = 1L; + #foreach ($column in $columns) #if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段 /** diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm index 4d9a5e572..ec1b45a96 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm @@ -61,10 +61,10 @@ import static org.mockito.Mockito.*; #end #end /** -* {@link ${table.className}ServiceImpl} 的单元测试类 -* -* @author ${table.author} -*/ + * {@link ${table.className}ServiceImpl} 的单元测试类 + * + * @author ${table.author} + */ @Import(${table.className}ServiceImpl.class) public class ${table.className}ServiceImplTest extends BaseDbUnitTest {