package com.ydl.ydlnet.builder.bean

/**
 * Created by xj on 2019/6/22.
 */
class ApiErrorActionBean private constructor(builder: Builder) {

    /**
     * partId : sy_1 //埋点板块
     * position : psychic_advisory_click //点击事件
     * type : 1 //业务类型 1.埋点
     * uid : 123 //用户ID
     * channel ：huawei //渠道
     * deviceId : //设备ID Android端取imei做md5加密，iOS端取idfa做md5加密 为32位的串
     * time : 1560389634000 //事件发生时间，毫秒级时间戳
     * ip : 192.168.0.1 //IP地址
     * appVersion : 3.8.00 //版本号
     * appId :    ydl-app-android-user
     * url : https://www.baidu.com //访问地址
     * server : 123
     * api : https://www.baidu.com/api
     * manufacturer : Apple //设备厂商，字符串类型，如"Apple"
     * model : iphone6 //设备型号，字符串类型，如"iphone6"
     * os : iOS //操作系统，字符串类型，如"iOS"
     * osVersion : 8.1.1 //操作系统版本，字符串类型，如"8.1.1"
     * screenHeight : 1920 //屏幕高度，数字类型，如1920
     * screenWidth : 1080 //屏幕宽度，数字类型，如1080
     * wifi :  1 //网络类型：1.2G 3.3G 4.4G 5.5G 6.WIFI
     * sign1 :
     * sign2 :
     * sign3 :
     * sign4 :
     * sign5 :
     */

    var partId: String? = null
    var type : Int? = 0
    var position: String? = null
    var uid: String? = null
    var channel:String? = null
    var deviceId : String? = null
    var time: Long = 0.toLong()
    var ip: String? = null
    var appVersion: String? = null
    var appId: String? = null
    var url: String? = null
    var server: String? = null
    var api: String? = null
    var manufacturer: String? = null
    var model: String? = null
    var os: String? = null
    var osVersion: String? = null
    var screenHeight: Int = 0
    var screenWidth: Int = 0
    var wifi: Int = 0
    var sign1: String? = null
    var sign2: String? = null
    var sign3: String? = null
    var sign4: String? = null
    var sign5: String? = null

    init {
        this.partId = builder.partId
        this.type = builder.type
        this.position = builder.position
        this.uid = builder.uid
        this.channel = builder.channel
        this.deviceId = builder.deviceId
        this.time = builder.time
        this.ip = builder.ip
        this.appVersion = builder.appVersion
        this.appId = builder.appId
        this.url = builder.url
        this.server = builder.server
        this.api = builder.api
        this.manufacturer = builder.manufacturer
        this.model = builder.model
        this.os = builder.os
        this.osVersion = builder.osVersion
        this.screenHeight = builder.screenHeight
        this.screenWidth = builder.screenWidth
        this.wifi = builder.wifi
        this.sign1 = builder.sign1
        this.sign2 = builder.sign2
        this.sign3 = builder.sign3
        this.sign4 = builder.sign4
        this.sign5 = builder.sign5
    }

    class Builder {
        internal var partId: String? = ""
        internal var type : Int? = 0
        internal var position: String? = ""
        internal var uid: String? = ""
        internal var channel: String?=""
        internal var deviceId : String? =""
        internal var time: Long = 0.toLong()
        internal var ip: String? = ""
        internal var appVersion: String? = ""
        internal var appId: String? = ""
        internal var url: String? = ""
        internal var server: String? = ""
        internal var api: String? = ""
        internal var manufacturer: String? = ""
        internal var model: String? = ""
        internal var os: String? = ""
        internal var osVersion: String? = ""
        internal var screenHeight: Int = 0
        internal var screenWidth: Int = 0
        internal var wifi: Int = 0
        internal var sign1: String? = ""
        internal var sign2: String? = ""
        internal var sign3: String? = ""
        internal var sign4: String? = ""
        internal var sign5: String? = ""

        fun partId(partId: String = ""): Builder {
            this.partId = partId
            return this
        }

        fun type(type : Int = 0) : Builder{
            this.type = type
            return this
        }

        fun position(position: String = ""): Builder {
            this.position = position
            return this
        }
        fun uid(uid: String = ""): Builder {
            this.uid = uid
            return this
        }
        fun channel(channel:String = ""): Builder{
            this.channel = channel
            return this
        }
        fun deviceId(deviceId: String = "") : Builder{
            this.deviceId = deviceId
            return this
        }

        fun time(time: Long = 0.toLong()): Builder {
            this.time = time
            return this
        }
        fun ip(ip: String = ""): Builder {
            this.ip = ip
            return this
        }
        fun appVersion(appVersion: String = ""): Builder {
            this.appVersion = appVersion
            return this
        }
        fun appId(appId: String = ""): Builder {
            this.appId = appId
            return this
        }
        fun url(url: String = ""): Builder {
            this.url = url
            return this
        }
        fun server(server: String = ""): Builder {
            this.server = server
            return this
        }
        fun api(api: String = ""): Builder {
            this.api = api
            return this
        }
        fun manufacturer(manufacturer: String = ""): Builder {
            this.manufacturer = manufacturer
            return this
        }
        fun model(model: String = ""): Builder {
            this.model = model
            return this
        }
        fun os(os: String = ""): Builder {
            this.os = os
            return this
        }
        fun osVersion(osVersion: String = ""): Builder {
            this.osVersion = osVersion
            return this
        }
        fun screenHeight(screenHeight: Int = 0): Builder {
            this.screenHeight = screenHeight
            return this
        }
        fun screenWidth(screenWidth: Int = 0): Builder {
            this.screenWidth = screenWidth
            return this
        }
        fun wifi(wifi: Int = 0): Builder {
            this.wifi = wifi
            return this
        }
        fun sign1(sign1: String = ""): Builder {
            this.sign1 = sign1
            return this
        }
        fun sign2(sign2: String = ""): Builder {
            this.sign2 = sign2
            return this
        }
        fun sign3(sign3: String = ""): Builder {
            this.sign3 = sign3
            return this
        }
        fun sign4(sign4: String = ""): Builder {
            this.sign4 = sign4
            return this
        }
        fun sign5(sign5: String = ""): Builder {
            this.sign5 = sign5
            return this
        }

        fun build() : ApiErrorActionBean {
            return ApiErrorActionBean(this)
        }



    }
}