package com.reyun.saas.mob.user.thread.model;


import lombok.Data;
import org.springframework.util.StringUtils;

/**
 * 用于筛选日志的实体类
 */
@Data
public class LogExportModel {
    //================  设备信息  ===============

    /**
     * 上报时间(精确)
     */
    private String eventTime;

    /**
     * 上报日期
     */
    private String date;

    /**
     * 应用名称
     */
    private String appName;

    /**
     * 应用包名
     */
    private String bundleid;

    /**
     * app版本
     */
    private String appVersion;

    /**
     * 渠道别名
     */
    private String 	channelAlias;

    /**
     * 渠道id
     */
    private String cid;

    /**
     * rdid
     */
    private String rdid;


    /**
     * 设备状态
     */
    private String equipmentStatus;


    /**
     * 作弊状态
     */
    private String 	cheatingBehavior;

    /**
     * 是否更新
     */
    private String isUpdate;


    /**
     * idfa
     */
    private String idfa;


    /**
     * idfv
     */
    private String idfv;


    /**
     * imei
     */
    private String imei;

    /**
     * oaid
     */
    private String oaid;

    /**
     * androidid
     */
    private String androidid;

    /**
     * sdk版本
     */
    private String sdkVersion;

    /**
     * ip
     */
    private String ip;

    /**
     * 打印日志 "," 分割
     */
    public String getLog(){
        StringBuilder stringBuilder = new StringBuilder();
        if(!StringUtils.isEmpty(eventTime)){
            stringBuilder.append(eventTime).append(",");
        }
        if(!StringUtils.isEmpty(date)){
            stringBuilder.append(date).append(",");
        }
        if(!StringUtils.isEmpty(appName)){
            stringBuilder.append(appName).append(",");
        }
        if(!StringUtils.isEmpty(bundleid)){
            stringBuilder.append(bundleid).append(",");
        }
        if(!StringUtils.isEmpty(appVersion)){
            stringBuilder.append(appVersion).append(",");
        }
        if(!StringUtils.isEmpty(channelAlias)){
            stringBuilder.append(channelAlias).append(",");
        }
        if(!StringUtils.isEmpty(cid)){
            stringBuilder.append(cid).append(",");
        }
        if(!StringUtils.isEmpty(rdid)){
            stringBuilder.append(rdid).append(",");
        }
        if(!StringUtils.isEmpty(equipmentStatus)){
            stringBuilder.append(equipmentStatus).append(",");
        }
        if(!StringUtils.isEmpty(cheatingBehavior)){
            stringBuilder.append(cheatingBehavior).append(",");
        }
        if(!StringUtils.isEmpty(isUpdate)){
            stringBuilder.append(isUpdate).append(",");
        }
        if(!StringUtils.isEmpty(idfa)){
            stringBuilder.append(idfa).append(",");
        }
        if(!StringUtils.isEmpty(idfv)){
            stringBuilder.append(idfv).append(",");
        }
        if(!StringUtils.isEmpty(imei)){
            stringBuilder.append(imei).append(",");
        }
        if(!StringUtils.isEmpty(oaid)){
            stringBuilder.append(oaid).append(",");
        }
        if(!StringUtils.isEmpty(androidid)){
            stringBuilder.append(androidid).append(",");
        }
        if(!StringUtils.isEmpty(sdkVersion)){
            stringBuilder.append(sdkVersion).append(",");
        }
        if(!StringUtils.isEmpty(ip)){
            stringBuilder.append(ip).append(",");
        }
        stringBuilder.append("\r\n");

        return stringBuilder.toString();
    }
}
