Files
cid/model/entity/platform_delivery_rule.go
2026-02-24 16:24:47 +08:00

72 lines
3.3 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package entity
import (
"cid/model/config"
"gitea.com/red-future/common/beans"
)
const PlatformDeliveryRuleCollection = "platform_delivery_rule"
// PlatformDeliveryRule 平台投放规则实体
type PlatformDeliveryRule struct {
beans.MongoBaseDO `bson:",inline" json:",inline"`
Status string `bson:"status" json:"status"` // 状态active、inactive、maintenance等
// 关联信息
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等
// 预算配置
config.BudgetConfig `bson:",inline" json:",inline"` // 内联预算配置
// 出价配置
config.BiddingConfig `bson:",inline" json:",inline"` // 内联竞价配置
// 定向配置
TargetingConfig string `bson:"targetingConfig" json:"targetingConfig"` // 定向配置JSON格式
IncludeAudience []string `bson:"includeAudience" json:"includeAudience"` // 包含受众
ExcludeAudience []string `bson:"excludeAudience" json:"excludeAudience"` // 排除受众
// 频次控制配置
config.FrequencyCapConfig `bson:",inline" json:",inline"` // 内联频次控制配置
// 创意配置
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
}