package com.eactive.httpmockserver.client.entity;

import com.eactive.httpmockserver.server.entity.Server;
import com.eactive.httpmockserver.user.entity.StaffUser;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.time.LocalDateTime;

public class ApiRequestHistory {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    private Long id;

    @ManyToOne
    @JoinColumn(name = "SERVER_ID")
    private Server server;

    @ManyToOne
    @JoinColumn(name = "USER_ID")
    private StaffUser owner;

    private String method;

    private String uri;

    private String requestHeaders;

    private String requestBody;

    private String responseBody;

    private String responseHeaders;

    @Type(type = "org.hibernate.type.LocalDateTimeType")
    private LocalDateTime requestTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Server getServer() {
        return server;
    }

    public void setServer(Server server) {
        this.server = server;
    }

    public StaffUser getOwner() {
        return owner;
    }

    public void setOwner(StaffUser owner) {
        this.owner = owner;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getRequestHeaders() {
        return requestHeaders;
    }

    public void setRequestHeaders(String requestHeaders) {
        this.requestHeaders = requestHeaders;
    }

    public String getRequestBody() {
        return requestBody;
    }

    public void setRequestBody(String requestBody) {
        this.requestBody = requestBody;
    }

    public String getResponseBody() {
        return responseBody;
    }

    public void setResponseBody(String responseBody) {
        this.responseBody = responseBody;
    }

    public String getResponseHeaders() {
        return responseHeaders;
    }

    public void setResponseHeaders(String responseHeaders) {
        this.responseHeaders = responseHeaders;
    }

    public LocalDateTime getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(LocalDateTime requestTime) {
        this.requestTime = requestTime;
    }
}
