You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
373 lines
8.5 KiB
373 lines
8.5 KiB
2 years ago
|
package Log;
|
||
|
|
||
|
import com.google.common.base.MoreObjects;
|
||
|
import com.hypaas.auth.db.AuditableModel;
|
||
|
import com.hypaas.db.annotations.ActField;
|
||
|
import com.hypaas.db.annotations.Widget;
|
||
|
import java.time.LocalDateTime;
|
||
|
import java.util.Objects;
|
||
|
import javax.persistence.Basic;
|
||
|
import javax.persistence.Cacheable;
|
||
|
import javax.persistence.Column;
|
||
|
import javax.persistence.Entity;
|
||
|
import javax.persistence.FetchType;
|
||
|
import javax.persistence.GeneratedValue;
|
||
|
import javax.persistence.GenerationType;
|
||
|
import javax.persistence.Id;
|
||
|
import javax.persistence.Inheritance;
|
||
|
import javax.persistence.InheritanceType;
|
||
|
import javax.persistence.SequenceGenerator;
|
||
|
import javax.persistence.Table;
|
||
|
import module.AlarmLevel;
|
||
|
import module.OperateType;
|
||
|
import module.UserAuth;
|
||
|
import org.hibernate.annotations.Type;
|
||
|
|
||
|
@Entity
|
||
|
@Cacheable(false)
|
||
|
@Table(name = "sys_log")
|
||
|
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
||
|
public class LogEntity extends AuditableModel {
|
||
|
|
||
|
@Id
|
||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_log_SEQ")
|
||
|
@SequenceGenerator(name = "sys_log_SEQ", sequenceName = "sys_log_SEQ", allocationSize = 1)
|
||
|
private Long id;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "CONTENT")
|
||
|
@ActField(isJudg = false)
|
||
|
private String content;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "DEPT", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String dept;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "EXMSG", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String exceptionMessage;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "EXSTACK", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String exceptionStackTrace;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "EXTYPE", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String exceptionType;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "HASHVALUE", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private Long hashValue;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "LEVELDESC", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String levelDesc;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Basic
|
||
|
@Type(type = "com.hypaas.db.hibernate.type.ValueEnumType")
|
||
|
@Column(name = "LEVELNUM")
|
||
|
private AlarmLevel levelNum;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "MODULE")
|
||
|
@ActField(isJudg = false)
|
||
|
private String module;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "OBJECTNAME")
|
||
|
@ActField(isJudg = false)
|
||
|
private String objectName;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Basic
|
||
|
@Type(type = "com.hypaas.db.hibernate.type.ValueEnumType")
|
||
|
@Column(name = "OPTYPE")
|
||
|
private OperateType opType;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "PROGRAM", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String program;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "RESULT", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private Integer result;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "RESULTDESC", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String resultDesc;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "STATUS", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private Integer status;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "TIME", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private LocalDateTime time;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Basic
|
||
|
@Type(type = "com.hypaas.db.hibernate.type.ValueEnumType")
|
||
|
@Column(name = "USERAUTH")
|
||
|
private UserAuth userAuth;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "USERAUTHDESC", nullable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String userAuthDesc;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@Column(name = "USERID")
|
||
|
@ActField(isJudg = false)
|
||
|
private String userId;
|
||
|
|
||
|
@Widget(massUpdate = false, copyable = true)
|
||
|
@ActField(isJudg = false)
|
||
|
private String address;
|
||
|
|
||
|
@Widget(selection = "secret.level.things")
|
||
|
private String secretLevel;
|
||
|
|
||
|
@Widget(title = "Attributes")
|
||
|
@Basic(fetch = FetchType.LAZY)
|
||
|
@Type(type = "json")
|
||
|
private String attrs;
|
||
|
|
||
|
public LogEntity() {}
|
||
|
|
||
|
@Override
|
||
|
public Long getId() {
|
||
|
return id;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void setId(Long id) {
|
||
|
this.id = id;
|
||
|
}
|
||
|
|
||
|
public String getContent() {
|
||
|
return content;
|
||
|
}
|
||
|
|
||
|
public void setContent(String content) {
|
||
|
this.content = content;
|
||
|
}
|
||
|
|
||
|
public String getDept() {
|
||
|
return dept;
|
||
|
}
|
||
|
|
||
|
public void setDept(String dept) {
|
||
|
this.dept = dept;
|
||
|
}
|
||
|
|
||
|
public String getExceptionMessage() {
|
||
|
return exceptionMessage;
|
||
|
}
|
||
|
|
||
|
public void setExceptionMessage(String exceptionMessage) {
|
||
|
this.exceptionMessage = exceptionMessage;
|
||
|
}
|
||
|
|
||
|
public String getExceptionStackTrace() {
|
||
|
return exceptionStackTrace;
|
||
|
}
|
||
|
|
||
|
public void setExceptionStackTrace(String exceptionStackTrace) {
|
||
|
this.exceptionStackTrace = exceptionStackTrace;
|
||
|
}
|
||
|
|
||
|
public String getExceptionType() {
|
||
|
return exceptionType;
|
||
|
}
|
||
|
|
||
|
public void setExceptionType(String exceptionType) {
|
||
|
this.exceptionType = exceptionType;
|
||
|
}
|
||
|
|
||
|
public Long getHashValue() {
|
||
|
return hashValue;
|
||
|
}
|
||
|
|
||
|
public void setHashValue(Long hashValue) {
|
||
|
this.hashValue = hashValue;
|
||
|
}
|
||
|
|
||
|
public String getLevelDesc() {
|
||
|
return levelDesc;
|
||
|
}
|
||
|
|
||
|
public void setLevelDesc(String levelDesc) {
|
||
|
this.levelDesc = levelDesc;
|
||
|
}
|
||
|
|
||
|
public AlarmLevel getLevelNum() {
|
||
|
return levelNum;
|
||
|
}
|
||
|
|
||
|
public void setLevelNum(AlarmLevel levelNum) {
|
||
|
this.levelNum = levelNum;
|
||
|
}
|
||
|
|
||
|
public String getModule() {
|
||
|
return module;
|
||
|
}
|
||
|
|
||
|
public void setModule(String module) {
|
||
|
this.module = module;
|
||
|
}
|
||
|
|
||
|
public String getObjectName() {
|
||
|
return objectName;
|
||
|
}
|
||
|
|
||
|
public void setObjectName(String objectName) {
|
||
|
this.objectName = objectName;
|
||
|
}
|
||
|
|
||
|
public OperateType getOpType() {
|
||
|
return opType;
|
||
|
}
|
||
|
|
||
|
public void setOpType(OperateType opType) {
|
||
|
this.opType = opType;
|
||
|
}
|
||
|
|
||
|
public String getProgram() {
|
||
|
return program;
|
||
|
}
|
||
|
|
||
|
public void setProgram(String program) {
|
||
|
this.program = program;
|
||
|
}
|
||
|
|
||
|
public Integer getResult() {
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
public void setResult(Integer result) {
|
||
|
this.result = result;
|
||
|
}
|
||
|
|
||
|
public String getResultDesc() {
|
||
|
return resultDesc;
|
||
|
}
|
||
|
|
||
|
public void setResultDesc(String resultDesc) {
|
||
|
this.resultDesc = resultDesc;
|
||
|
}
|
||
|
|
||
|
public Integer getStatus() {
|
||
|
return status;
|
||
|
}
|
||
|
|
||
|
public void setStatus(Integer status) {
|
||
|
this.status = status;
|
||
|
}
|
||
|
|
||
|
public LocalDateTime getTime() {
|
||
|
return time;
|
||
|
}
|
||
|
|
||
|
public void setTime(LocalDateTime time) {
|
||
|
this.time = time;
|
||
|
}
|
||
|
|
||
|
public UserAuth getUserAuth() {
|
||
|
return userAuth;
|
||
|
}
|
||
|
|
||
|
public void setUserAuth(UserAuth userAuth) {
|
||
|
this.userAuth = userAuth;
|
||
|
}
|
||
|
|
||
|
public String getUserAuthDesc() {
|
||
|
return userAuthDesc;
|
||
|
}
|
||
|
|
||
|
public void setUserAuthDesc(String userAuthDesc) {
|
||
|
this.userAuthDesc = userAuthDesc;
|
||
|
}
|
||
|
|
||
|
public String getUserId() {
|
||
|
return userId;
|
||
|
}
|
||
|
|
||
|
public void setUserId(String userId) {
|
||
|
this.userId = userId;
|
||
|
}
|
||
|
|
||
|
public String getAddress() {
|
||
|
return address;
|
||
|
}
|
||
|
|
||
|
public void setAddress(String address) {
|
||
|
this.address = address;
|
||
|
}
|
||
|
|
||
|
public String getSecretLevel() {
|
||
|
return secretLevel;
|
||
|
}
|
||
|
|
||
|
public void setSecretLevel(String secretLevel) {
|
||
|
this.secretLevel = secretLevel;
|
||
|
}
|
||
|
|
||
|
public String getAttrs() {
|
||
|
return attrs;
|
||
|
}
|
||
|
|
||
|
public void setAttrs(String attrs) {
|
||
|
this.attrs = attrs;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean equals(Object obj) {
|
||
|
if (obj == null) return false;
|
||
|
if (this == obj) return true;
|
||
|
if (!(obj instanceof LogEntity)) return false;
|
||
|
|
||
|
final LogEntity other = (LogEntity) obj;
|
||
|
if (this.getId() != null || other.getId() != null) {
|
||
|
return Objects.equals(this.getId(), other.getId());
|
||
|
}
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public int hashCode() {
|
||
|
return 31;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String toString() {
|
||
|
return MoreObjects.toStringHelper(this)
|
||
|
.add("id", getId())
|
||
|
.add("content", getContent())
|
||
|
.add("dept", getDept())
|
||
|
.add("exceptionMessage", getExceptionMessage())
|
||
|
.add("exceptionStackTrace", getExceptionStackTrace())
|
||
|
.add("exceptionType", getExceptionType())
|
||
|
.add("hashValue", getHashValue())
|
||
|
.add("levelDesc", getLevelDesc())
|
||
|
.add("levelNum", getLevelNum())
|
||
|
.add("module", getModule())
|
||
|
.add("objectName", getObjectName())
|
||
|
.add("opType", getOpType())
|
||
|
.omitNullValues()
|
||
|
.toString();
|
||
|
}
|
||
|
}
|