package com.ruoyi.interfaces.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.JsonUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 服务调用日志对象 pt_service_log
 * 
 * @author 朱得糠
 * @date 2025-09-01
 */
public class PtServiceLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @Excel(name = "id")
    private Long logId;

    /** 服务id */
    @Excel(name = "服务id")
    private String serId;

    /** 模型id */
    @Excel(name = "模型id")
    private String mdId;

    /** 请求时间戳 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "请求时间戳", width = 30, dateFormat = "yyyy-MM-dd")
    private Date tm;

    /** 请求信息 */
    @Excel(name = "请求信息")
    private String senText;

    /** 返回信息 */
    @Excel(name = "返回信息")
    private String returnText;

    /** 请求耗时（毫秒） */
    @Excel(name = "请求耗时", readConverterExp = "毫=秒")
    private Long execTm;

    public PtServiceLog(PtService ptService) {
       this.serId=ptService.getSrvId();
       this.mdId=ptService.getMdid();
       this.senText=JsonUtils.objectToJson(ptService);
    }

    public PtServiceLog(Long logId, String serId, String mdId, Date tm, String senText, String returnText, Long execTm) {
        this.logId = logId;
        this.serId = serId;
        this.mdId = mdId;
        this.tm = tm;
        this.senText = senText;
        this.returnText = returnText;
        this.execTm = execTm;
    }

    public PtServiceLog() {
    }

    public void setLogId(Long logId)
    {
        this.logId = logId;
    }

    public Long getLogId() 
    {
        return logId;
    }
    public void setSerId(String serId) 
    {
        this.serId = serId;
    }

    public String getSerId() 
    {
        return serId;
    }
    public void setMdId(String mdId) 
    {
        this.mdId = mdId;
    }

    public String getMdId() 
    {
        return mdId;
    }
    public void setTm(Date tm) 
    {
        this.tm = tm;
    }

    public Date getTm() 
    {
        return tm;
    }
    public void setSenText(String senText) 
    {
        this.senText = senText;
    }

    public String getSenText() 
    {
        return senText;
    }
    public void setReturnText(String returnText) 
    {
        this.returnText = returnText;
    }

    public String getReturnText() 
    {
        return returnText;
    }
    public void setExecTm(Long execTm) 
    {
        this.execTm = execTm;
    }

    public Long getExecTm() 
    {
        return execTm;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("logId", getLogId())
            .append("serId", getSerId())
            .append("mdId", getMdId())
            .append("tm", getTm())
            .append("senText", getSenText())
            .append("returnText", getReturnText())
            .append("execTm", getExecTm())
            .toString();
    }
}
