model

package
v1.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 42

Documentation

Index

Constants

View Source
const (
	// BASE_OAUTH_URL oauth api base url
	BASE_OAUTH_URL = "https://u.baidu.com/oauth/"
	// BASE_URL_SMS sms/service api base url
	BASE_URL_SMS = "https://api.baidu.com/json/sms/service/" // api base url
	// BASE_URL_FEED feed/v2 api base url
	BASE_URL_FEED = "https://api.baidu.com/json/feed/v1/"
	// BASE_URL_OCPC
	BASE_URL_OCPC = "https://ocpc.baidu.com/ocpcapi/api/"
	// ACTIONCB_URL
	ACTIONCB_URL = "https://als.baidu.com/cb/actionCb"
)
View Source
const (
	// PlatformID
	PlatformID = "4960345965958561794"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionCbRequest added in v1.2.8

type ActionCbRequest interface {
	RequestBody
}

type ActionCbResponse added in v1.2.8

type ActionCbResponse struct {
	ErrorCode int    `json:"error_code,omitempty"`
	ErrorMsg  string `json:"error_msg,omitempty"`
}

ActionCbResponse 转化追踪回调返回

func (ActionCbResponse) Error added in v1.2.8

func (r ActionCbResponse) Error() string

func (ActionCbResponse) IsError added in v1.2.8

func (r ActionCbResponse) IsError() bool

type Bool added in v1.2.7

type Bool bool

Bool support number/string in json

func (Bool) String added in v1.2.7

func (b Bool) String() string

func (*Bool) UnmarshalJSON added in v1.2.7

func (bl *Bool) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Bool) Value added in v1.2.7

func (b Bool) Value() bool

type ConversionRequest added in v1.2.8

type ConversionRequest interface {
	RequestBody
	OcpcToken() string
	SetOcpcToken(token string)
}

ConversionRequest 转化请求

type DataResponse added in v1.2.9

type DataResponse struct {
	// Code 请求处理状态,0:处理成功,非0:处理失败
	Code int `json:"code,omitempty"`
	// Message 请求处理话术
	Message string `json:"message,omitempty"`
	// Data 请求处理结果
	Data json.RawMessage `json:"data,omitempty"`
}

func (DataResponse) Error added in v1.2.9

func (r DataResponse) Error() string

Error implement error interface

func (DataResponse) IsError added in v1.2.9

func (r DataResponse) IsError() bool

IsError 判断结果是否错误

type Float64 added in v1.2.7

type Float64 float64

Float64 support string quoted number in json

func (Float64) String added in v1.2.7

func (f64 Float64) String(prec int) string

func (*Float64) UnmarshalJSON added in v1.2.7

func (f64 *Float64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Float64) Value added in v1.2.7

func (f64 Float64) Value() float64

type Int added in v1.2.7

type Int int

Int support string quoted number in json

func (Int) String added in v1.2.7

func (i Int) String() string

func (*Int) UnmarshalJSON added in v1.2.7

func (i *Int) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Int) Value added in v1.2.7

func (i Int) Value() int

type Int64 added in v1.2.7

type Int64 int64

Int64 support string quoted number in json

func (Int64) String added in v1.2.7

func (i64 Int64) String() string

func (*Int64) UnmarshalJSON added in v1.2.7

func (i64 *Int64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Int64) Value added in v1.2.7

func (i64 Int64) Value() int64

type JSONInt added in v1.2.7

type JSONInt int

JSONInt support string quoted number in json and marshal to string

func JSONIntFromInt added in v1.2.7

func JSONIntFromInt(v int) JSONInt

func (JSONInt) MarshalJSON added in v1.2.7

func (i JSONInt) MarshalJSON() ([]byte, error)

func (*JSONInt) UnmarshalJSON added in v1.2.7

func (i *JSONInt) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (JSONInt) Value added in v1.2.7

func (i JSONInt) Value() int

type JSONInt64 added in v1.2.7

type JSONInt64 int64

JSONInt64 support string quoted number in json and marshal to string

func JSONInt64FromInt64 added in v1.2.7

func JSONInt64FromInt64(v int64) JSONInt64

func (JSONInt64) MarshalJSON added in v1.2.7

func (i64 JSONInt64) MarshalJSON() ([]byte, error)

func (*JSONInt64) UnmarshalJSON added in v1.2.7

func (i64 *JSONInt64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (JSONInt64) Value added in v1.2.7

func (i64 JSONInt64) Value() int64

type JSONUint64 added in v1.2.7

type JSONUint64 uint64

JSONUint64 support string quoted number in json and marshal to string

func JSONUint64FromUint64 added in v1.2.7

func JSONUint64FromUint64(v uint64) JSONUint64

func (JSONUint64) MarshalJSON added in v1.2.7

func (u64 JSONUint64) MarshalJSON() ([]byte, error)

func (*JSONUint64) UnmarshalJSON added in v1.2.7

func (u64 *JSONUint64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (JSONUint64) Value added in v1.2.7

func (u64 JSONUint64) Value() uint64

type OfflineReason

type OfflineReason struct {
	// MainReason 推广下线主要原因ID,值为”3”时,代表审核不通过
	MainReason string `json:"mainReason,omitempty"`
	// DetailReason 推广下线具体原因,当mainReason为“3”时,本字段代表审核不通过的具体原因;结构说明:detailReason为json字符串,解析后为嵌套数组,内层数组第一个元素为具体拒绝理由;处理说明:字符串先解析成外层json数组,取外层数组第一个元素json数组作为内层数组,取内层数组的第一个元素字符串;示例:"[["您提交的物料涉及不合规内容,可能涉及以下问题(物料文字不合规:前面有名词但不是主语),请修改提交内容",""]]";
	DetailReason string `json:"detailReason,omitempty"`
}

OfflineReason 推广下线原因

type OfflineTime

type OfflineTime struct {
	// Time 下线/上线时间点
	Time string `json:"time"`
	// Flag 下线/上线状态: 1 - 上线; 0 - 下线
	Flag int `json:"flag"`
}

OfflineTime 推广下线时间

type RegionPriceFactor

type RegionPriceFactor struct {
	// RegionId 地域ID
	RegionId int64 `json:"regionId,omitempty"`
	// PriceFactor 出价系数; 取值范围:[1.0, 10.0]
	PriceFactor float64 `json:"priceFactor,omitempty"`
}

/ RegionPriceFactor 地域出价系数

type Request

type Request struct {
	// Header header 对象
	Header *RequestHeader `json:"header"`
	// Body 业务对象
	Body RequestBody `json:"body"`
}

Request API 请求对象

func (*Request) SetUser added in v1.2.9

func (r *Request) SetUser(username string, accessToken string)

SetUser set username password

func (Request) Url

func (r Request) Url() string

Url 请求API 地址

type RequestBody

type RequestBody interface {
	Url() string // 接口链接
}

RequestBody 请求业务数据

type RequestHeader

type RequestHeader struct {
	// Username 推广账户名称
	Username string `json:"userName,omitempty"`
	// AccessToken 百度商业服务市场服务商的access_token。注意属性名是大写的T
	AccessToken string `json:"accessToken,omitempty"`
}

RequestHeader 请求header对象

type Response

type Response struct {
	// Header header对象
	Header ResponseHeader `json:"header,omitempty"`
	// Body 业务对象
	Body json.RawMessage `json:"body,omitempty"`
}

Response API 返回结果

func (Response) Error

func (r Response) Error() string

Error implement error interface

func (Response) IsError

func (r Response) IsError() bool

IsError 判断结果是否错误

type ResponseFailure

type ResponseFailure struct {
	Code     int    `json:"code,omitempty"`
	Message  string `json:"message"`
	Position string `json:"position"`
}

ResponseFailure 返回错误信息

type ResponseHeader

type ResponseHeader struct {
	// Status 0:成功,1:部分失败,2:全部失败,3:系统错误
	Status int `json:"status,omitempty"`
	// Desc 描述
	Desc string `json:"desc,omitempty"`
	// Rquota 剩余的请求配额(现可忽略)
	Rquota int64 `json:"rquota,omitempty"`
	// Quota 本次请求发送的数据条数
	Quota int `json:"quota,omitempty"`
	// Failures  错误信息
	Failures []ResponseFailure `json:"failures,omitempty"`
	// Errors 错误信息
	Errors []ResponseFailure `json:"errors,omitempty"`
	// Oprs 成功操作数据条数
	Oprs int `json:"oprs,omitempty"`
	// Oprtime 操作时间描述
	Oprtime int64 `json:"oprtime,omitempty"`
}

ResponseHeader API 返回header对象

type Schedule

type Schedule struct {
	// StartHour 开始时间; 以小时为单位,取值范围:[0,23]
	StartHour int `json:"startHour"`
	// EndHour 结束时间; 以小时为单位,取值范围:[1,24]
	EndHour int `json:"endHour"`
	// WeekDay 星期几
	// 取值范围:枚举值,列表如下
	// 1 - 星期一
	// 2 - 星期二
	// 3 - 星期三
	// 4 - 星期四
	// 5 - 星期五
	// 6 - 星期六
	// 7 - 星期日
	WeekDay int `json:"weekDay"`
}

Sechedule 投放排期

type SchedulePriceFactor

type SchedulePriceFactor struct {
	// TimeId 时间段编号
	// 取值为3位整数,从左至右:
	// 第一位表示每周的星期几,取值为 1-7
	// 第二三位表示小时编号,取值范围为 00-23
	// 不设置的小时内将不投放
	// 例如:设置每周一的0点到1点投放时,该值取100;每周六的22点到23点投放时,该值取622
	TimeId int `json:"timeId"`
	// PriceFactor 出价系数;取值范围:[0.1, 10.0]
	PriceFactor float64 `json:"priceFactor"`
}

SchedulePriceFactor 排期价格系数

type StorePageInfo added in v1.2.7

type StorePageInfo struct {
	// StoreId 门店id
	StoreId uint64 `json:"storeId,omitempty"`
	// PageId 落地页id
	PageId uint64 `json:"pageId,omitempty"`
	// Url 落地页url
	Url string `json:"url,omitempty"`
	// PageType 落地页类型 0 梧桐 1 h5+小程序 2 医美 3 旺铺
	PageType int `json:"pageType,omitempty"`
	// MonitorCode 监控代码
	MonitorCode string `json:"monitorCode,omitempty"`
}

StorePageInfo 本地计划设置的门店落地页信息

type Uint64 added in v1.2.7

type Uint64 uint64

Uint64 support string quoted number in json

func (Uint64) String added in v1.2.7

func (u64 Uint64) String() string

func (*Uint64) UnmarshalJSON added in v1.2.7

func (u64 *Uint64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Uint64) Value added in v1.2.7

func (u64 Uint64) Value() uint64

Directories

Path Synopsis
asset
Package feed 信息流广告投放
Package feed 信息流广告投放
account
Package account 账户
Package account 账户
adgroup
Package adgroup 商品单元
Package adgroup 商品单元
adgroup/trans
Package trans 转化追踪
Package trans 转化追踪
campaign
Package campaign 计划
Package campaign 计划
creative
Package creative 创意
Package creative 创意
creative/dpa
Package dpa 商品创意
Package dpa 商品创意
Package oauth OAuth授权相关
Package oauth OAuth授权相关
Package search 搜索广告投放
Package search 搜索广告投放
account
Package account 账户
Package account 账户
adgroup
Package adgroup 单元
Package adgroup 单元
app
Package app APP服务
Package app APP服务
campaign
Package campaign 计划
Package campaign 计划
creative
Package creative 创意
Package creative 创意
keyword
Package keyword 关键词
Package keyword 关键词

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL