package com.yihu.jw.entity.iot.platform;

import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import org.hibernate.boot.model.relational.Namespace;

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

/**接口日志
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/4/28
 */
@Entity
@Table(name = "iot_interface_log")
public class IotInterfaceLogDO extends UuidIdentityEntityWithOperator implements Serializable {


    @Column(name="company_id")
    private String companyId;//公司ID
    @Column(name="company_name")
    private String companyName;//公司名称
    @Column(name="app_id")
    private String appId;//应用ID
    @Column(name="app_name")
    private String  appName;//应用名称
    @Column(name="work_type_id")
    private String workTypeId;//业务类型ID
    @Column(name="work_type")
    private String workType;//业务类型
    @Column(name="explanation")
    private String explanation;//接口说明
    @Column(name="user_id")
    private String userId;//用户id
    @Column(name="user_name")
    private String userName;//用户名称
    @Column(name="address_ip")
    private String addressIp;//访问ip地址
    @Column(name="source")
    private String source;//请求来源 1：卫健委 2：单位 3：系统管理员
    @Column(name="head")
    private String head;//请求头
    @Column(name="request")
    private String request;//请求参数
    @Column(name="interface_name")
    private String interfaceName;//请求接口名称
    @Column(name="method")
    private String method;//方法名
    @Column(name="type")
    private int type;//请求方式 1：get请求  2：post请求
    @Column(name="url")
    private String url;//请求URL
    @Column(name="response")
    private String  response;//响应参数
    @Column(name="time")
    private Date time;//调用时间
    @Column(name="state")
    private int  state;//调用状态 1：成功   0：失败

    @Transient
    private String count;//调用次数

    @Transient
    private String failureRate;//失败率

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getWorkTypeId() {
        return workTypeId;
    }

    public void setWorkTypeId(String workTypeId) {
        this.workTypeId = workTypeId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getAddressIp() {
        return addressIp;
    }

    public void setAddressIp(String addressIp) {
        this.addressIp = addressIp;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getHead() {
        return head;
    }

    public void setHead(String head) {
        this.head = head;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }

    public String getInterfaceName() {
        return interfaceName;
    }

    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }

    public String getMethod() {
        return method;
    }

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

    public int getType() {
        return type;
    }

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

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getResponse() {
        return response;
    }

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

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getWorkType() {
        return workType;
    }

    public void setWorkType(String workType) {
        this.workType = workType;
    }

    public String getExplanation() {
        return explanation;
    }

    public void setExplanation(String explanation) {
        this.explanation = explanation;
    }

    @Transient
    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }
    @Transient
    public String getFailureRate() {
        return failureRate;
    }

    public void setFailureRate(String failureRate) {
        this.failureRate = failureRate;
    }
}
