初始化项目

This commit is contained in:
2025-12-06 09:10:24 +08:00
parent d730752f01
commit c9fcfc761e
35 changed files with 4283 additions and 295 deletions

View File

@@ -0,0 +1,91 @@
package entity
import (
"gitee.com/red-future---jilin-g/common/do"
)
const AdvertisementCollection = "advertisement"
// Advertisement 广告实体
type Advertisement struct {
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
// 广告基本信息
Title string `bson:"title" json:"title"` // 广告标题
Description string `bson:"description" json:"description"` // 广告描述
AdvertiserId string `bson:"advertiserId" json:"advertiserId"` // 广告主ID
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
LinkUrl string `bson:"linkUrl" json:"linkUrl"` // 点击跳转链接
LandingPageUrl string `bson:"landingPageUrl" json:"landingPageUrl"` // 落地页URL
// 投放设置
StartDate int64 `bson:"startDate" json:"startDate"` // 开始投放时间
EndDate int64 `bson:"endDate" json:"endDate"` // 结束投放时间
Budget int64 `bson:"budget" json:"budget"` // 预算(分)
DailyBudget int64 `bson:"dailyBudget" json:"dailyBudget"` // 日预算(分)
BidAmount int64 `bson:"bidAmount" json:"bidAmount"` // 出价(分)
BillingType string `bson:"billingType" json:"billingType"` // 计费类型CPC、CPM、CPA等
// 投放条件
Targeting *Targeting `bson:"targeting" json:"targeting"` // 定向条件
// 状态信息
Status string `bson:"status" json:"status"` // 广告状态:待审核、已审核、已拒绝、投放中、已暂停、已结束
AuditStatus string `bson:"auditStatus" json:"auditStatus"` // 审核状态
AuditReason string `bson:"auditReason" json:"auditReason"` // 审核不通过原因
AuditTime int64 `bson:"auditTime" json:"auditTime"` // 审核时间
AuditBy string `bson:"auditBy" json:"auditBy"` // 审核人
// 统计信息
Impressions int64 `bson:"impressions" json:"impressions"` // 展示次数
Clicks int64 `bson:"clicks" json:"clicks"` // 点击次数
Conversions int64 `bson:"conversions" json:"conversions"` // 转化次数
Cost int64 `bson:"cost" json:"cost"` // 消耗(分)
CTR float64 `bson:"ctr" json:"ctr"` // 点击率
CVR float64 `bson:"cvr" json:"cvr"` // 转化率
CPM int64 `bson:"cpm" json:"cpm"` // 千次展示成本
CPC int64 `bson:"cpc" json:"cpc"` // 单次点击成本
}
// Targeting 广告定向条件
type Targeting struct {
// 地域定向
Regions []string `bson:"regions" json:"regions"` // 地域列表
// 兴趣定向
Interests []string `bson:"interests" json:"interests"` // 兴趣标签
// 年龄定向
AgeRange *AgeRange `bson:"ageRange" json:"ageRange"` // 年龄范围
// 性别定向
Gender []string `bson:"gender" json:"gender"` // 性别:男、女、全部
// 设备定向
Devices []string `bson:"devices" json:"devices"` // 设备类型
// 操作系统定向
OperatingSystems []string `bson:"operatingSystems" json:"operatingSystems"` // 操作系统
// 时间定向
TimeSlots []TimeSlot `bson:"timeSlots" json:"timeSlots"` // 时间段
// 行为定向
Behaviors []string `bson:"behaviors" json:"behaviors"` // 行为标签
}
// AgeRange 年龄范围
type AgeRange struct {
Min int `bson:"min" json:"min"` // 最小年龄
Max int `bson:"max" json:"max"` // 最大年龄
}
// TimeSlot 时间段
type TimeSlot struct {
DayOfWeek int `bson:"dayOfWeek" json:"dayOfWeek"` // 星期几0-60表示星期日
StartTime string `bson:"startTime" json:"startTime"` // 开始时间格式HH:mm
EndTime string `bson:"endTime" json:"endTime"` // 结束时间格式HH:mm
}