2025-12-19 09:42:39 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2025-12-19 10:20:30 +08:00
|
|
|
|
"cid/model/config"
|
|
|
|
|
|
|
2026-02-24 16:24:47 +08:00
|
|
|
|
"gitea.com/red-future/common/beans"
|
2025-12-19 09:42:39 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const PlatformDeliveryRuleCollection = "platform_delivery_rule"
|
|
|
|
|
|
|
|
|
|
|
|
// PlatformDeliveryRule 平台投放规则实体
|
|
|
|
|
|
type PlatformDeliveryRule 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-19 09:42:39 +08:00
|
|
|
|
|
|
|
|
|
|
// 关联信息
|
|
|
|
|
|
AppID string `bson:"appId" json:"appId"` // 应用ID
|
|
|
|
|
|
PlatformID string `bson:"platformId" json:"platformId"` // 平台ID
|
|
|
|
|
|
|
|
|
|
|
|
// 规则基本信息
|
|
|
|
|
|
Name string `bson:"name" json:"name"` // 规则名称
|
|
|
|
|
|
Description string `bson:"description" json:"description"` // 规则描述
|
|
|
|
|
|
RuleType string `bson:"ruleType" json:"ruleType"` // 规则类型:budget、targeting、bidding、frequency等
|
|
|
|
|
|
|
|
|
|
|
|
// 预算配置
|
2025-12-19 10:20:30 +08:00
|
|
|
|
config.BudgetConfig `bson:",inline" json:",inline"` // 内联预算配置
|
2025-12-19 09:42:39 +08:00
|
|
|
|
|
|
|
|
|
|
// 出价配置
|
2025-12-19 10:20:30 +08:00
|
|
|
|
config.BiddingConfig `bson:",inline" json:",inline"` // 内联竞价配置
|
2025-12-19 09:42:39 +08:00
|
|
|
|
|
|
|
|
|
|
// 定向配置
|
|
|
|
|
|
TargetingConfig string `bson:"targetingConfig" json:"targetingConfig"` // 定向配置(JSON格式)
|
|
|
|
|
|
IncludeAudience []string `bson:"includeAudience" json:"includeAudience"` // 包含受众
|
|
|
|
|
|
ExcludeAudience []string `bson:"excludeAudience" json:"excludeAudience"` // 排除受众
|
|
|
|
|
|
|
|
|
|
|
|
// 频次控制配置
|
2025-12-19 10:20:30 +08:00
|
|
|
|
config.FrequencyCapConfig `bson:",inline" json:",inline"` // 内联频次控制配置
|
2025-12-19 09:42:39 +08:00
|
|
|
|
|
|
|
|
|
|
// 创意配置
|
|
|
|
|
|
CreativeRotation string `bson:"creativeRotation" json:"creativeRotation"` // 创意轮播方式:optimize、even、random
|
|
|
|
|
|
SelectedCreatives []string `bson:"selectedCreatives" json:"selectedCreatives"` // 选中的创意列表
|
|
|
|
|
|
ExcludedCreatives []string `bson:"excludedCreatives" json:"excludedCreatives"` // 排除的创意列表
|
|
|
|
|
|
|
|
|
|
|
|
// 平台特定配置
|
|
|
|
|
|
PlatformSpecific string `bson:"platformSpecific" json:"platformSpecific"` // 平台特定配置(JSON格式)
|
|
|
|
|
|
|
|
|
|
|
|
// 监控和告警
|
|
|
|
|
|
PerformanceThresholds string `bson:"performanceThresholds" json:"performanceThresholds"` // 性能阈值(JSON格式)
|
|
|
|
|
|
|
|
|
|
|
|
// 自动优化配置
|
|
|
|
|
|
IsAutoOptimize bool `bson:"isAutoOptimize" json:"isAutoOptimize"` // 是否自动优化
|
|
|
|
|
|
LastOptimizeTime int64 `bson:"lastOptimizeTime" json:"lastOptimizeTime"` // 最后优化时间
|
|
|
|
|
|
AutoOptimizeConfig string `bson:"autoOptimizeConfig" json:"autoOptimizeConfig"` // 自动优化配置(JSON格式)
|
|
|
|
|
|
|
|
|
|
|
|
// 执行统计
|
|
|
|
|
|
ExecutionCount int64 `bson:"executionCount" json:"executionCount"` // 执行次数
|
|
|
|
|
|
SuccessCount int64 `bson:"successCount" json:"successCount"` // 成功次数
|
|
|
|
|
|
FailureCount int64 `bson:"failureCount" json:"failureCount"` // 失败次数
|
|
|
|
|
|
LastExecutionTime int64 `bson:"lastExecutionTime" json:"lastExecutionTime"` // 最后执行时间
|
|
|
|
|
|
NextExecutionTime int64 `bson:"nextExecutionTime" json:"nextExecutionTime"` // 下次执行时间
|
|
|
|
|
|
|
|
|
|
|
|
// 执行信息
|
|
|
|
|
|
CreatedBy string `bson:"createdBy" json:"createdBy"` // 创建人
|
|
|
|
|
|
LastModifiedBy string `bson:"lastModifiedBy" json:"lastModifiedBy"` // 最后修改人
|
|
|
|
|
|
ModifiedReason string `bson:"modifiedReason" json:"modifiedReason"` // 修改原因
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetCollectionName 获取集合名称
|
|
|
|
|
|
func (p *PlatformDeliveryRule) GetCollectionName() string {
|
|
|
|
|
|
return PlatformDeliveryRuleCollection
|
|
|
|
|
|
}
|