初始化项目
This commit is contained in:
@@ -1,163 +1,167 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
"time"
|
||||
)
|
||||
|
||||
const AdSourceCollection = "ad_source"
|
||||
|
||||
// AdSource 广告源实体
|
||||
type AdSource struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||||
Creator string `json:"creator"` // 创建者
|
||||
Updater string `json:"updater"` // 更新者
|
||||
TenantId int64 `json:"tenantId"` // 租户ID
|
||||
IsDeleted bool `json:"isDeleted"` // 是否删除
|
||||
|
||||
// 基本信息
|
||||
Name string `bson:"name" json:"name"` // 广告源名称
|
||||
Code string `bson:"code" json:"code"` // 广告源编码,唯一标识
|
||||
Provider string `bson:"provider" json:"provider"` // 提供商:google、facebook、baidu、tencent、self等
|
||||
Type string `bson:"type" json:"type"` // 类型:self(自营)、third_party(第三方)、exchange(广告交易平台)
|
||||
Description string `bson:"description" json:"description"` // 描述
|
||||
Name string `json:"name"` // 广告源名称
|
||||
Code string `json:"code"` // 广告源编码,唯一标识
|
||||
Provider string `json:"provider"` // 提供商:google、facebook、baidu、tencent、self等
|
||||
Type string `json:"type"` // 类型:self(自营)、third_party(第三方)、exchange(广告交易平台)
|
||||
Description string `json:"description"` // 描述
|
||||
|
||||
// 连接配置
|
||||
Config *AdSourceConfig `bson:"config" json:"config"` // 广告源配置
|
||||
Config string `json:"config"` // 广告源配置(JSON字符串)
|
||||
|
||||
// API配置
|
||||
APIEndpoint string `bson:"apiEndpoint" json:"apiEndpoint"` // API端点
|
||||
APIVersion string `bson:"apiVersion" json:"apiVersion"` // API版本
|
||||
AuthType string `bson:"authType" json:"authType"` // 认证类型:api_key、oauth、basic
|
||||
AuthConfig map[string]interface{} `bson:"authConfig" json:"authConfig"` // 认证配置
|
||||
Headers map[string]string `bson:"headers" json:"headers"` // 请求头配置
|
||||
Timeout int `bson:"timeout" json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `bson:"retryCount" json:"retryCount"` // 重试次数
|
||||
APIEndpoint string `json:"apiEndpoint"` // API端点
|
||||
APIVersion string `json:"apiVersion"` // API版本
|
||||
AuthType string `json:"authType"` // 认证类型:api_key、oauth、basic
|
||||
AuthConfig string `json:"authConfig"` // 认证配置(JSON字符串)
|
||||
Headers string `json:"headers"` // 请求头配置(JSON字符串)
|
||||
Timeout int `json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `json:"retryCount"` // 重试次数
|
||||
|
||||
// 广告源能力
|
||||
Capabilities *AdSourceCapabilities `bson:"capabilities" json:"capabilities"` // 广告源能力
|
||||
Capabilities string `json:"capabilities"` // 广告源能力(JSON字符串)
|
||||
|
||||
// 质量指标
|
||||
QualityMetrics *AdSourceQualityMetrics `bson:"qualityMetrics" json:"qualityMetrics"` // 质量指标
|
||||
QualityMetrics string `json:"qualityMetrics"` // 质量指标(JSON字符串)
|
||||
|
||||
// 财务设置
|
||||
PaymentTerms *PaymentTerms `bson:"paymentTerms" json:"paymentTerms"` // 支付条款
|
||||
PaymentTerms string `json:"paymentTerms"` // 支付条款(JSON字符串)
|
||||
|
||||
// 状态信息
|
||||
Status string `bson:"status" json:"status"` // 广告源状态:active、inactive、maintenance
|
||||
Health string `bson:"health" json:"health"` // 健康状态:healthy、degraded、unhealthy
|
||||
LastCheckAt int64 `bson:"lastCheckAt" json:"lastCheckAt"` // 最后检查时间
|
||||
Status string `json:"status"` // 广告源状态:active、inactive、maintenance
|
||||
Health string `json:"health"` // 健康状态:healthy、degraded、unhealthy
|
||||
LastCheckAt int64 `json:"lastCheckAt"` // 最后检查时间
|
||||
|
||||
// 统计信息
|
||||
TotalRequests int64 `bson:"totalRequests" json:"totalRequests"` // 总请求数
|
||||
SuccessfulRequests int64 `bson:"successfulRequests" json:"successfulRequests"` // 成功请求数
|
||||
FailedRequests int64 `bson:"failedRequests" json:"failedRequests"` // 失败请求数
|
||||
AverageResponseTime float64 `bson:"averageResponseTime" json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
FillRate float64 `bson:"fillRate" json:"fillRate"` // 填充率
|
||||
CTR float64 `bson:"ctr" json:"ctr"` // 点击率
|
||||
CVR float64 `bson:"cvr" json:"cvr"` // 转化率
|
||||
TotalRequests int64 `json:"totalRequests"` // 总请求数
|
||||
SuccessfulRequests int64 `json:"successfulRequests"` // 成功请求数
|
||||
FailedRequests int64 `json:"failedRequests"` // 失败请求数
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
|
||||
// 系统信息
|
||||
Priority int `bson:"priority" json:"priority"` // 优先级,数值越高优先级越高
|
||||
Priority int `json:"priority"` // 优先级,数值越高优先级越高
|
||||
}
|
||||
|
||||
// AdSourceConfig 广告源配置
|
||||
type AdSourceConfig struct {
|
||||
// 基础配置
|
||||
SupportedFormats []string `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedSizes []string `bson:"supportedSizes" json:"supportedSizes"` // 支持的尺寸
|
||||
SupportedDevices []string `bson:"supportedDevices" json:"supportedDevices"` // 支持的设备类型
|
||||
SupportedOS []string `bson:"supportedOS" json:"supportedOS"` // 支持的操作系统
|
||||
SupportedCountries []string `bson:"supportedCountries" json:"supportedCountries"` // 支持的国家/地区
|
||||
SupportedFormats []string `json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedSizes []string `json:"supportedSizes"` // 支持的尺寸
|
||||
SupportedDevices []string `json:"supportedDevices"` // 支持的设备类型
|
||||
SupportedOS []string `json:"supportedOS"` // 支持的操作系统
|
||||
SupportedCountries []string `json:"supportedCountries"` // 支持的国家/地区
|
||||
|
||||
// 竞价配置
|
||||
BiddingType string `bson:"biddingType" json:"biddingType"` // 竞价类型:cpm、cpc、cpa、rtb
|
||||
MinBidAmount int64 `bson:"minBidAmount" json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `bson:"maxBidAmount" json:"maxBidAmount"` // 最大出价(分)
|
||||
BidIncrement int64 `bson:"bidIncrement" json:"bidIncrement"` // 出价增量(分)
|
||||
DefaultBidAmount int64 `bson:"defaultBidAmount" json:"defaultBidAmount"` // 默认出价(分)
|
||||
AutoOptimization bool `bson:"autoOptimization" json:"autoOptimization"` // 是否自动优化
|
||||
BiddingType string `json:"biddingType"` // 竞价类型:cpm、cpc、cpa、rtb
|
||||
MinBidAmount int64 `json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `json:"maxBidAmount"` // 最大出价(分)
|
||||
BidIncrement int64 `json:"bidIncrement"` // 出价增量(分)
|
||||
DefaultBidAmount int64 `json:"defaultBidAmount"` // 默认出价(分)
|
||||
AutoOptimization bool `json:"autoOptimization"` // 是否自动优化
|
||||
|
||||
// 定向配置
|
||||
TargetingSupport *TargetingSupport `bson:"targetingSupport" json:"targetingSupport"` // 定向支持
|
||||
TargetingSupport *TargetingSupport `json:"targetingSupport"` // 定向支持
|
||||
|
||||
// 其他配置
|
||||
MaxAdsPerRequest int `bson:"maxAdsPerRequest" json:"maxAdsPerRequest"` // 单次请求最大广告数量
|
||||
BrandSafety bool `bson:"brandSafety" json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `bson:"viewability" json:"viewability"` // 可见性支持
|
||||
MaxAdsPerRequest int `json:"maxAdsPerRequest"` // 单次请求最大广告数量
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见性支持
|
||||
}
|
||||
|
||||
// TargetingSupport 定向支持
|
||||
type TargetingSupport struct {
|
||||
GeoTargeting bool `bson:"geoTargeting" json:"geoTargeting"` // 地理定向
|
||||
DemographicTargeting bool `bson:"demographicTargeting" json:"demographicTargeting"` // 人口统计定向
|
||||
BehavioralTargeting bool `bson:"behavioralTargeting" json:"behavioralTargeting"` // 行为定向
|
||||
ContextualTargeting bool `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
||||
DeviceTargeting bool `bson:"deviceTargeting" json:"deviceTargeting"` // 设备定向
|
||||
TimeTargeting bool `bson:"timeTargeting" json:"timeTargeting"` // 时间定向
|
||||
Retargeting bool `bson:"retargeting" json:"retargeting"` // 重定向
|
||||
CookieTargeting bool `bson:"cookieTargeting" json:"cookieTargeting"` // Cookie定向
|
||||
GeoTargeting bool `json:"geoTargeting"` // 地理定向
|
||||
DemographicTargeting bool `json:"demographicTargeting"` // 人口统计定向
|
||||
BehavioralTargeting bool `json:"behavioralTargeting"` // 行为定向
|
||||
ContextualTargeting bool `json:"contextualTargeting"` // 上下文定向
|
||||
DeviceTargeting bool `json:"deviceTargeting"` // 设备定向
|
||||
TimeTargeting bool `json:"timeTargeting"` // 时间定向
|
||||
Retargeting bool `json:"retargeting"` // 重定向
|
||||
CookieTargeting bool `json:"cookieTargeting"` // Cookie定向
|
||||
}
|
||||
|
||||
// AdSourceCapabilities 广告源能力
|
||||
type AdSourceCapabilities struct {
|
||||
// 广告格式
|
||||
SupportedFormats []AdFormat `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedFormats []AdFormat `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"` // 私有交易市场
|
||||
RealTimeBidding bool `json:"realTimeBidding"` // 实时竞价
|
||||
HeaderBidding bool `json:"headerBidding"` // 标题竞价
|
||||
ProgrammaticDirect bool `json:"programmaticDirect"` // 程序化直购
|
||||
PrivateMarketplace bool `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"` // 创意审核
|
||||
FraudDetection bool `json:"fraudDetection"` // 反欺诈检测
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见度验证
|
||||
CreativeApproval bool `json:"creativeApproval"` // 创意审核
|
||||
|
||||
// 数据能力
|
||||
AudienceTargeting bool `bson:"audienceTargeting" json:"audienceTargeting"` // 受众定向
|
||||
ContextualTargeting bool `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
||||
CrossDeviceTargeting bool `bson:"crossDeviceTargeting" json:"crossDeviceTargeting"` // 跨设备定向
|
||||
AudienceTargeting bool `json:"audienceTargeting"` // 受众定向
|
||||
ContextualTargeting bool `json:"contextualTargeting"` // 上下文定向
|
||||
CrossDeviceTargeting bool `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类型
|
||||
Type string `json:"type"` // 格式类型:banner、video、native、interstitial等
|
||||
Name string `json:"name"` // 格式名称
|
||||
Width int `json:"width"` // 宽度
|
||||
Height int `json:"height"` // 高度
|
||||
MimeType string `json:"mimeType"` // MIME类型
|
||||
}
|
||||
|
||||
// AdSourceQualityMetrics 广告源质量指标
|
||||
type AdSourceQualityMetrics struct {
|
||||
// 性能指标
|
||||
AverageResponseTime float64 `bson:"averageResponseTime" json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
SuccessRate float64 `bson:"successRate" json:"successRate"` // 成功率
|
||||
ErrorRate float64 `bson:"errorRate" json:"errorRate"` // 错误率
|
||||
Uptime float64 `bson:"uptime" json:"uptime"` // 可用性(百分比)
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
SuccessRate float64 `json:"successRate"` // 成功率
|
||||
ErrorRate float64 `json:"errorRate"` // 错误率
|
||||
Uptime float64 `json:"uptime"` // 可用性(百分比)
|
||||
|
||||
// 广告质量
|
||||
CTR float64 `bson:"ctr" json:"ctr"` // 点击率
|
||||
CVR float64 `bson:"cvr" json:"cvr"` // 转化率
|
||||
FillRate float64 `bson:"fillRate" json:"fillRate"` // 填充率
|
||||
ViewabilityRate float64 `bson:"viewabilityRate" json:"viewabilityRate"` // 可见率
|
||||
BrandSafetyScore float64 `bson:"brandSafetyScore" json:"brandSafetyScore"` // 品牌安全评分
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
ViewabilityRate float64 `json:"viewabilityRate"` // 可见率
|
||||
BrandSafetyScore float64 `json:"brandSafetyScore"` // 品牌安全评分
|
||||
|
||||
// 财务指标
|
||||
eCPM int64 `bson:"ecpm" json:"ecpm"` // 有效千次展示成本(分)
|
||||
eCPC int64 `bson:"ecpc" json:"ecpc"` // 有效点击成本(分)
|
||||
RevenuePerRequest int64 `bson:"revenuePerRequest" json:"revenuePerRequest"` // 每请求收入(分)
|
||||
Ecpm int64 `json:"ecpm"` // 有效千次展示成本(分)
|
||||
Ecpc int64 `json:"ecpc"` // 有效点击成本(分)
|
||||
RevenuePerRequest int64 `json:"revenuePerRequest"` // 每请求收入(分)
|
||||
|
||||
// 时间指标
|
||||
LastUpdated int64 `bson:"lastUpdated" json:"lastUpdated"` // 最后更新时间
|
||||
MetricsUpdateWindow int `bson:"metricsUpdateWindow" json:"metricsUpdateWindow"` // 指标更新窗口(分钟)
|
||||
LastUpdated int64 `json:"lastUpdated"` // 最后更新时间
|
||||
MetricsUpdateWindow int `json:"metricsUpdateWindow"` // 指标更新窗口(分钟)
|
||||
}
|
||||
|
||||
// PaymentTerms 支付条款
|
||||
type PaymentTerms struct {
|
||||
BillingModel string `bson:"billingModel" json:"billingModel"` // 计费模式:cpm、cpc、cpa、rev_share
|
||||
PaymentTerms string `bson:"paymentTerms" json:"paymentTerms"` // 支付条款:net_30、net_60、net_90
|
||||
RevShareRate float64 `bson:"revShareRate" json:"revShareRate"` // 收入分成比例(0-1)
|
||||
MinPayment int64 `bson:"minPayment" json:"minPayment"` // 最小支付金额(分)
|
||||
Currency string `bson:"currency" json:"currency"` // 货币单位
|
||||
TaxInclusive bool `bson:"taxInclusive" json:"taxInclusive"` // 是否含税
|
||||
EarlyPaymentDiscount float64 `bson:"earlyPaymentDiscount" json:"earlyPaymentDiscount"` // 提前付款折扣
|
||||
BillingModel string `json:"billingModel"` // 计费模式:cpm、cpc、cpa、rev_share
|
||||
PaymentTerms string `json:"paymentTerms"` // 支付条款:net_30、net_60、net_90
|
||||
RevShareRate float64 `json:"revShareRate"` // 收入分成比例(0-1)
|
||||
MinPayment int64 `json:"minPayment"` // 最小支付金额(分)
|
||||
Currency string `json:"currency"` // 货币单位
|
||||
TaxInclusive bool `json:"taxInclusive"` // 是否含税
|
||||
EarlyPaymentDiscount float64 `json:"earlyPaymentDiscount"` // 提前付款折扣
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user