package com.dgtly.sync.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.dgtly.common.annotation.Excel;
import com.dgtly.common.core.domain.BaseEntity;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 同步解析日志对象 sync_log
 * 
 * @author qxp
 * @date 2020-07-14
 */
public class SyncLog
{
    private static final long serialVersionUID = 1L;

    /** 解析的包id */
    private String packageId;

    /** 成功条数 */
    @Excel(name = "成功条数")
    private Long successCount;

    /** 失败条数 */
    @Excel(name = "失败条数")
    private Long faileCount;

    /** 总数 */
    @Excel(name = "总数")
    private Long totalCount;

    /** 解析的类型 */
    private String syncType;

    /**  创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**  开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**  结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /** 请求参数 */
    private Map<String, Object> params;

    public Map<String, Object> getParams()
    {
        if (params == null)
        {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params)
    {
        this.params = params;
    }


    public void setPackageId(String packageId) 
    {
        this.packageId = packageId;
    }

    public String getPackageId() 
    {
        return packageId;
    }
    public void setSuccessCount(Long successCount) 
    {
        this.successCount = successCount;
    }

    public Long getSuccessCount() 
    {
        return successCount;
    }
    public void setFaileCount(Long faileCount) 
    {
        this.faileCount = faileCount;
    }

    public Long getFaileCount() 
    {
        return faileCount;
    }
    public void setTotalCount(Long totalCount) 
    {
        this.totalCount = totalCount;
    }

    public Long getTotalCount() 
    {
        return totalCount;
    }
    public void setSyncType(String syncType)
    {
        this.syncType = syncType;
    }

    public String getSyncType()
    {
        return syncType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("packageId", getPackageId())
            .append("successCount", getSuccessCount())
            .append("faileCount", getFaileCount())
            .append("totalCount", getTotalCount())
            .append("syncType", getSyncType())
            .toString();
    }
}
