This commit is contained in:
雷欧(林平凡)
2025-08-07 15:32:12 +08:00
parent 0ae4bd345f
commit d93575aacb
2 changed files with 149 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
package cn.van.business.model.wx;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.proxy.HibernateProxy;
import java.util.Objects;
/**
* 超级管理员实体类
*/
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "super_admin")
public class SuperAdmin {
/**
* 主键ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 微信ID
*/
@Column(name = "wxid", nullable = false, length = 64)
private String wxid;
/**
* 姓名
*/
@Column(name = "name", nullable = false, length = 50)
private String name;
/**
* 联盟ID
*/
@Column(name = "union_id", nullable = false, length = 64)
private String unionId;
/**
* 应用密钥
*/
@Column(name = "app_key", nullable = false, length = 100)
private String appKey;
/**
* 秘密密钥
*/
@Column(name = "secret_key", nullable = false, length = 100)
private String secretKey;
/**
* 是否激活: 0-否, 1-是
*/
@Column(name = "is_active", nullable = false)
private Integer isActive = 1;
/**
* 创建时间
*/
@Column(name = "created_at", nullable = false, updatable = false)
private java.sql.Timestamp createdAt;
/**
* 更新时间
*/
@Column(name = "updated_at", nullable = false)
private java.sql.Timestamp updatedAt;
@PrePersist
protected void onCreate() {
createdAt = new java.sql.Timestamp(System.currentTimeMillis());
updatedAt = new java.sql.Timestamp(System.currentTimeMillis());
}
@PreUpdate
protected void onUpdate() {
updatedAt = new java.sql.Timestamp(System.currentTimeMillis());
}
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
SuperAdmin that = (SuperAdmin) o;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
}
}