package com.example.demo.model;

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

/**
 * 异常日志实体。
 * <p>对应数据库 exception_log 表，记录程序运行时异常信息。</p>
 */
@Schema(description = "异常日志实体")
public class ExceptionLog {

    @Schema(description = "日志ID", example = "1")
    private Long logId;

    @Schema(description = "异常时间", example = "2024-01-15 10:30:00")
    private String exceptionTime;

    @Schema(description = "异常类型", example = "java.lang.NullPointerException")
    private String exceptionType;

    @Schema(description = "异常消息", example = "空指针异常")
    private String exceptionMessage;

    @Schema(description = "堆栈信息", example = "at com.example.demo.service...")
    private String stackTrace;

    @Schema(description = "请求URL", example = "/api/user/list")
    private String requestUrl;

    @Schema(description = "请求参数", example = "{\"page\":1}")
    private String requestParam;

    public ExceptionLog() {}

    public ExceptionLog(Long logId, String exceptionTime, String exceptionType,
                        String exceptionMessage, String stackTrace, String requestUrl,
                        String requestParam) {
        this.logId = logId;
        this.exceptionTime = exceptionTime;
        this.exceptionType = exceptionType;
        this.exceptionMessage = exceptionMessage;
        this.stackTrace = stackTrace;
        this.requestUrl = requestUrl;
        this.requestParam = requestParam;
    }

    public Long getLogId() { return logId; }
    public void setLogId(Long logId) { this.logId = logId; }
    public String getExceptionTime() { return exceptionTime; }
    public void setExceptionTime(String exceptionTime) { this.exceptionTime = exceptionTime; }
    public String getExceptionType() { return exceptionType; }
    public void setExceptionType(String exceptionType) { this.exceptionType = exceptionType; }
    public String getExceptionMessage() { return exceptionMessage; }
    public void setExceptionMessage(String exceptionMessage) { this.exceptionMessage = exceptionMessage; }
    public String getStackTrace() { return stackTrace; }
    public void setStackTrace(String stackTrace) { this.stackTrace = stackTrace; }
    public String getRequestUrl() { return requestUrl; }
    public void setRequestUrl(String requestUrl) { this.requestUrl = requestUrl; }
    public String getRequestParam() { return requestParam; }
    public void setRequestParam(String requestParam) { this.requestParam = requestParam; }
}
