Commit 5fb77df903101ad6f542837fc30e75a58408e897
Committed by
Gitee
!470 fix: 代码生成:解决Java代码DO和VO中的警告
Merge pull request !470 from baayso/master
Showing
5 changed files
with
12 additions
and
8 deletions
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm
| 1 | 1 | ## 提供给 baseVO、createVO、updateVO 生成字段 |
| 2 | - @Schema(description = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) | |
| 2 | + @Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end) | |
| 3 | 3 | #if (!${column.nullable})## 判断 @NotEmpty 和 @NotNull 注解 |
| 4 | 4 | #if (${field.fieldType} == 'String') |
| 5 | 5 | @NotEmpty(message = "${column.columnComment}不能为空") | ... | ... |
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; |
| 24 | 24 | #end |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | -* ${table.classComment} Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 28 | -* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 29 | -*/ | |
| 27 | + * ${table.classComment} Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 28 | + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 29 | + */ | |
| 30 | 30 | @Data |
| 31 | 31 | public class ${sceneEnum.prefixClass}${table.className}BaseVO { |
| 32 | 32 | ... | ... |
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; |
| 26 | 26 | @ToString(callSuper = true) |
| 27 | 27 | public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PageParam { |
| 28 | 28 | |
| 29 | + private static final long serialVersionUID = 1L; | |
| 30 | + | |
| 29 | 31 | #foreach ($column in $columns) |
| 30 | 32 | #if (${column.listOperation})##查询操作 |
| 31 | 33 | #if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候 | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm
| ... | ... | @@ -28,6 +28,8 @@ import ${BaseDOClassName}; |
| 28 | 28 | @AllArgsConstructor |
| 29 | 29 | public class ${table.className}DO extends BaseDO { |
| 30 | 30 | |
| 31 | + private static final long serialVersionUID = 1L; | |
| 32 | + | |
| 31 | 33 | #foreach ($column in $columns) |
| 32 | 34 | #if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段 |
| 33 | 35 | /** | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm
| ... | ... | @@ -61,10 +61,10 @@ import static org.mockito.Mockito.*; |
| 61 | 61 | #end |
| 62 | 62 | #end |
| 63 | 63 | /** |
| 64 | -* {@link ${table.className}ServiceImpl} 的单元测试类 | |
| 65 | -* | |
| 66 | -* @author ${table.author} | |
| 67 | -*/ | |
| 64 | + * {@link ${table.className}ServiceImpl} 的单元测试类 | |
| 65 | + * | |
| 66 | + * @author ${table.author} | |
| 67 | + */ | |
| 68 | 68 | @Import(${table.className}ServiceImpl.class) |
| 69 | 69 | public class ${table.className}ServiceImplTest extends BaseDbUnitTest { |
| 70 | 70 | ... | ... |