Files
cid/model/entity/ad_creative.go

69 lines
3.2 KiB
Go
Raw Permalink Normal View History

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 AdCreativeCollection = "ad_creative"
// AdCreative 广告创意素材实体
type AdCreative struct {
2025-12-31 11:04:55 +08:00
beans.MongoBaseDO `bson:",inline" json:",inline"`
AdvertiserId string `bson:"advertiserId" json:"advertiserId"` // 广告主ID
2025-12-19 09:42:39 +08:00
// 基本信息
Name string `bson:"name" json:"name"` // 创意名称
Title string `bson:"title" json:"title"` // 广告标题
Description string `bson:"description" json:"description"` // 广告描述
AdType string `bson:"adType" json:"adType"` // 广告类型image、video、native、interstitial等
Format string `bson:"format" json:"format"` // 创意格式jpg、png、mp4、html等
// 素材信息
MaterialURL string `bson:"materialUrl" json:"materialUrl"` // 素材URL
ThumbnailURL string `bson:"thumbnailUrl" json:"thumbnailUrl"` // 缩略图URL
LandingPageURL string `bson:"landingPageUrl" json:"landingPageUrl"` // 落地页URL
DisplayURL string `bson:"displayUrl" json:"displayUrl"` // 显示URL
// 尺寸和文件信息
Width int64 `bson:"width" json:"width"` // 宽度(px)
Height int64 `bson:"height" json:"height"` // 高度(px)
Size int64 `bson:"size" json:"size"` // 文件大小(bytes)
Duration int64 `bson:"duration" json:"duration"` // 时长(秒)
HasAudio bool `bson:"hasAudio" json:"hasAudio"` // 是否有音频
AspectRatio string `bson:"aspectRatio" json:"aspectRatio"` // 宽高比
// 技术信息
MimeType string `bson:"mimeType" json:"mimeType"` // MIME类型
Source string `bson:"source" json:"source"` // 来源upload、sync、generate
BackupURL string `bson:"backupUrl" json:"backupUrl"` // 备份URL
CDNURL string `bson:"cdnUrl" json:"cdnUrl"` // CDN加速URL
CompressInfo string `bson:"compressInfo" json:"compressInfo"` // 压缩信息JSON格式
// 平台兼容性
SupportedPlatforms []string `bson:"supportedPlatforms" json:"supportedPlatforms"` // 支持的平台
PlatformSpecific string `bson:"platformSpecific" json:"platformSpecific"` // 平台特定配置JSON格式
// 外部平台信息
ExternalCreativeId string `bson:"externalCreativeId" json:"externalCreativeId"` // 外部创意ID
PlatformId string `bson:"platformId" json:"platformId"` // 平台ID
SyncStatus string `bson:"syncStatus" json:"syncStatus"` // 同步状态
LastSyncTime int64 `bson:"lastSyncTime" json:"lastSyncTime"` // 最后同步时间
// 基础配置
2025-12-19 10:20:30 +08:00
config.BaseConfig `bson:",inline" json:",inline"` // 内联基础配置
2025-12-19 09:42:39 +08:00
// 限制配置
2025-12-19 10:20:30 +08:00
config.RestrictionConfig `bson:",inline" json:",inline"` // 内联限制配置
2025-12-19 09:42:39 +08:00
// 其他信息
Status string `bson:"status" json:"status"` // 状态active、inactive、archived
ExpireTime int64 `bson:"expireTime" json:"expireTime"` // 过期时间
}
// GetCollectionName 获取集合名称
func (a *AdCreative) GetCollectionName() string {
return AdCreativeCollection
}