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

56 lines
2.6 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 AdvertisementCollection = "advertisement"
// Advertisement 广告实体
type Advertisement struct {
beans.MongoBaseDO `bson:",inline" json:",inline"`
AdvertiserId string `bson:"advertiserId" json:"advertiserId"` // 广告主ID
// 广告基本信息
Title string `bson:"title" json:"title"` // 广告标题
Description string `bson:"description" json:"description"` // 广告描述
AdPositionId string `bson:"adPositionId" json:"adPositionId"` // 广告位ID
AdType string `bson:"adType" json:"adType"` // 广告类型:图片、视频、文字等
AdFormat string `bson:"adFormat" json:"adFormat"` // 广告格式
MaterialUrl string `bson:"materialUrl" json:"materialUrl"` // 广告素材URL
TargetUrl string `bson:"targetUrl" json:"targetUrl"` // 目标链接(点击跳转或落地页)
// 平台和广告源信息
AdSourceId string `bson:"adSourceId" json:"adSourceId"` // 广告源ID
AdPlatformId string `bson:"adPlatformId" json:"adPlatformId"` // 广告平台ID当广告来自第三方平台时
ExternalAdId string `bson:"externalAdId" json:"externalAdId"` // 外部广告ID第三方平台的广告ID
AdProvider string `bson:"adProvider" json:"adProvider"` // 广告提供者self、chuanshanjia、xiaohongshu、douyin等
// 投放配置
config.BudgetConfig `bson:",inline" json:",inline"` // 内联预算配置
BidAmount int64 `bson:"bidAmount" json:"bidAmount"` // 出价(分)
BillingType string `bson:"billingType" json:"billingType"` // 计费类型CPC、CPM、CPA等
// 定向条件
Targeting *UnifiedTargeting `bson:"targeting" json:"targeting"` // 统一定向条件
// 审核状态
AuditStatus string `bson:"auditStatus" json:"auditStatus"` // 广告状态:待审核、审核中、已通过、已拒绝、投放中、已暂停、已结束
AuditReason string `bson:"auditReason" json:"auditReason"` // 审核不通过原因
AuditTime int64 `bson:"auditTime" json:"auditTime"` // 审核时间
AuditBy string `bson:"auditBy" json:"auditBy"` // 审核人
// 限制配置
config.RestrictionConfig `bson:",inline" json:",inline"` // 内联限制配置
// 其他状态信息
Status string `bson:"status" json:"status"` // 业务状态active、inactive、archived
}
// GetCollectionName 获取集合名称
func (a *Advertisement) GetCollectionName() string {
return AdvertisementCollection
}