gosdk/unify/ad_type.go

94 lines
2.8 KiB
Go
Raw Normal View History

2024-06-28 22:07:15 +08:00
package unify
2024-01-21 18:12:39 +08:00
import (
"errors"
"strings"
)
type BaseResponse struct {
Code int `json:"code"`
Message string `json:"message"`
}
type Request struct {
2024-09-02 15:16:52 +08:00
Channel string //安装包的渠道
Version string //安装包版本
Os string //手机系统类别 android、ioss
Ip string //客户端的外网ip
2024-09-12 16:56:25 +08:00
Ipv6 string //客户端的外网ipv6
2024-09-02 15:16:52 +08:00
Ua string //客户端的user-agent
Brand string // 客户端手机品牌
Model string //客户端的手机型号NOH-AN00
2024-09-29 20:03:22 +08:00
Cid string //广告带过来的点击ID小红书是click_id、百度是bdvid
2024-09-02 15:16:52 +08:00
Idfa string //客户端的广告idios时候有效
Paid string //客户端的广告idios时候有效百度特有
Oaid string //客户端的广告idandroid时有效
Imei string //设备唯一识别码
OsVersion string //操作系统版本号
Extra map[string]string //其他额外数据
Active bool // 是否直接激活
2024-01-21 18:12:39 +08:00
}
type Result struct {
AdId int64 `json:"adId"`
Source string `json:"source"`
Extra map[string]string `json:"extra"`
}
func (c *Request) Check() error {
if strings.ToLower(c.Os) != "ios" && c.Channel == "" {
return errors.New("channel must set")
}
if c.Version == "" {
return errors.New("version must set")
}
return nil
}
type AccountReport struct {
Id string `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
Day string `json:"day"`
Cost float64 `json:"cost"`
Show int64 `json:"show"`
Click int64 `json:"click"`
Download int64 `json:"download"`
Active int64 `json:"active"`
Register int64 `json:"register"`
Pay int64 `json:"pay"`
PayAmount float64 `json:"payAmount"`
Balance float64 `json:"balance"`
}
type Relation struct {
MatchType string `json:"matchType"`
CreateTime int64 `json:"createTime"`
ActiveTime int64 `json:"activeTime"`
RegisterTime int64 `json:"registerTime"`
PayTime int64 `json:"payTime"`
Source string `json:"source"`
}
type Click struct {
Action string `json:"action"`
AccountId int64 `json:"accountId"`
AccountName string `json:"accountName"`
PlanId int64 `json:"planId"`
PlanName string `json:"planName"`
GroupId int64 `json:"groupId"`
GroupName string `json:"groupName"`
CreativeId int64 `json:"creativeId"`
CreativeName string `json:"creativeName"`
ClickTime int64 `json:"clickTime"`
Ip string `json:"ip"`
Ua string `json:"ua"`
Idfa string `json:"idfa"`
Oaid string `json:"oaid"`
}
type AdRelation struct {
Relation *Relation `json:"relation"`
Click *Click `json:"click"`
}