package com.loan.system.domain.entity;

import org.hibernate.annotations.Proxy;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "exception_log")
@Proxy(lazy = false)
public class ExceptionLog {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Lob
    @Column(name = "exception_message")
    private String exceptionMessage;
    @Column(name = "exception_name")
    private String exceptionName;
    @Column(name = "exception_method")
    private String exceptionMethod; //异常方法
    @Column(name = "oper_user_name", length = 50)
    private String operUserName; //用户名
    @Column(name = "oper_ip", length = 50)
    private String operIp; //ip地址
    @Column(name = "oper_uri")
    private String operUri; //请求地址
    @Column(name = "oper_time")
    @Temporal(TemporalType.TIMESTAMP)
    private Date operTime; //操作时间
    @Lob
    @Column(name="method_param")
    private String methodParam;

    @Override
    public String toString() {
        return "ExceptionLog{" +
                "id=" + id +
                ", exceptionMessage='" + exceptionMessage + '\'' +
                ", exceptionName='" + exceptionName + '\'' +
                ", exceptionMethod='" + exceptionMethod + '\'' +
                ", operUserName='" + operUserName + '\'' +
                ", operIp='" + operIp + '\'' +
                ", operUri='" + operUri + '\'' +
                ", operTime=" + operTime +
                ", methodParam='" + methodParam + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public ExceptionLog setId(int id) {
        this.id = id;
        return this;
    }

    public String getExceptionMessage() {
        return exceptionMessage;
    }

    public ExceptionLog setExceptionMessage(String exceptionMessage) {
        this.exceptionMessage = exceptionMessage;
        return this;
    }

    public String getExceptionName() {
        return exceptionName;
    }

    public ExceptionLog setExceptionName(String exceptionName) {
        this.exceptionName = exceptionName;
        return this;
    }

    public String getExceptionMethod() {
        return exceptionMethod;
    }

    public ExceptionLog setExceptionMethod(String exceptionMethod) {
        this.exceptionMethod = exceptionMethod;
        return this;
    }

    public String getOperUserName() {
        return operUserName;
    }

    public ExceptionLog setOperUserName(String operUserName) {
        this.operUserName = operUserName;
        return this;
    }

    public String getOperIp() {
        return operIp;
    }

    public ExceptionLog setOperIp(String operIp) {
        this.operIp = operIp;
        return this;
    }

    public String getOperUri() {
        return operUri;
    }

    public ExceptionLog setOperUri(String operUri) {
        this.operUri = operUri;
        return this;
    }

    public Date getOperTime() {
        return operTime;
    }

    public ExceptionLog setOperTime(Date operTime) {
        this.operTime = operTime;
        return this;
    }

    public String getMethodParam() {
        return methodParam;
    }

    public ExceptionLog setMethodParam(String methodParam) {
        this.methodParam = methodParam;
        return this;
    }
}
