1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package utils
- import (
- "fmt"
- "math/rand"
- "time"
- )
- type DspParam struct {
- DspCityCode int `json:"dsp_city_code"`
- Deviceid string
- DeviceidType int `json:"device_id_type"` // 设备类型
- Adspaceid string // 广告位标识
- OsType string // 系统类型 Android ios
- OsVersion string `json:"os_version"`
- Ver string // 软件版本
- SdkVersion string // 系统版本号
- Source string
- PhoneType string
- UserAgent string
- ScreenWidth int `json:"screen_width"`
- ScreenHeight int `json:"screen_height"`
- ScreenDensity int `json:"screen_density"`
- Channel string
- CarrierId int
- Lng float64
- Lat float64
- Placements string
- Ip string `json:"ip"`
- RequestId string `json:"request_id"`
- Advertiser string
- UserId int
- Num int // 新闻条数
- Hongtu int
- Is360Circle int `json:"is_360_circle"`// 1 足迹banner 2 圈子广告 3 资讯广告
- AdType int `json:"ad_type"`// 广告类型 1 默认开屏
- Category string
- LocalIp string `json:"local_ip"`
- ScreenScale int // 屏幕倍率
- SourceFlag int // 0:安卓 1:ios
- Imei string
- RealMd5Imei string `json:"real_md5_imei"`
- OriginImei string `json:"origin_imei"`
- Mac string
- OriginMac string `json:"origin_mac"`
- Idfa string
- Model string
- Brand string
- ScreenSize string `json:"screen_size"`
- NetworkType int `json:"network_type"`
- Androidid string `json:"android_id"`
- Platform int
- City string
- Province string
- Ua string `json:"ua"`
- UaOrigin string `json:"ua_client"`
- ReqSource string `json:"req_source"`
- RealMiFlag int
- ReplaceFlag int `json:"replace_flag"`
- RealReqSource string `json:"real_req_source"`
- SupClickFlag int `json:"sup_click_flag"`
- SendPhoneType int
- SupShowFlag int `json:"sup_show_flag"`
- VideoTimeDuration int
- AllDuration int64
- }
- func (self *DspParam) Init() {
- // 获取随机的请求id
- randNum := rand.Intn(89999999) + 10000000
- self.RequestId = fmt.Sprintf("%d_%d", time.Now().Unix(), randNum)
- self.DeviceidType = 1
- self.ScreenWidth = 1080
- self.ScreenHeight = 1920
- self.ScreenDensity = 3
- self.Num = 1
- self.Is360Circle = 1
- self.AdType = 1
- self.LocalIp = "__ADS_LP__"
- self.SupClickFlag = 1
- self.SupShowFlag = 1
- }
|