package org.nl.system.service.lucene.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LuceneLogDto {

    /* 日志标识 */
    private String log_uuid;
    /*日志类型*/
    private String logType;
    /*设备编号*/
    private String device_code;
    /*内容详情*/
    private String content;

    /* 任务编码 */
    private String task_code;

    /* 指令编码 */
    private String instruct_code;

    /* 任务标识 */
    private String task_id;

    /* 载具号 */
    private String vehicle_code;

    /* 备注 */
    private String remark;

    /* 日志类型 */
    private String log_type;
    /**
     * 日志级别
     */
    private Integer log_level;

    /* 方法 */
    private String method;

    /* 请求参数 */
    private String requestparam;

    /* 响应参数 */
    private String responseparam;

    /* 请求地址 */
    private String requesturl;

    /* 状态码 */
    private String status_code;

    /* 是否删除 1:是；0：否 */
    private String is_delete;

    /* 创建者 */
    private String create_by;

    /* 创建时间  YYYY-MM-DD hh:mm:ss */
    private String create_time;

    /* 修改者 */
    private String update_by;

    /* 修改时间 */
    private String update_time;


    public LuceneLogDto(final String opc_server_code, final String opc_plc_code,final Integer log_level,
                        final String device_code, final String to_home, final String last_home,
                        final String home) {
        super();
        this.device_code = device_code;
        this.log_level = log_level;
        this.content = "信号 ["
                + opc_server_code + "."
                + opc_plc_code + "."
                + device_code + "."
                + to_home + "] 发生变更 "
                + last_home + " -> "
                + home;
    }

    public LuceneLogDto(final Integer log_level,final String method, final String status,
                        final String requestparam, final String responseparam, final String content) {
        super();
        this.log_level = log_level;
        this.method = method;
        this.status_code = status;
        this.requestparam = requestparam;
        this.responseparam = responseparam;
        this.content = content;
    }

    public LuceneLogDto(final String device_code, final String remark) {
        super();
        this.device_code = device_code;
        this.content = "设备 ["
                + device_code
                + "] - "
                + remark;
    }

    public LuceneLogDto(final LuceneLogDto dto) {
        super();
        this.device_code = device_code;
        this.method = method;

        this.content = "设备 ["
                + device_code
                + "] - "
                + remark;
    }

}
