2025-12-06 10:38:48 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2025-12-19 10:20:30 +08:00
|
|
|
|
"cid/model/config"
|
|
|
|
|
|
|
2025-12-31 11:04:55 +08:00
|
|
|
|
"gitee.com/red-future---jilin-g/common/beans"
|
2025-12-06 10:38:48 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
2025-12-18 17:51:33 +08:00
|
|
|
|
const AdSourceCollection = "ad_source"
|
|
|
|
|
|
|
2025-12-06 10:38:48 +08:00
|
|
|
|
// AdSource 广告源实体
|
|
|
|
|
|
type AdSource struct {
|
2025-12-31 11:04:55 +08:00
|
|
|
|
beans.MongoBaseDO `bson:",inline" json:",inline"`
|
|
|
|
|
|
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 基本信息
|
2025-12-19 09:42:39 +08:00
|
|
|
|
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等
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 连接配置
|
2025-12-19 09:42:39 +08:00
|
|
|
|
Config string `bson:"config" json:"config"` // 广告源配置(JSON字符串)
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
|
|
|
|
|
// API配置
|
2025-12-19 10:20:30 +08:00
|
|
|
|
config.APIConfig `bson:",inline" json:",inline"` // 内联API配置
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
2025-12-19 09:42:39 +08:00
|
|
|
|
// 创意配置
|
2025-12-19 10:20:30 +08:00
|
|
|
|
config.CreativeConfig `bson:",inline" json:",inline"` // 内联创意配置
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
2025-12-19 09:42:39 +08:00
|
|
|
|
// 广告源能力
|
|
|
|
|
|
Capabilities *AdSourceCapabilities `bson:"capabilities" json:"capabilities"` // 广告源能力
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
2025-12-19 09:42:39 +08:00
|
|
|
|
// 支付配置
|
2025-12-19 10:20:30 +08:00
|
|
|
|
config.PaymentConfig `bson:",inline" json:",inline"` // 内联支付配置
|
2025-12-06 10:38:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// AdSourceCapabilities 广告源能力
|
|
|
|
|
|
type AdSourceCapabilities struct {
|
|
|
|
|
|
// 广告格式
|
2025-12-19 09:42:39 +08:00
|
|
|
|
SupportedFormats []AdFormat `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 功能特性
|
2025-12-19 09:42:39 +08:00
|
|
|
|
RealTimeBidding bool `bson:"realTimeBidding" json:"realTimeBidding"` // 实时竞价
|
|
|
|
|
|
HeaderBidding bool `bson:"headerBidding" json:"headerBidding"` // 标题竞价
|
|
|
|
|
|
ProgrammaticDirect bool `bson:"programmaticDirect" json:"programmaticDirect"` // 程序化直购
|
|
|
|
|
|
PrivateMarketplace bool `bson:"privateMarketplace" json:"privateMarketplace"` // 私有交易市场
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 质量控制
|
2025-12-19 09:42:39 +08:00
|
|
|
|
FraudDetection bool `bson:"fraudDetection" json:"fraudDetection"` // 反欺诈检测
|
|
|
|
|
|
BrandSafety bool `bson:"brandSafety" json:"brandSafety"` // 品牌安全
|
|
|
|
|
|
Viewability bool `bson:"viewability" json:"viewability"` // 可见度验证
|
|
|
|
|
|
CreativeApproval bool `bson:"creativeApproval" json:"creativeApproval"` // 创意审核
|
2025-12-06 10:38:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 数据能力
|
2025-12-19 09:42:39 +08:00
|
|
|
|
AudienceTargeting bool `bson:"audienceTargeting" json:"audienceTargeting"` // 受众定向
|
|
|
|
|
|
ContextualTargeting bool `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
|
|
|
|
|
CrossDeviceTargeting bool `bson:"crossDeviceTargeting" json:"crossDeviceTargeting"` // 跨设备定向
|
2025-12-06 10:38:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// AdFormat 广告格式
|
|
|
|
|
|
type AdFormat struct {
|
2025-12-19 09:42:39 +08:00
|
|
|
|
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类型
|
2025-12-06 10:38:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 09:42:39 +08:00
|
|
|
|
// GetCollectionName 获取集合名称
|
|
|
|
|
|
func (a *AdSource) GetCollectionName() string {
|
|
|
|
|
|
return AdSourceCollection
|
2025-12-06 10:38:48 +08:00
|
|
|
|
}
|