package com.crunii.micro.domain.entitysql.main;

import com.crunii.micro.domain.common.jdbc.dto.AbsSetProps;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

@Entity
@Table(name = "t_call_log")
@DynamicInsert
@DynamicUpdate
@Getter
@ToString
@EqualsAndHashCode(of = { "id" })
@ApiModel(description = "网关调用日志表")
public class TCallLogS extends AbsSetProps {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@ApiModelProperty(value = "主键")
	private long id;

	@Column(name = "login_id")
	@ApiModelProperty(value = "登录id")
	private int loginId;

	@Column(name = "login_code")
	@ApiModelProperty(value = "登录工号")
	private String loginCode;

	@Column(name = "worker_name")
	@ApiModelProperty(value = "员工姓名")
	private String workerName;

	@Column(name = "ip_addr")
	@ApiModelProperty(value = "调用ip地址")
	private String ipAddr;

	@Column(name = "http_url")
	@ApiModelProperty(value = "调用url")
	private String httpUrl;

	@Column(name = "http_method")
	@ApiModelProperty(value = "方法")
	private String httpMethod;

	@Column(name = "http_status")
	@ApiModelProperty(value = "状态")
	private String httpStatus;

	@Column(name = "http_outcome")
	@ApiModelProperty(value = "出入")
	private String httpOutcome;

	@Column(name = "exception_name")
	@ApiModelProperty(value = "异常类名")
	private String exceptionName;

	@Column(name = "use_time")
	@ApiModelProperty(value = "调用耗时，单位毫秒")
	private long useTime;

	@Column(name = "call_time")
	@ApiModelProperty(value = "调用时间")
	private java.util.Date callTime;

	@Column(name = "create_time")
	@ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;

	@Column(name = "send_data")
	@ApiModelProperty(value = "发送报文")
	private String sendData;

	@Column(name = "recv_data")
	@ApiModelProperty(value = "接收报文")
	private String recvData;

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

	public void setLoginId(int loginId) {
		this.loginId = loginId;
		fireSet("loginId", loginId);
	}

	public void setLoginCode(String loginCode) {
		this.loginCode = loginCode;
		fireSet("loginCode", loginCode);
	}

	public void setWorkerName(String workerName) {
		this.workerName = workerName;
		fireSet("workerName", workerName);
	}

	public void setIpAddr(String ipAddr) {
		this.ipAddr = ipAddr;
		fireSet("ipAddr", ipAddr);
	}

	public void setHttpUrl(String httpUrl) {
		this.httpUrl = httpUrl;
		fireSet("httpUrl", httpUrl);
	}

	public void setHttpMethod(String httpMethod) {
		this.httpMethod = httpMethod;
		fireSet("httpMethod", httpMethod);
	}

	public void setHttpStatus(String httpStatus) {
		this.httpStatus = httpStatus;
		fireSet("httpStatus", httpStatus);
	}

	public void setHttpOutcome(String httpOutcome) {
		this.httpOutcome = httpOutcome;
		fireSet("httpOutcome", httpOutcome);
	}

	public void setExceptionName(String exceptionName) {
		this.exceptionName = exceptionName;
		fireSet("exceptionName", exceptionName);
	}

	public void setUseTime(long useTime) {
		this.useTime = useTime;
		fireSet("useTime", useTime);
	}

	public void setCallTime(java.util.Date callTime) {
		this.callTime = callTime;
		fireSet("callTime", callTime);
	}

	public void setCreateTime(java.util.Date createTime) {
		this.createTime = createTime;
		fireSet("createTime", createTime);
	}

	public void setSendData(String sendData) {
		this.sendData = sendData;
		fireSet("sendData", sendData);
	}

	public void setRecvData(String recvData) {
		this.recvData = recvData;
		fireSet("recvData", recvData);
	}

}
