75 lines
3.2 KiB
Go
75 lines
3.2 KiB
Go
package entity
|
||
|
||
import (
|
||
"cid/model/config"
|
||
|
||
"gitea.com/red-future/common/beans"
|
||
)
|
||
|
||
const AdSourceCollection = "ad_source"
|
||
|
||
// AdSource 广告源实体
|
||
type AdSource struct {
|
||
beans.MongoBaseDO `bson:",inline" json:",inline"`
|
||
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
||
|
||
// 基本信息
|
||
Name string `bson:"name" json:"name"` // 广告源名称
|
||
Code string `bson:"code" json:"code"` // 广告源编码,唯一标识
|
||
Provider string `bson:"provider" json:"provider"` // 提供商:self(自营)、chuanshanjia(穿山甲)、gdt(腾讯广点通)、baidu(百度)、byteance(字节跳动)等
|
||
Type string `bson:"type" json:"type"` // 类型:self(自营)、third_party(第三方)、exchange(广告交易平台)、platform_ad_source(平台广告源)
|
||
Category string `bson:"category" json:"category"` // 分类:network、ssp、dsp、rtb等
|
||
|
||
// 连接配置
|
||
Config string `bson:"config" json:"config"` // 广告源配置(JSON字符串)
|
||
|
||
// API配置
|
||
config.APIConfig `bson:",inline" json:",inline"` // 内联API配置
|
||
|
||
// 创意配置
|
||
config.CreativeConfig `bson:",inline" json:",inline"` // 内联创意配置
|
||
|
||
// 广告源能力
|
||
Capabilities *AdSourceCapabilities `bson:"capabilities" json:"capabilities"` // 广告源能力
|
||
|
||
// 支付配置
|
||
config.PaymentConfig `bson:",inline" json:",inline"` // 内联支付配置
|
||
}
|
||
|
||
// AdSourceCapabilities 广告源能力
|
||
type AdSourceCapabilities struct {
|
||
// 广告格式
|
||
SupportedFormats []AdFormat `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
||
|
||
// 功能特性
|
||
RealTimeBidding bool `bson:"realTimeBidding" json:"realTimeBidding"` // 实时竞价
|
||
HeaderBidding bool `bson:"headerBidding" json:"headerBidding"` // 标题竞价
|
||
ProgrammaticDirect bool `bson:"programmaticDirect" json:"programmaticDirect"` // 程序化直购
|
||
PrivateMarketplace bool `bson:"privateMarketplace" json:"privateMarketplace"` // 私有交易市场
|
||
|
||
// 质量控制
|
||
FraudDetection bool `bson:"fraudDetection" json:"fraudDetection"` // 反欺诈检测
|
||
BrandSafety bool `bson:"brandSafety" json:"brandSafety"` // 品牌安全
|
||
Viewability bool `bson:"viewability" json:"viewability"` // 可见度验证
|
||
CreativeApproval bool `bson:"creativeApproval" json:"creativeApproval"` // 创意审核
|
||
|
||
// 数据能力
|
||
AudienceTargeting bool `bson:"audienceTargeting" json:"audienceTargeting"` // 受众定向
|
||
ContextualTargeting bool `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
||
CrossDeviceTargeting bool `bson:"crossDeviceTargeting" json:"crossDeviceTargeting"` // 跨设备定向
|
||
}
|
||
|
||
// AdFormat 广告格式
|
||
type AdFormat struct {
|
||
Type string `bson:"type" json:"type"` // 格式类型:banner、video、native、interstitial等
|
||
Name string `bson:"name" json:"name"` // 格式名称
|
||
Width int `bson:"width" json:"width"` // 宽度
|
||
Height int `bson:"height" json:"height"` // 高度
|
||
MimeType string `bson:"mimeType" json:"mimeType"` // MIME类型
|
||
}
|
||
|
||
// GetCollectionName 获取集合名称
|
||
func (a *AdSource) GetCollectionName() string {
|
||
return AdSourceCollection
|
||
}
|