upd: 重命名

This commit is contained in:
骑着蜗牛追导弹 2024-12-06 21:09:16 +08:00
parent 602264444d
commit 2e84fd4c29
3 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ import java.util.Date;
*/ */
@Getter @Getter
@Setter @Setter
public class MyEntity extends MyObject { public class MyNormalEntity extends MyObject {
/** /**
* 创建人 * 创建人

View File

@ -5,7 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.odboy.base.MyEntity; import cn.odboy.base.MyNormalEntity;
import cn.odboy.constant.SystemConst; import cn.odboy.constant.SystemConst;
import cn.odboy.infra.context.SecurityUtil; import cn.odboy.infra.context.SecurityUtil;
import cn.odboy.infra.exception.BadRequestException; import cn.odboy.infra.exception.BadRequestException;
@ -240,7 +240,7 @@ public class QUtil {
@TableName("test_domain") @TableName("test_domain")
private static class TestDomain { private static class TestDomain {
@NotNull(groups = MyEntity.Update.class) @NotNull(groups = MyNormalEntity.Update.class)
@TableId(value = "user_id", type = IdType.AUTO) @TableId(value = "user_id", type = IdType.AUTO)
private Long id; private Long id;
@TableField(value = "dept_id") @TableField(value = "dept_id")

View File

@ -1,6 +1,6 @@
package cn.odboy.util; package cn.odboy.util;
import cn.odboy.base.MyEntity; import cn.odboy.base.MyNormalEntity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -27,9 +27,9 @@ public class ListUtil {
// list转map保留旧值 -> Map<String, User> userMap = users.stream().collect(Collectors.toMap(User::getName, user -> user, (existing, replacement) -> existing)); // list转map保留旧值 -> Map<String, User> userMap = users.stream().collect(Collectors.toMap(User::getName, user -> user, (existing, replacement) -> existing));
public static void main(String[] args) { public static void main(String[] args) {
List<MyEntity> entities = new ArrayList<>(); List<MyNormalEntity> entities = new ArrayList<>();
for (int i = 0; i < 50; i++) { for (int i = 0; i < 50; i++) {
MyEntity entity = new MyEntity(); MyNormalEntity entity = new MyNormalEntity();
if (i % 2 == 0) { if (i % 2 == 0) {
entity.setCreateBy("odboy"); entity.setCreateBy("odboy");
} else { } else {
@ -40,7 +40,7 @@ public class ListUtil {
entity.setUpdateTime(new Date()); entity.setUpdateTime(new Date());
entities.add(entity); entities.add(entity);
} }
List<MyEntity> entities1 = ListUtil.distinctByTArgs(entities, MyEntity::getCreateBy); List<MyNormalEntity> entities1 = ListUtil.distinctByTArgs(entities, MyNormalEntity::getCreateBy);
System.err.println(entities1); System.err.println(entities1);
} }
} }