package com.ann.demo.entity.interfaceEntity;

import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

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

/**
 * @Description 消息表
 * @Date 2019/6/17 10:27
 * @Created by  ljx
 */

@Data
@Table
@Entity
public class MessageLog {

    @Id
    @GenericGenerator(name = "system-uuid", strategy = "uuid2")
    @GeneratedValue(generator = "system-uuid")
    private String id;

    @Lob
    /**
     *  输入内容
     * */
    private String inputContent;

    /**
     * 输出内容
     */
    @Lob
    private String outContent;

    /**
     * 类型 与 字典表匹配
     */
    private String type;

    /**
     * 备注
     */
    private String remark;

    /**
     * 消息结果 0 未成功 1是成功
     */
    private Integer result;

    /**
     * 返回json
     */
    @Lob
    private String outJson;

    /**
     * 接口名称
     */
    private String interfaceName;

    /**
     * xml创建时间
     */
    private Date xmlCreateTime;

    /**
     * 执行时间
     */
    private Long executionTime;

    /**
     * 结束时间
     */
    private Date endTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * xml执行时间
     */
    private Long xmlExecutionTime;

//    /*
//     *  患者id
//     * */
//    private String masterId;


    // ---------------------------时间怎么变成了毫秒数
    public MessageLog(String inputContent, String interfaceName, Date createTime) {
        this.inputContent = inputContent;
        this.interfaceName = interfaceName;
        this.createTime = createTime;
    }

    public MessageLog() {

    }

    public void setValue(String outContent, Integer result, String outJson, Date xmlCreateTime, Long executionTime, Date endTime, String type) {
        this.outContent = outContent;
        this.result = result;
        this.outJson = outJson;
        this.xmlCreateTime = xmlCreateTime;
        this.executionTime = executionTime;
        this.endTime = endTime;
        this.type = type;
    }

    public void setValue1(String outContent, Integer result, Long executionTime, Date endTime) {
        this.outContent = outContent;
        this.result = result;
        this.executionTime = executionTime;
        this.endTime = endTime;
    }
}
