review:【INFRA 基础设施】代码生成的 review
This commit is contained in:
@@ -60,6 +60,7 @@ public class Demo01ContactController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// TODO @puhui999:要不要 deleteDemo01ContactList?url 也叫 delete-list
|
||||
@DeleteMapping("/delete-batch")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除示例联系人")
|
||||
|
||||
@@ -13,6 +13,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
|
||||
@Schema(description = "管理后台 - 示例联系人分页 Request VO")
|
||||
@Data
|
||||
// TODO @puhui999:要不要去掉所有 pojo 里的 @EqualsAndHashCode、@ToString,代码生成里的。因为 lombok.config 已经处理了全局了;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class Demo01ContactPageReqVO extends PageParam {
|
||||
|
||||
@@ -43,16 +43,16 @@ public class CodegenProperties {
|
||||
@NotNull(message = "代码生成的 VO 类型不能为空")
|
||||
private Integer voType;
|
||||
|
||||
/**
|
||||
* 是否生成单元测试
|
||||
*/
|
||||
@NotNull(message = "是否生成单元测试不能为空")
|
||||
private Boolean unitTestEnable;
|
||||
|
||||
/**
|
||||
* 是否生成批量删除接口
|
||||
*/
|
||||
@NotNull(message = "是否生成批量删除接口不能为空")
|
||||
private Boolean deleteBatchEnable;
|
||||
|
||||
/**
|
||||
* 是否生成单元测试
|
||||
*/
|
||||
@NotNull(message = "是否生成单元测试不能为空")
|
||||
private Boolean unitTestEnable;
|
||||
|
||||
}
|
||||
|
||||
@@ -135,6 +135,8 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic
|
||||
List<List<Demo03CourseDO>> diffList = diffList(oldList, list, (oldVal, newVal) -> {
|
||||
boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId());
|
||||
if (same) {
|
||||
// TODO @puhui999:BaseDO 增加一个 clean 方法,里面把 creator、updator、updateTime、updater 都清空?
|
||||
// TODO @puhui999:然后 DO 模式新增、更新,以及主子表,都 clean 下。避免前端直接传递 creator 之类的字段,直接就被更新了。
|
||||
newVal.setId(oldVal.getId()).setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
}
|
||||
return same;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
package cn.iocoder.yudao.module.infra.service.demo.demo03;
|
||||
Reference in New Issue
Block a user