package com.pcloud.common.core.dto;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 事件埋点
 * @author 石纯山
 * @date 2018/4/16
 */
public class FrontEventDto implements Serializable {
    private static final long serialVersionUID = 7668311875701119389L;
    /**
     * 事件id
     */
    private String eventId;
    /**
     * 漏斗id，当为漏斗事件时
     */
    private String funnelId;

    /**
     * 事件id集合
     */
    private Map<String,String> eventMap;

    /**
     * 编辑id
     */
    private Long adviserId;
    /**
     * 渠道id
     */
    private Long channelId;

    /**
     * 来源类型0 后端，1 h5，2 小程序，3 app
     */
    private short sourceType;

    /**
     * 触发时间
     */
    private Long timestamp;
    /**
     * 1:RAYS
     */
    private String platCode;
    /**
     * 0:不是读者，1：读者
     */
    private short isReader;
    /**
     * 当事人id
     */
    private Long partyId;
    /**
     * 用户角色编码
     */
    private String systemCode;

    /**
     * 读者所在的公众号
     */
    private Long officeAccountId;
    /**
     * 平台读者id
     */
    private Long wechatUserId;

    /**
     * 场景id
     */
    private Long sceneId;
    /**
     * 出版id
     */
    private Long agentId;

    private String Exp1;
    private String Exp2;
    private String Exp3;

    public String getEventId() {
        return eventId;
    }

    public void setEventId(String eventId) {
        this.eventId = eventId;
    }

    public String getFunnelId() {
        return funnelId;
    }

    public void setFunnelId(String funnelId) {
        this.funnelId = funnelId;
    }

    public Long getAdviserId() {
        return adviserId;
    }

    public void setAdviserId(Long adviserId) {
        this.adviserId = adviserId;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    public short getSourceType() {
        return sourceType;
    }

    public void setSourceType(short sourceType) {
        this.sourceType = sourceType;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getPlatCode() {
        return platCode;
    }

    public void setPlatCode(String platCode) {
        this.platCode = platCode;
    }

    public short getIsReader() {
        return isReader;
    }

    public void setIsReader(short isReader) {
        this.isReader = isReader;
    }

    public Long getOfficeAccountId() {
        return officeAccountId;
    }

    public void setOfficeAccountId(Long officeAccountId) {
        this.officeAccountId = officeAccountId;
    }

    public Long getWechatUserId() {
        return wechatUserId;
    }

    public void setWechatUserId(Long wechatUserId) {
        this.wechatUserId = wechatUserId;
    }

    public Long getSceneId() {
        return sceneId;
    }

    public void setSceneId(Long sceneId) {
        this.sceneId = sceneId;
    }

    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public String getExp1() {
        return Exp1;
    }

    public void setExp1(String exp1) {
        Exp1 = exp1;
    }

    public String getExp2() {
        return Exp2;
    }

    public void setExp2(String exp2) {
        Exp2 = exp2;
    }

    public String getExp3() {
        return Exp3;
    }

    public void setExp3(String exp3) {
        Exp3 = exp3;
    }

    public Long getPartyId() {
        return partyId;
    }

    public void setPartyId(Long partyId) {
        this.partyId = partyId;
    }

    public String getSystemCode() {
        return systemCode;
    }

    public void setSystemCode(String systemCode) {
        this.systemCode = systemCode;
    }

    public Map<String, String> getEventMap() {
        return eventMap;
    }

    public void setEventMap(Map<String, String> eventMap) {
        this.eventMap = eventMap;
    }

    public void setEventMap(String eventId, String funnelId) {
        if(eventMap == null){
            eventMap = new HashMap<>();
        }
        eventMap.put(eventId,funnelId);
    }

    @Override
    public String toString() {
        return "FrontEventDto{" +
                "eventId='" + eventId + '\'' +
                ", funnelId='" + funnelId + '\'' +
                ", eventMap=" + eventMap +
                ", adviserId=" + adviserId +
                ", channelId=" + channelId +
                ", sourceType=" + sourceType +
                ", timestamp=" + timestamp +
                ", platCode='" + platCode + '\'' +
                ", isReader=" + isReader +
                ", partyId=" + partyId +
                ", systemCode='" + systemCode + '\'' +
                ", officeAccountId=" + officeAccountId +
                ", wechatUserId=" + wechatUserId +
                ", sceneId=" + sceneId +
                ", agentId=" + agentId +
                ", Exp1='" + Exp1 + '\'' +
                ", Exp2='" + Exp2 + '\'' +
                ", Exp3='" + Exp3 + '\'' +
                '}';
    }
}
