|
|
@@ -0,0 +1,89 @@
|
|
|
+package com.izouma.nineth.domain;
|
|
|
+
|
|
|
+import com.alibaba.excel.annotation.ExcelIgnore;
|
|
|
+import com.alibaba.excel.annotation.ExcelProperty;
|
|
|
+import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
+import com.fasterxml.jackson.annotation.JsonInclude;
|
|
|
+import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import org.hibernate.envers.Audited;
|
|
|
+import org.springframework.data.annotation.CreatedBy;
|
|
|
+import org.springframework.data.annotation.CreatedDate;
|
|
|
+import org.springframework.data.annotation.LastModifiedBy;
|
|
|
+import org.springframework.data.annotation.LastModifiedDate;
|
|
|
+import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|
|
+
|
|
|
+import javax.persistence.EntityListeners;
|
|
|
+import javax.persistence.MappedSuperclass;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+
|
|
|
+@MappedSuperclass
|
|
|
+@Audited
|
|
|
+@EntityListeners(AuditingEntityListener.class)
|
|
|
+@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
|
+@JsonIgnoreProperties(value = {"hibernateLazyInitializer"}, ignoreUnknown = true)
|
|
|
+public abstract class BaseEntityNoID {
|
|
|
+ @ExcelIgnore
|
|
|
+ @JsonIgnore
|
|
|
+ @CreatedBy
|
|
|
+ private String createdBy;
|
|
|
+
|
|
|
+ @ExcelProperty("创建时间")
|
|
|
+ @JsonIgnore
|
|
|
+ @CreatedDate
|
|
|
+ private LocalDateTime createdAt;
|
|
|
+
|
|
|
+ @ExcelIgnore
|
|
|
+ @JsonIgnore
|
|
|
+ @LastModifiedBy
|
|
|
+ private String modifiedBy;
|
|
|
+
|
|
|
+ @ExcelIgnore
|
|
|
+ @JsonIgnore
|
|
|
+ @LastModifiedDate
|
|
|
+ private LocalDateTime modifiedAt;
|
|
|
+
|
|
|
+ @ExcelIgnore
|
|
|
+ private boolean del;
|
|
|
+
|
|
|
+ public String getCreatedBy() {
|
|
|
+ return createdBy;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setCreatedBy(String createdBy) {
|
|
|
+ this.createdBy = createdBy;
|
|
|
+ }
|
|
|
+
|
|
|
+ @JsonProperty("createdAt")
|
|
|
+ public LocalDateTime getCreatedAt() {
|
|
|
+ return createdAt;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setCreatedAt(LocalDateTime createdAt) {
|
|
|
+ this.createdAt = createdAt;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getModifiedBy() {
|
|
|
+ return modifiedBy;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setModifiedBy(String modifiedBy) {
|
|
|
+ this.modifiedBy = modifiedBy;
|
|
|
+ }
|
|
|
+
|
|
|
+ public LocalDateTime getModifiedAt() {
|
|
|
+ return modifiedAt;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setModifiedAt(LocalDateTime modifiedAt) {
|
|
|
+ this.modifiedAt = modifiedAt;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isDel() {
|
|
|
+ return del;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setDel(boolean del) {
|
|
|
+ this.del = del;
|
|
|
+ }
|
|
|
+}
|