package cn.novalon.gym.manage.sys.audit.dto;

import io.swagger.v3.oas.annotations.media.Schema;

import java.time.LocalDateTime;

/**
 * 审计日志查询请求
 * 
 * @author 张翔
 * @date 2026-04-01
 */
@Schema(description = "审计日志查询请求")
public class AuditLogQueryRequest {

    @Schema(description = "实体类型", example = "User")
    private String entityType;

    @Schema(description = "实体ID", example = "1")
    private Long entityId;

    @Schema(description = "操作类型", example = "UPDATE")
    private String operationType;

    @Schema(description = "操作人", example = "admin")
    private String operator;

    @Schema(description = "开始时间")
    private LocalDateTime startTime;

    @Schema(description = "结束时间")
    private LocalDateTime endTime;

    @Schema(description = "页码", example = "1")
    private Integer page = 1;

    @Schema(description = "每页大小", example = "20")
    private Integer size = 20;

    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 LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AuditLogQueryRequest that = (AuditLogQueryRequest) o;
        return java.util.Objects.equals(entityType, that.entityType) &&
               java.util.Objects.equals(entityId, that.entityId) &&
               java.util.Objects.equals(operationType, that.operationType) &&
               java.util.Objects.equals(operator, that.operator) &&
               java.util.Objects.equals(startTime, that.startTime) &&
               java.util.Objects.equals(endTime, that.endTime) &&
               java.util.Objects.equals(page, that.page) &&
               java.util.Objects.equals(size, that.size);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(entityType, entityId, operationType, operator, startTime, endTime, page, size);
    }

    @Override
    public String toString() {
        return "AuditLogQueryRequest{" +
                "entityType='" + entityType + '\'' +
                ", entityId=" + entityId +
                ", operationType='" + operationType + '\'' +
                ", operator='" + operator + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", page=" + page +
                ", size=" + size +
                '}';
    }
}
