package cn.novalon.gym.manage.db.entity;

import io.r2dbc.postgresql.codec.Json;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

/**
 * 审计日志数据库实体类
 * 
 * @author 张翔
 * @date 2026-04-08
 */
@Table("audit_log")
public class AuditLogEntity extends BaseEntity {

    @Column("entity_type")
    private String entityType;

    @Column("entity_id")
    private Long entityId;

    @Column("operation_type")
    private String operationType;

    @Column("operator")
    private String operator;

    @Column("operation_time")
    private java.time.LocalDateTime operationTime;

    @Column("before_data")
    private Json beforeData;

    @Column("after_data")
    private Json afterData;

    @Column("changed_fields")
    private String[] changedFields;

    @Column("ip_address")
    private String ipAddress;

    @Column("user_agent")
    private String userAgent;

    @Column("description")
    private String description;

    public String getEntityType() {
        return entityType;
    }

    public void setEntityType(String entityType) {
        this.entityType = entityType;
    }

    public Long getEntityId() {
        return entityId;
    }

    public void setEntityId(Long entityId) {
        this.entityId = entityId;
    }

    public String getOperationType() {
        return operationType;
    }

    public void setOperationType(String operationType) {
        this.operationType = operationType;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public java.time.LocalDateTime getOperationTime() {
        return operationTime;
    }

    public void setOperationTime(java.time.LocalDateTime operationTime) {
        this.operationTime = operationTime;
    }

    public Json getBeforeData() {
        return beforeData;
    }

    public void setBeforeData(Json beforeData) {
        this.beforeData = beforeData;
    }

    public Json getAfterData() {
        return afterData;
    }

    public void setAfterData(Json afterData) {
        this.afterData = afterData;
    }

    public String[] getChangedFields() {
        return changedFields;
    }

    public void setChangedFields(String[] changedFields) {
        this.changedFields = changedFields;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
