From d952c29e4dfd96e9d2e80a4045bfc6802b65fcda Mon Sep 17 00:00:00 2001 From: zhouhao Date: Mon, 7 Mar 2022 11:49:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E5=A2=9E=E5=8A=A0=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BA=BA=E5=92=8C=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/entity/PermissionEntity.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/system/authorization/api/entity/PermissionEntity.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/system/authorization/api/entity/PermissionEntity.java index b3957ddd0..1e62c5554 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/system/authorization/api/entity/PermissionEntity.java +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/system/authorization/api/entity/PermissionEntity.java @@ -7,7 +7,10 @@ import org.hswebframework.ezorm.rdb.mapping.annotation.Comment; import org.hswebframework.ezorm.rdb.mapping.annotation.DefaultValue; import org.hswebframework.ezorm.rdb.mapping.annotation.JsonCodec; import org.hswebframework.web.api.crud.entity.GenericEntity; +import org.hswebframework.web.api.crud.entity.RecordCreationEntity; +import org.hswebframework.web.api.crud.entity.RecordModifierEntity; import org.hswebframework.web.bean.FastBeanCopier; +import org.hswebframework.web.crud.generator.Generators; import org.hswebframework.web.validator.CreateGroup; import org.springframework.util.CollectionUtils; @@ -27,7 +30,7 @@ import java.util.stream.Collectors; @Builder @NoArgsConstructor @AllArgsConstructor -public class PermissionEntity extends GenericEntity { +public class PermissionEntity extends GenericEntity implements RecordCreationEntity, RecordModifierEntity { @Override @Pattern(regexp = "^[0-9a-zA-Z_\\-]+$", message = "ID只能由数字,字母,下划线和中划线组成", groups = CreateGroup.class) @@ -80,6 +83,24 @@ public class PermissionEntity extends GenericEntity { @Schema(description = "其他配置") private Map properties; + @Schema(description = "创建时间") + @Column(updatable = false) + @DefaultValue(generator = Generators.CURRENT_TIME) + private Long createTime; + + @Schema(description = "创建人ID") + @Column(length = 64, updatable = false) + private String creatorId; + + @Schema(description = "修改时间") + @Column + @DefaultValue(generator = Generators.CURRENT_TIME) + private Long modifyTime; + + @Schema(description = "修改人ID") + @Column(length = 64, updatable = false) + private String modifierId; + public PermissionEntity copy(Predicate actionFilter, Predicate fieldFilter) { PermissionEntity entity = FastBeanCopier.copy(this, new PermissionEntity());