package com.yihu.wlyy.entity.httpLog;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/** http交互日志
 * Created by yeshijie on 2017/1/12.
 */
@Entity
@Table(name = "wlyy_http_log")
public class HttpLog extends IdEntity{
    // 接口类型 0对外接口 1基卫接口 2健康网接口
    private String type;
    // 业务内容
    private String content;
    // 调用接口
    private String api;
    // 调用方式
    private String method;
    // 调用参数
    private String params;
    // 调用头部信息
    private String header;
    // 返回结果
    private String response;
    // 状态 0失败 1成功 2已重试
    private String status;
    // 重试次数
    private Integer retryTimes;
    // 创建时间
    private Date createTime;
    //异常信息
    private String error;

    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Column(name = "api")
    public String getApi() {
        return api;
    }

    public void setApi(String api) {
        this.api = api;
    }

    @Column(name = "method")
    public String getMethod() {
        return method;
    }

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

    @Column(name = "params")
    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    @Column(name = "header")
    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    @Column(name = "response")
    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    @Column(name = "status")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Column(name = "retry_times")
    public Integer getRetryTimes() {
        return retryTimes;
    }

    public void setRetryTimes(Integer retryTimes) {
        this.retryTimes = retryTimes;
    }

    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "error")
    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
