gomod引用
This commit is contained in:
@@ -1,113 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cid/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// GetAdStatisticsReq 获取广告统计数据请求
|
||||
type GetAdStatisticsReq struct {
|
||||
g.Meta `path:"/getStatistics" method:"get" tags:"广告统计" summary:"获取广告统计数据" dc:"获取广告的统计数据"`
|
||||
|
||||
// 分页参数
|
||||
http.Page
|
||||
|
||||
// 维度信息
|
||||
StatType string `json:"statType" v:"required"` // 统计类型:广告主、广告、广告位等
|
||||
StatDimension string `json:"statDimension" v:"required"` // 统计维度:小时、天、周、月
|
||||
TargetId string `json:"targetId"` // 目标ID:广告主ID、广告ID、广告位ID等
|
||||
|
||||
// 时间范围
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始日期
|
||||
EndDate int64 `json:"endDate" v:"required"` // 结束日期
|
||||
|
||||
// 筛选条件
|
||||
DeviceType string `json:"deviceType"` // 设备类型
|
||||
Platform string `json:"platform"` // 平台
|
||||
Region string `json:"region"` // 地区
|
||||
Gender string `json:"gender"` // 性别
|
||||
AgeGroup string `json:"ageGroup"` // 年龄段
|
||||
|
||||
// 排序
|
||||
SortBy string `json:"sortBy"` // 排序字段
|
||||
SortDirection string `json:"sortDirection"` // 排序方向:asc、desc
|
||||
}
|
||||
|
||||
type GetAdStatisticsRes struct {
|
||||
Statistics []*entity.AdStatistics `json:"statistics"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// GetDashboardReq 获取仪表盘数据请求
|
||||
type GetDashboardReq struct {
|
||||
g.Meta `path:"/getDashboard" method:"get" tags:"广告仪表盘" summary:"获取仪表盘数据" dc:"获取广告系统的仪表盘统计数据"`
|
||||
|
||||
// 时间范围
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始日期
|
||||
EndDate int64 `json:"endDate" v:"required"` // 结束日期
|
||||
|
||||
// 维度
|
||||
Dimension string `json:"dimension"` // 统计维度:天、周、月
|
||||
}
|
||||
|
||||
type GetDashboardRes struct {
|
||||
// 总览数据
|
||||
Overview OverviewData `json:"overview"`
|
||||
|
||||
// 趋势数据
|
||||
Trends []TrendData `json:"trends"`
|
||||
|
||||
// 排行数据
|
||||
TopAdvertisers []RankData `json:"topAdvertisers"` // 广告主排行
|
||||
TopAds []RankData `json:"topAds"` // 广告排行
|
||||
TopPositions []RankData `json:"topPositions"` // 广告位排行
|
||||
}
|
||||
|
||||
// OverviewData 总览数据
|
||||
type OverviewData struct {
|
||||
TotalAdvertisers int64 `json:"totalAdvertisers"` // 广告主总数
|
||||
TotalAds int64 `json:"totalAds"` // 广告总数
|
||||
TotalPositions int64 `json:"totalPositions"` // 广告位总数
|
||||
TotalImpressions int64 `json:"totalImpressions"` // 总展示次数
|
||||
TotalClicks int64 `json:"totalClicks"` // 总点击次数
|
||||
TotalCost int64 `json:"totalCost"` // 总消耗(分)
|
||||
TotalRevenue int64 `json:"totalRevenue"` // 总收入(分)
|
||||
AverageCTR float64 `json:"averageCTR"` // 平均点击率
|
||||
AverageCVR float64 `json:"averageCVR"` // 平均转化率
|
||||
}
|
||||
|
||||
// TrendData 趋势数据
|
||||
type TrendData struct {
|
||||
Date int64 `json:"date"` // 日期
|
||||
Impressions int64 `json:"impressions"` // 展示次数
|
||||
Clicks int64 `json:"clicks"` // 点击次数
|
||||
Conversions int64 `json:"conversions"` // 转化次数
|
||||
Cost int64 `json:"cost"` // 消耗(分)
|
||||
Revenue int64 `json:"revenue"` // 收入(分)
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
}
|
||||
|
||||
// RankData 排行数据
|
||||
type RankData struct {
|
||||
Id string `json:"id"` // ID
|
||||
Name string `json:"name"` // 名称
|
||||
Impressions int64 `json:"impressions"` // 展示次数
|
||||
Clicks int64 `json:"clicks"` // 点击次数
|
||||
Cost int64 `json:"cost"` // 消耗(分)
|
||||
Revenue int64 `json:"revenue"` // 收入(分)
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
}
|
||||
|
||||
// GenerateDailyStatisticsReq 生成每日统计数据请求
|
||||
type GenerateDailyStatisticsReq struct {
|
||||
g.Meta `path:"/generateDailyStatistics" method:"post" tags:"广告统计" summary:"生成每日统计数据" dc:"手动生成指定日期的广告统计数据"`
|
||||
|
||||
Date int64 `json:"date" v:"required"` // 日期时间戳
|
||||
}
|
||||
|
||||
type GenerateDailyStatisticsRes struct {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
@@ -30,7 +30,7 @@ type AddAdvertisementReq struct {
|
||||
BillingType string `json:"billingType" v:"required"` // 计费类型:CPC、CPM、CPA等
|
||||
|
||||
// 投放条件
|
||||
Targeting *entity.Targeting `json:"targeting"` // 定向条件
|
||||
Targeting *entity.UnifiedTargeting `json:"targeting"` // 定向条件
|
||||
}
|
||||
|
||||
type AddAdvertisementRes struct {
|
||||
@@ -62,7 +62,7 @@ type UpdateAdvertisementReq struct {
|
||||
BillingType string `json:"billingType"` // 计费类型:CPC、CPM、CPA等
|
||||
|
||||
// 投放条件
|
||||
Targeting *entity.Targeting `json:"targeting"` // 定向条件
|
||||
Targeting *entity.UnifiedTargeting `json:"targeting"` // 定向条件
|
||||
|
||||
// 状态信息
|
||||
Status *string `json:"status"` // 广告状态:待审核、审核中、已通过、已拒绝、投放中、已暂停、已结束
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
package dto
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// 报表生成请求
|
||||
type ReportGenerateReq struct {
|
||||
g.Meta `path:"/generateReport" method:"post"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type" v:"required|in:daily,weekly,monthly,quarterly,yearly"`
|
||||
Date string `json:"date"` // 格式: 2024-01-01 (daily), 2024-01 (monthly), 2024-Q1 (quarterly), 2024 (yearly)
|
||||
}
|
||||
|
||||
// 报表生成响应
|
||||
type ReportGenerateResp struct {
|
||||
ReportID string `json:"report_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
// 报表列表请求
|
||||
type ReportListReq struct {
|
||||
g.Meta `path:"/getReportList" method:"get"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
StartDate string `json:"start_date"`
|
||||
EndDate string `json:"end_date"`
|
||||
Page int `json:"page" d:"1"`
|
||||
PageSize int `json:"page_size" d:"20"`
|
||||
}
|
||||
|
||||
// 报表列表响应
|
||||
type ReportListResp struct {
|
||||
Reports []*ReportDTO `json:"reports"`
|
||||
Total int `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// 报表详情请求
|
||||
type ReportDetailReq struct {
|
||||
g.Meta `path:"/getReportDetail" method:"get"`
|
||||
ReportID int64 `json:"report_id" v:"required"`
|
||||
}
|
||||
type ExportReportReq struct {
|
||||
g.Meta `path:"/exportReport" method:"get"`
|
||||
ReportID int64 `json:"report_id" v:"required"`
|
||||
}
|
||||
|
||||
// 报表详情响应
|
||||
type ReportDetailResp struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID interface{} `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
GeneratedAt string `json:"generated_at"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
// 报表DTO
|
||||
type ReportDTO struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID interface{} `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
GeneratedAt string `json:"generated_at"`
|
||||
}
|
||||
|
||||
// 统计查询请求
|
||||
type StatQueryReq struct {
|
||||
g.Meta `path:"/queryStats" method:"get"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
AdType string `json:"ad_type"`
|
||||
Platform string `json:"platform"`
|
||||
Region string `json:"region"`
|
||||
StartDate string `json:"start_date" v:"required"`
|
||||
EndDate string `json:"end_date" v:"required"`
|
||||
Granularity string `json:"granularity" v:"in:daily,weekly,monthly" d:"daily"` // 统计粒度
|
||||
}
|
||||
|
||||
// 统计查询响应
|
||||
type StatQueryResp struct {
|
||||
Data []*StatDataPoint `json:"data"`
|
||||
Summary *StatSummary `json:"summary"`
|
||||
}
|
||||
|
||||
// 统计数据点
|
||||
type StatDataPoint struct {
|
||||
Date string `json:"date"`
|
||||
Impressions int64 `json:"impressions"`
|
||||
Clicks int64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
CTR float64 `json:"ctr"`
|
||||
AvgDuration float64 `json:"avg_duration"`
|
||||
}
|
||||
|
||||
// 统计摘要
|
||||
type StatSummary struct {
|
||||
TotalImpressions int64 `json:"total_impressions"`
|
||||
TotalClicks int64 `json:"total_clicks"`
|
||||
TotalRevenue float64 `json:"total_revenue"`
|
||||
AvgCTR float64 `json:"avg_ctr"`
|
||||
AvgDuration float64 `json:"avg_duration"`
|
||||
GrowthRate *GrowthRate `json:"growth_rate"`
|
||||
}
|
||||
|
||||
// 增长率统计
|
||||
type GrowthRate struct {
|
||||
Impressions float64 `json:"impressions"`
|
||||
Clicks float64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
CTR float64 `json:"ctr"`
|
||||
}
|
||||
|
||||
// 实时统计请求
|
||||
type RealTimeStatReq struct {
|
||||
g.Meta `path:"/realTimeStats" method:"get"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
Hours int `json:"hours" d:"24"` // 过去多少小时的统计
|
||||
}
|
||||
|
||||
// 实时统计响应
|
||||
type RealTimeStatResp struct {
|
||||
CurrentHour *HourlyStat `json:"current_hour"`
|
||||
Last24Hours []*HourlyStat `json:"last_24_hours"`
|
||||
}
|
||||
|
||||
// 小时统计
|
||||
type HourlyStat struct {
|
||||
Hour string `json:"hour"`
|
||||
Impressions int64 `json:"impressions"`
|
||||
Clicks int64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
}
|
||||
|
||||
// Controller响应结构
|
||||
|
||||
// 生成报表响应
|
||||
type ReportGenerateRes struct {
|
||||
Data *ReportGenerateResp `json:"data"`
|
||||
}
|
||||
|
||||
// 报表列表响应
|
||||
type ReportListRes struct {
|
||||
Data *ReportListResp `json:"data"`
|
||||
}
|
||||
|
||||
// 报表详情响应
|
||||
type ReportDetailRes struct {
|
||||
Data *ReportDetailResp `json:"data"`
|
||||
}
|
||||
|
||||
// 统计查询响应
|
||||
type StatQueryRes struct {
|
||||
Data *StatQueryResp `json:"data"`
|
||||
}
|
||||
|
||||
// 实时统计响应
|
||||
type RealTimeStatRes struct {
|
||||
Data *RealTimeStatResp `json:"data"`
|
||||
}
|
||||
|
||||
// 导出报表响应
|
||||
type ExportReportRes struct {
|
||||
ReportData *ReportDetailResp `json:"report_data"`
|
||||
}
|
||||
67
model/entity/ad_creative.go
Normal file
67
model/entity/ad_creative.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const AdCreativeCollection = "ad_creative"
|
||||
|
||||
// AdCreative 广告创意素材实体
|
||||
type AdCreative struct {
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
AdvertiserId string `bson:"advertiserId" json:"advertiserId"` // 广告主ID
|
||||
|
||||
// 基本信息
|
||||
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类型
|
||||
FileHash string `bson:"fileHash" json:"fileHash"` // 文件哈希值
|
||||
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"` // 最后同步时间
|
||||
|
||||
// 基础配置
|
||||
BaseConfig `bson:",inline" json:",inline"` // 内联基础配置
|
||||
|
||||
// 限制配置
|
||||
RestrictionConfig `bson:",inline" json:",inline"` // 内联限制配置
|
||||
|
||||
// 其他信息
|
||||
Status string `bson:"status" json:"status"` // 状态:active、inactive、archived
|
||||
ExpireTime int64 `bson:"expireTime" json:"expireTime"` // 过期时间
|
||||
}
|
||||
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *AdCreative) GetCollectionName() string {
|
||||
return AdCreativeCollection
|
||||
}
|
||||
55
model/entity/ad_platform.go
Normal file
55
model/entity/ad_platform.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const AdPlatformCollection = "ad_platform"
|
||||
|
||||
// AdPlatform 广告平台实体
|
||||
type AdPlatform struct {
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
||||
|
||||
// 平台基本信息
|
||||
Name string `bson:"name" json:"name"` // 平台名称:小红书、抖音、快手、京东、淘宝、百度等
|
||||
Code string `bson:"code" json:"code"` // 平台编码,唯一标识
|
||||
DisplayName string `bson:"displayName" json:"displayName"` // 显示名称
|
||||
Logo string `bson:"logo" json:"logo"` // 平台Logo
|
||||
Description string `bson:"description" json:"description"` // 平台描述
|
||||
Category string `bson:"category" json:"category"` // 平台分类:social、ecommerce、search、short_video等
|
||||
|
||||
// 支持的广告类型
|
||||
SupportedAdTypes []string `bson:"supportedAdTypes" json:"supportedAdTypes"` // 支持的广告类型
|
||||
SupportedFormats []string `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
||||
|
||||
// 技术能力
|
||||
RealTimeBidding bool `bson:"realTimeBidding" json:"realTimeBidding"` // 是否支持实时竞价
|
||||
ProgrammaticGuaranteed bool `bson:"programmaticGuaranteed" json:"programmaticGuaranteed"` // 是否支持程序化保障
|
||||
HeaderBidding bool `bson:"headerBidding" json:"headerBidding"` // 是否支持Header Bidding
|
||||
|
||||
// API配置
|
||||
APIConfig `bson:",inline" json:",inline"` // 内联API配置
|
||||
|
||||
// 竞价配置
|
||||
BiddingConfig `bson:",inline" json:",inline"` // 内联竞价配置
|
||||
|
||||
// 支付配置
|
||||
PaymentConfig `bson:",inline" json:",inline"` // 内联支付配置
|
||||
|
||||
// 限流配置
|
||||
RateLimit int64 `bson:"rateLimit" json:"rateLimit"` // 速率限制
|
||||
MaxBudgetPerDay int64 `bson:"maxBudgetPerDay" json:"maxBudgetPerDay"` // 每日最大预算
|
||||
|
||||
LastSyncTime int64 `bson:"lastSyncTime" json:"lastSyncTime"` // 最后同步时间
|
||||
|
||||
// 联系信息
|
||||
SupportContact string `bson:"supportContact" json:"supportContact"` // 技术支持联系方式
|
||||
AccountManager string `bson:"accountManager" json:"accountManager"` // 客户经理
|
||||
TechDocumentation string `bson:"techDocumentation" json:"techDocumentation"` // 技术文档链接
|
||||
}
|
||||
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *AdPlatform) GetCollectionName() string {
|
||||
return AdPlatformCollection
|
||||
}
|
||||
@@ -8,7 +8,8 @@ const AdPositionCollection = "ad_position"
|
||||
|
||||
// AdPosition 广告位实体
|
||||
type AdPosition struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
||||
|
||||
// 基本信息
|
||||
Name string `bson:"name" json:"name"` // 广告位名称
|
||||
@@ -17,8 +18,8 @@ type AdPosition struct {
|
||||
AdFormat string `bson:"adFormat" json:"adFormat"` // 支持的广告格式
|
||||
|
||||
// 尺寸信息
|
||||
Width int `bson:"width" json:"width"` // 宽度(px)
|
||||
Height int `bson:"height" json:"height"` // 高度(px)
|
||||
Width int64 `bson:"width" json:"width"` // 宽度(px)
|
||||
Height int64 `bson:"height" json:"height"` // 高度(px)
|
||||
|
||||
// 位置信息
|
||||
Page string `bson:"page" json:"page"` // 所属页面
|
||||
@@ -39,16 +40,11 @@ type AdPosition struct {
|
||||
// 展示规则
|
||||
DisplayRules *DisplayRules `bson:"displayRules" json:"displayRules"` // 展示规则
|
||||
|
||||
// 状态信息
|
||||
Status string `bson:"status" json:"status"` // 广告位状态:启用、禁用、测试
|
||||
IsExclusive bool `bson:"isExclusive" json:"isExclusive"` // 是否独占广告位
|
||||
// 限制配置
|
||||
RestrictionConfig `bson:",inline" json:",inline"` // 内联限制配置
|
||||
|
||||
// 统计信息
|
||||
DailyImpressions int64 `bson:"dailyImpressions" json:"dailyImpressions"` // 日均展示量
|
||||
DailyClicks int64 `bson:"dailyClicks" json:"dailyClicks"` // 日均点击量
|
||||
DailyRevenue int64 `bson:"dailyRevenue" json:"dailyRevenue"` // 日均收入(分)
|
||||
CTR float64 `bson:"ctr" json:"ctr"` // 点击率
|
||||
eCPM int64 `bson:"ecpm" json:"ecpm"` // 有效千次展示收入
|
||||
// 其他状态
|
||||
IsExclusive bool `bson:"isExclusive" json:"isExclusive"` // 是否独占广告位
|
||||
}
|
||||
|
||||
// DisplayRules 广告位展示规则
|
||||
@@ -80,3 +76,8 @@ type ExcludeCondition struct {
|
||||
Type string `bson:"type" json:"type"` // 条件类型
|
||||
Value interface{} `bson:"value" json:"value"` // 条件值
|
||||
}
|
||||
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *AdPosition) GetCollectionName() string {
|
||||
return AdPositionCollection
|
||||
}
|
||||
|
||||
@@ -8,156 +8,65 @@ const AdSourceCollection = "ad_source"
|
||||
|
||||
// AdSource 广告源实体
|
||||
type AdSource struct {
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name"` // 广告源名称
|
||||
Code string `json:"code"` // 广告源编码,唯一标识
|
||||
Provider string `json:"provider"` // 提供商:google、facebook、baidu、tencent、self等
|
||||
Type string `json:"type"` // 类型:self(自营)、third_party(第三方)、exchange(广告交易平台)
|
||||
Description string `json:"description"` // 描述
|
||||
Name string `bson:"name" json:"name"` // 广告源名称
|
||||
Code string `bson:"code" json:"code"` // 广告源编码,唯一标识
|
||||
Provider string `bson:"provider" json:"provider"` // 提供商:self(自营)、chuanshanjia(穿山甲)、gdt(腾讯广点通)、baidu(百度)、byteance(字节跳动)等
|
||||
Type string `bson:"type" json:"type"` // 类型:self(自营)、third_party(第三方)、exchange(广告交易平台)、platform_ad_source(平台广告源)
|
||||
Category string `bson:"category" json:"category"` // 分类:network、ssp、dsp、rtb等
|
||||
|
||||
// 连接配置
|
||||
Config string `json:"config"` // 广告源配置(JSON字符串)
|
||||
Config string `bson:"config" json:"config"` // 广告源配置(JSON字符串)
|
||||
|
||||
// API配置
|
||||
APIEndpoint string `json:"apiEndpoint"` // API端点
|
||||
APIVersion string `json:"apiVersion"` // API版本
|
||||
AuthType string `json:"authType"` // 认证类型:api_key、oauth、basic
|
||||
AuthConfig string `json:"authConfig"` // 认证配置(JSON字符串)
|
||||
Headers string `json:"headers"` // 请求头配置(JSON字符串)
|
||||
Timeout int `json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `json:"retryCount"` // 重试次数
|
||||
APIConfig `bson:",inline" json:",inline"` // 内联API配置
|
||||
|
||||
// 创意配置
|
||||
CreativeConfig `bson:",inline" json:",inline"` // 内联创意配置
|
||||
|
||||
// 广告源能力
|
||||
Capabilities string `json:"capabilities"` // 广告源能力(JSON字符串)
|
||||
Capabilities *AdSourceCapabilities `bson:"capabilities" json:"capabilities"` // 广告源能力
|
||||
|
||||
// 质量指标
|
||||
QualityMetrics string `json:"qualityMetrics"` // 质量指标(JSON字符串)
|
||||
|
||||
// 财务设置
|
||||
PaymentTerms string `json:"paymentTerms"` // 支付条款(JSON字符串)
|
||||
|
||||
// 状态信息
|
||||
Status string `json:"status"` // 广告源状态:active、inactive、maintenance
|
||||
Health string `json:"health"` // 健康状态:healthy、degraded、unhealthy
|
||||
LastCheckAt int64 `json:"lastCheckAt"` // 最后检查时间
|
||||
|
||||
// 统计信息
|
||||
TotalRequests int64 `json:"totalRequests"` // 总请求数
|
||||
SuccessfulRequests int64 `json:"successfulRequests"` // 成功请求数
|
||||
FailedRequests int64 `json:"failedRequests"` // 失败请求数
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
|
||||
// 系统信息
|
||||
Priority int `json:"priority"` // 优先级,数值越高优先级越高
|
||||
}
|
||||
|
||||
// AdSourceConfig 广告源配置
|
||||
type AdSourceConfig struct {
|
||||
// 基础配置
|
||||
SupportedFormats []string `json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedSizes []string `json:"supportedSizes"` // 支持的尺寸
|
||||
SupportedDevices []string `json:"supportedDevices"` // 支持的设备类型
|
||||
SupportedOS []string `json:"supportedOS"` // 支持的操作系统
|
||||
SupportedCountries []string `json:"supportedCountries"` // 支持的国家/地区
|
||||
|
||||
// 竞价配置
|
||||
BiddingType string `json:"biddingType"` // 竞价类型:cpm、cpc、cpa、rtb
|
||||
MinBidAmount int64 `json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `json:"maxBidAmount"` // 最大出价(分)
|
||||
BidIncrement int64 `json:"bidIncrement"` // 出价增量(分)
|
||||
DefaultBidAmount int64 `json:"defaultBidAmount"` // 默认出价(分)
|
||||
AutoOptimization bool `json:"autoOptimization"` // 是否自动优化
|
||||
|
||||
// 定向配置
|
||||
TargetingSupport *TargetingSupport `json:"targetingSupport"` // 定向支持
|
||||
|
||||
// 其他配置
|
||||
MaxAdsPerRequest int `json:"maxAdsPerRequest"` // 单次请求最大广告数量
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见性支持
|
||||
}
|
||||
|
||||
// TargetingSupport 定向支持
|
||||
type TargetingSupport struct {
|
||||
GeoTargeting bool `json:"geoTargeting"` // 地理定向
|
||||
DemographicTargeting bool `json:"demographicTargeting"` // 人口统计定向
|
||||
BehavioralTargeting bool `json:"behavioralTargeting"` // 行为定向
|
||||
ContextualTargeting bool `json:"contextualTargeting"` // 上下文定向
|
||||
DeviceTargeting bool `json:"deviceTargeting"` // 设备定向
|
||||
TimeTargeting bool `json:"timeTargeting"` // 时间定向
|
||||
Retargeting bool `json:"retargeting"` // 重定向
|
||||
CookieTargeting bool `json:"cookieTargeting"` // Cookie定向
|
||||
// 支付配置
|
||||
PaymentConfig `bson:",inline" json:",inline"` // 内联支付配置
|
||||
}
|
||||
|
||||
// AdSourceCapabilities 广告源能力
|
||||
type AdSourceCapabilities struct {
|
||||
// 广告格式
|
||||
SupportedFormats []AdFormat `json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedFormats []AdFormat `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
||||
|
||||
// 功能特性
|
||||
RealTimeBidding bool `json:"realTimeBidding"` // 实时竞价
|
||||
HeaderBidding bool `json:"headerBidding"` // 标题竞价
|
||||
ProgrammaticDirect bool `json:"programmaticDirect"` // 程序化直购
|
||||
PrivateMarketplace bool `json:"privateMarketplace"` // 私有交易市场
|
||||
RealTimeBidding bool `bson:"realTimeBidding" json:"realTimeBidding"` // 实时竞价
|
||||
HeaderBidding bool `bson:"headerBidding" json:"headerBidding"` // 标题竞价
|
||||
ProgrammaticDirect bool `bson:"programmaticDirect" json:"programmaticDirect"` // 程序化直购
|
||||
PrivateMarketplace bool `bson:"privateMarketplace" json:"privateMarketplace"` // 私有交易市场
|
||||
|
||||
// 质量控制
|
||||
FraudDetection bool `json:"fraudDetection"` // 反欺诈检测
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见度验证
|
||||
CreativeApproval bool `json:"creativeApproval"` // 创意审核
|
||||
FraudDetection bool `bson:"fraudDetection" json:"fraudDetection"` // 反欺诈检测
|
||||
BrandSafety bool `bson:"brandSafety" json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `bson:"viewability" json:"viewability"` // 可见度验证
|
||||
CreativeApproval bool `bson:"creativeApproval" json:"creativeApproval"` // 创意审核
|
||||
|
||||
// 数据能力
|
||||
AudienceTargeting bool `json:"audienceTargeting"` // 受众定向
|
||||
ContextualTargeting bool `json:"contextualTargeting"` // 上下文定向
|
||||
CrossDeviceTargeting bool `json:"crossDeviceTargeting"` // 跨设备定向
|
||||
AudienceTargeting bool `bson:"audienceTargeting" json:"audienceTargeting"` // 受众定向
|
||||
ContextualTargeting bool `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
||||
CrossDeviceTargeting bool `bson:"crossDeviceTargeting" json:"crossDeviceTargeting"` // 跨设备定向
|
||||
}
|
||||
|
||||
// AdFormat 广告格式
|
||||
type AdFormat struct {
|
||||
Type string `json:"type"` // 格式类型:banner、video、native、interstitial等
|
||||
Name string `json:"name"` // 格式名称
|
||||
Width int `json:"width"` // 宽度
|
||||
Height int `json:"height"` // 高度
|
||||
MimeType string `json:"mimeType"` // MIME类型
|
||||
Type string `bson:"type" json:"type"` // 格式类型:banner、video、native、interstitial等
|
||||
Name string `bson:"name" json:"name"` // 格式名称
|
||||
Width int `bson:"width" json:"width"` // 宽度
|
||||
Height int `bson:"height" json:"height"` // 高度
|
||||
MimeType string `bson:"mimeType" json:"mimeType"` // MIME类型
|
||||
}
|
||||
|
||||
// AdSourceQualityMetrics 广告源质量指标
|
||||
type AdSourceQualityMetrics struct {
|
||||
// 性能指标
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
SuccessRate float64 `json:"successRate"` // 成功率
|
||||
ErrorRate float64 `json:"errorRate"` // 错误率
|
||||
Uptime float64 `json:"uptime"` // 可用性(百分比)
|
||||
|
||||
// 广告质量
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
ViewabilityRate float64 `json:"viewabilityRate"` // 可见率
|
||||
BrandSafetyScore float64 `json:"brandSafetyScore"` // 品牌安全评分
|
||||
|
||||
// 财务指标
|
||||
Ecpm int64 `json:"ecpm"` // 有效千次展示成本(分)
|
||||
Ecpc int64 `json:"ecpc"` // 有效点击成本(分)
|
||||
RevenuePerRequest int64 `json:"revenuePerRequest"` // 每请求收入(分)
|
||||
|
||||
// 时间指标
|
||||
LastUpdated int64 `json:"lastUpdated"` // 最后更新时间
|
||||
MetricsUpdateWindow int `json:"metricsUpdateWindow"` // 指标更新窗口(分钟)
|
||||
}
|
||||
|
||||
// PaymentTerms 支付条款
|
||||
type PaymentTerms struct {
|
||||
BillingModel string `json:"billingModel"` // 计费模式:cpm、cpc、cpa、rev_share
|
||||
PaymentTerms string `json:"paymentTerms"` // 支付条款:net_30、net_60、net_90
|
||||
RevShareRate float64 `json:"revShareRate"` // 收入分成比例(0-1)
|
||||
MinPayment int64 `json:"minPayment"` // 最小支付金额(分)
|
||||
Currency string `json:"currency"` // 货币单位
|
||||
TaxInclusive bool `json:"taxInclusive"` // 是否含税
|
||||
EarlyPaymentDiscount float64 `json:"earlyPaymentDiscount"` // 提前付款折扣
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *AdSource) GetCollectionName() string {
|
||||
return AdSourceCollection
|
||||
}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const AdStatisticsCollection = "ad_statistics"
|
||||
|
||||
// AdStatistics 广告统计实体
|
||||
type AdStatistics struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
|
||||
// 维度信息
|
||||
StatType string `bson:"statType" json:"statType"` // 统计类型:广告主、广告、广告位等
|
||||
StatDimension string `bson:"statDimension" json:"statDimension"` // 统计维度:小时、天、周、月
|
||||
TargetId string `bson:"targetId" json:"targetId"` // 目标ID:广告主ID、广告ID、广告位ID等
|
||||
TargetName string `bson:"targetName" json:"targetName"` // 目标名称:广告主名称、广告名称、广告位名称等
|
||||
StatDate int64 `bson:"statDate" json:"statDate"` // 统计日期(Unix时间戳)
|
||||
|
||||
// 基础数据
|
||||
Impressions int64 `bson:"impressions" json:"impressions"` // 展示次数
|
||||
Clicks int64 `bson:"clicks" json:"clicks"` // 点击次数
|
||||
Conversions int64 `bson:"conversions" json:"conversions"` // 转化次数
|
||||
UniqueUsers int64 `bson:"uniqueUsers" json:"uniqueUsers"` // 唯一用户数
|
||||
NewUsers int64 `bson:"newUsers" json:"newUsers"` // 新用户数
|
||||
ReturnUsers int64 `bson:"returnUsers" json:"returnUsers"` // 回访用户数
|
||||
ViewTime int64 `bson:"viewTime" json:"viewTime"` // 查看时间(秒)
|
||||
|
||||
// 财务数据
|
||||
Cost int64 `bson:"cost" json:"cost"` // 消耗(分)
|
||||
Revenue int64 `bson:"revenue" json:"revenue"` // 收入(分)
|
||||
Budget int64 `bson:"budget" json:"budget"` // 预算(分)
|
||||
RemainingBudget int64 `bson:"remainingBudget" json:"remainingBudget"` // 剩余预算(分)
|
||||
|
||||
// 比率数据
|
||||
CTR float64 `bson:"ctr" json:"ctr"` // 点击率
|
||||
CVR float64 `bson:"cvr" json:"cvr"` // 转化率
|
||||
BounceRate float64 `bson:"bounceRate" json:"bounceRate"` // 跳出率
|
||||
EngagementRate float64 `bson:"engagementRate" json:"engagementRate"` // 互动率
|
||||
|
||||
// 成本数据
|
||||
CPM int64 `bson:"cpm" json:"cpm"` // 千次展示成本
|
||||
CPC int64 `bson:"cpc" json:"cpc"` // 单次点击成本
|
||||
CPA int64 `bson:"cpa" json:"cpa"` // 单次转化成本
|
||||
eCPM int64 `bson:"ecpm" json:"ecpm"` // 有效千次展示收入
|
||||
eCPC int64 `bson:"ecpc" json:"ecpc"` // 有效单次点击收入
|
||||
eCPA int64 `bson:"ecpa" json:"ecpa"` // 有效单次转化收入
|
||||
|
||||
// 其他信息
|
||||
DeviceType string `bson:"deviceType" json:"deviceType"` // 设备类型
|
||||
Platform string `bson:"platform" json:"platform"` // 平台
|
||||
Region string `bson:"region" json:"region"` // 地区
|
||||
Gender string `bson:"gender" json:"gender"` // 性别
|
||||
AgeGroup string `bson:"ageGroup" json:"ageGroup"` // 年龄段
|
||||
Extra map[string]interface{} `bson:"extra" json:"extra"` // 扩展字段
|
||||
}
|
||||
|
||||
const AdReportCollection = "ad_report"
|
||||
|
||||
// AdReport 广告报表实体
|
||||
type AdReport struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
|
||||
// 报表信息
|
||||
ReportName string `bson:"reportName" json:"reportName"` // 报表名称
|
||||
ReportType string `bson:"reportType" json:"reportType"` // 报表类型:日报、周报、月报、自定义
|
||||
ReportPeriod string `bson:"reportPeriod" json:"reportPeriod"` // 报表周期
|
||||
StartDate int64 `bson:"startDate" json:"startDate"` // 开始日期
|
||||
EndDate int64 `bson:"endDate" json:"endDate"` // 结束日期
|
||||
ReportData []ReportItem `bson:"reportData" json:"reportData"` // 报表数据
|
||||
|
||||
// 状态信息
|
||||
Status string `bson:"status" json:"status"` // 报表状态:生成中、已完成、失败
|
||||
GenerateTime int64 `bson:"generateTime" json:"generateTime"` // 生成时间
|
||||
DownloadUrl string `bson:"downloadUrl" json:"downloadUrl"` // 下载链接
|
||||
ExpiredTime int64 `bson:"expiredTime" json:"expiredTime"` // 过期时间
|
||||
FileSize int64 `bson:"fileSize" json:"fileSize"` // 文件大小(字节)
|
||||
FileFormat string `bson:"fileFormat" json:"fileFormat"` // 文件格式:CSV、Excel、PDF
|
||||
|
||||
// 其他信息
|
||||
Operator string `bson:"operator" json:"operator"` // 操作人
|
||||
EmailRecipients []string `bson:"emailRecipients" json:"emailRecipients"` // 邮件接收人列表
|
||||
Schedule string `bson:"schedule" json:"schedule"` // 定时设置
|
||||
LastSentTime int64 `bson:"lastSentTime" json:"lastSentTime"` // 上次发送时间
|
||||
NextSendTime int64 `bson:"nextSendTime" json:"nextSendTime"` // 下次发送时间
|
||||
}
|
||||
|
||||
// ReportItem 报表项
|
||||
type ReportItem struct {
|
||||
Dimension string `bson:"dimension" json:"dimension"` // 维度名称
|
||||
Data map[string]interface{} `bson:"data" json:"data"` // 数据
|
||||
}
|
||||
@@ -8,78 +8,46 @@ const AdvertisementCollection = "advertisement"
|
||||
|
||||
// Advertisement 广告实体
|
||||
type Advertisement struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
AdvertiserId string `bson:"advertiserId" json:"advertiserId"` // 广告主ID
|
||||
|
||||
// 广告基本信息
|
||||
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
|
||||
TargetUrl string `bson:"targetUrl" json:"targetUrl"` // 目标链接(点击跳转或落地页)
|
||||
|
||||
// 投放设置
|
||||
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等
|
||||
// 平台和广告源信息
|
||||
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等
|
||||
|
||||
// 投放条件
|
||||
Targeting *Targeting `bson:"targeting" json:"targeting"` // 定向条件
|
||||
// 投放配置
|
||||
BudgetConfig `bson:",inline" json:",inline"` // 内联预算配置
|
||||
BidAmount int64 `bson:"bidAmount" json:"bidAmount"` // 出价(分)
|
||||
BillingType string `bson:"billingType" json:"billingType"` // 计费类型:CPC、CPM、CPA等
|
||||
|
||||
// 状态信息
|
||||
Status string `bson:"status" json:"status"` // 广告状态:待审核、审核中、已通过、已拒绝、投放中、已暂停、已结束
|
||||
// 定向条件
|
||||
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"` // 审核人
|
||||
|
||||
// 基础统计信息(比率字段通过计算得到,不持久化存储)
|
||||
Impressions int64 `bson:"impressions" json:"impressions"` // 展示次数
|
||||
Clicks int64 `bson:"clicks" json:"clicks"` // 点击次数
|
||||
Conversions int64 `bson:"conversions" json:"conversions"` // 转化次数
|
||||
Cost int64 `bson:"cost" json:"cost"` // 消耗(分)
|
||||
// 限制配置
|
||||
RestrictionConfig `bson:",inline" json:",inline"` // 内联限制配置
|
||||
|
||||
// 其他状态信息
|
||||
Status string `bson:"status" json:"status"` // 业务状态:active、inactive、archived
|
||||
}
|
||||
|
||||
// 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-6,0表示星期日
|
||||
StartTime string `bson:"startTime" json:"startTime"` // 开始时间,格式:HH:mm
|
||||
EndTime string `bson:"endTime" json:"endTime"` // 结束时间,格式:HH:mm
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *Advertisement) GetCollectionName() string {
|
||||
return AdvertisementCollection
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ const AdvertiserCollection = "advertiser"
|
||||
|
||||
// Advertiser 广告主实体
|
||||
type Advertiser struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
||||
|
||||
// 基本信息
|
||||
Name string `bson:"name" json:"name"` // 广告主名称
|
||||
@@ -16,7 +17,6 @@ type Advertiser struct {
|
||||
ContactPhone string `bson:"contactPhone" json:"contactPhone"` // 联系电话
|
||||
ContactEmail string `bson:"contactEmail" json:"contactEmail"` // 联系邮箱
|
||||
Company string `bson:"company" json:"company"` // 公司名称
|
||||
Industry string `bson:"industry" json:"industry"` // 所属行业
|
||||
Scale string `bson:"scale" json:"scale"` // 公司规模
|
||||
|
||||
// 证件信息
|
||||
@@ -36,14 +36,18 @@ type Advertiser struct {
|
||||
SignDate int64 `bson:"signDate" json:"signDate"` // 签约日期
|
||||
ExpireDate int64 `bson:"expireDate" json:"expireDate"` // 到期日期
|
||||
|
||||
// 状态信息
|
||||
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"` // 审核人
|
||||
|
||||
// 系统信息
|
||||
AccountBalance int64 `bson:"accountBalance" json:"accountBalance"` // 账户余额(分)
|
||||
CreditLimit int64 `bson:"creditLimit" json:"creditLimit"` // 授信额度(分)
|
||||
Remark string `bson:"remark" json:"remark"` // 备注
|
||||
AccountBalance int64 `bson:"accountBalance" json:"accountBalance"` // 账户余额(分)
|
||||
CreditLimit int64 `bson:"creditLimit" json:"creditLimit"` // 授信额度(分)
|
||||
}
|
||||
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *Advertiser) GetCollectionName() string {
|
||||
return AdvertiserCollection
|
||||
}
|
||||
|
||||
32
model/entity/app_platform_config.go
Normal file
32
model/entity/app_platform_config.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const AppPlatformConfigCollection = "app_platform_config"
|
||||
|
||||
// AppPlatformConfig 应用平台配置实体
|
||||
type AppPlatformConfig struct {
|
||||
do.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
|
||||
|
||||
// 配置信息
|
||||
Config string `bson:"config" json:"config"` // 配置信息(JSON字符串)
|
||||
MaxAdsPerReq int `bson:"maxAdsPerReq" json:"maxAdsPerReq"` // 每次请求最大广告数
|
||||
|
||||
// 定向配置
|
||||
TargetingRules string `bson:"targetingRules" json:"targetingRules"` // 定向规则(JSON字符串)
|
||||
|
||||
// 过滤配置
|
||||
FilterRules string `bson:"filterRules" json:"filterRules"` // 过滤规则(JSON字符串)
|
||||
}
|
||||
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *AppPlatformConfig) GetCollectionName() string {
|
||||
return AppPlatformConfigCollection
|
||||
}
|
||||
@@ -8,40 +8,47 @@ const ApplicationCollection = "application"
|
||||
|
||||
// Application 应用实体
|
||||
type Application struct {
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
||||
|
||||
// 应用信息
|
||||
Name string `json:"name"` // 应用名称
|
||||
Code string `json:"code"` // 应用编码
|
||||
Description string `json:"description"` // 应用描述
|
||||
Icon string `json:"icon"` // 应用图标
|
||||
// 应用基本信息
|
||||
Name string `bson:"name" json:"name"` // 应用名称
|
||||
Code string `bson:"code" json:"code"` // 应用编码
|
||||
Description string `bson:"description" json:"description"` // 应用描述
|
||||
AppKey string `bson:"appKey" json:"appKey"` // 应用密钥
|
||||
AppSecret string `bson:"appSecret" json:"appSecret"` // 应用秘钥
|
||||
Platform string `bson:"platform" json:"platform"` // 平台:web、ios、android、h5
|
||||
Version string `bson:"version" json:"version"` // 版本号
|
||||
PackageName string `bson:"packageName" json:"packageName"` // 包名(移动应用)
|
||||
BundleID string `bson:"bundleId" json:"bundleId"` // Bundle ID(iOS应用)
|
||||
AppStoreURL string `bson:"appStoreUrl" json:"appStoreUrl"` // 应用商店URL
|
||||
|
||||
// 平台信息
|
||||
Platform string `json:"platform"` // 平台:web, h5, android, ios
|
||||
PackageName string `json:"packageName"` // 包名(Android)/Bundle ID(iOS)
|
||||
AppStoreURL string `json:"appStoreUrl"` // 应用商店链接
|
||||
// 应用配置
|
||||
Config string `bson:"config" json:"config"` // 应用配置(JSON字符串)
|
||||
Permissions string `bson:"permissions" json:"permissions"` // 权限配置(JSON字符串)
|
||||
|
||||
// 配置信息
|
||||
Categories []string `json:"categories"` // 应用分类
|
||||
Tags []string `json:"tags"` // 应用标签
|
||||
Config string `json:"config"` // 应用配置(JSON格式)
|
||||
AdTypes []string `json:"adTypes"` // 支持的广告类型
|
||||
// 应用分类和标签
|
||||
Categories []string `bson:"categories" json:"categories"` // 应用分类
|
||||
Tags []string `bson:"tags" json:"tags"` // 标签
|
||||
AdTypes []string `bson:"adTypes" json:"adTypes"` // 支持的广告类型
|
||||
|
||||
// 状态信息
|
||||
Status string `json:"status"` // 状态:active, inactive, audit
|
||||
AuditStatus string `json:"auditStatus"` // 审核状态
|
||||
AuditReason string `json:"auditReason"` // 审核原因
|
||||
// 回调配置
|
||||
CallbackURL string `bson:"callbackUrl" json:"callbackUrl"` // 回调URL
|
||||
|
||||
// 统计信息
|
||||
DailyRequests int64 `json:"dailyRequests"` // 日请求量
|
||||
MonthlyRequests int64 `json:"monthlyRequests"` // 月请求量
|
||||
// 应用特定统计
|
||||
DailyActiveUsers int64 `bson:"dailyActiveUsers" json:"dailyActiveUsers"` // 日活用户数
|
||||
MonthlyActiveUsers int64 `bson:"monthlyActiveUsers" json:"monthlyActiveUsers"` // 月活用户数
|
||||
TotalRequests int64 `bson:"totalRequests" json:"totalRequests"` // 总请求数
|
||||
DailyRequests int64 `bson:"dailyRequests" json:"dailyRequests"` // 日请求数
|
||||
MonthlyRequests int64 `bson:"monthlyRequests" json:"monthlyRequests"` // 月请求数
|
||||
|
||||
// API密钥
|
||||
AppKey string `json:"appKey"` // 应用密钥
|
||||
AppSecret string `json:"appSecret"` // 应用密钥
|
||||
|
||||
// 回调信息
|
||||
CallbackURL string `json:"callbackUrl"` // 回调URL
|
||||
|
||||
Remark string `json:"remark"` // 备注
|
||||
// 联系信息
|
||||
ContactName string `bson:"contactName" json:"contactName"` // 联系人姓名
|
||||
ContactEmail string `bson:"contactEmail" json:"contactEmail"` // 联系邮箱
|
||||
ContactPhone string `bson:"contactPhone" json:"contactPhone"` // 联系电话
|
||||
}
|
||||
|
||||
// GetCollectionName 获取集合名称
|
||||
func (a *Application) GetCollectionName() string {
|
||||
return ApplicationCollection
|
||||
}
|
||||
|
||||
@@ -6,18 +6,21 @@ import (
|
||||
|
||||
const CidRequestCollection = "cid_request"
|
||||
|
||||
// CidRequest CID请求实体
|
||||
// CidRequest CID请求实体(合并后的统一版本)
|
||||
type CidRequest struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, IsDeleted
|
||||
UserID string `bson:"userId" json:"userId"`
|
||||
// 请求信息
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, IsDeleted
|
||||
|
||||
// 请求基础信息
|
||||
RequestID string `bson:"requestId" json:"requestId"` // 请求唯一ID
|
||||
SessionID string `bson:"sessionId" json:"sessionId"` // 会话ID
|
||||
UserID string `bson:"userId" json:"userId"` // 用户ID
|
||||
|
||||
// 网络信息
|
||||
IPAddress string `bson:"ipAddress" json:"ipAddress"` // IP地址
|
||||
UserAgent string `bson:"userAgent" json:"userAgent"` // 用户代理
|
||||
Referer string `bson:"referer" json:"referer"` // 来源页面
|
||||
|
||||
// 广告位信息
|
||||
// 广告位信息(使用内联结构)
|
||||
PositionCode string `bson:"positionCode" json:"positionCode"` // 广告位编码
|
||||
PositionSize string `bson:"positionSize" json:"positionSize"` // 广告位尺寸
|
||||
PositionFormat string `bson:"positionFormat" json:"positionFormat"` // 广告位格式
|
||||
@@ -30,15 +33,17 @@ type CidRequest struct {
|
||||
PageKeywords []string `bson:"pageKeywords" json:"pageKeywords"` // 页面关键词
|
||||
PageTags map[string]string `bson:"pageTags" json:"pageTags"` // 页面标签
|
||||
|
||||
// 用户信息
|
||||
UserContext *UserContext `bson:"userContext" json:"userContext"` // 用户上下文
|
||||
DeviceInfo *DeviceInfo `bson:"deviceInfo" json:"deviceInfo"` // 设备信息
|
||||
LocationInfo *LocationInfo `bson:"locationInfo" json:"locationInfo"` // 位置信息
|
||||
TemporalInfo *TemporalInfo `bson:"temporalInfo" json:"temporalInfo"` // 时间信息
|
||||
// 用户上下文信息(使用统一版本)
|
||||
UserContext *UnifiedUserContext `bson:"userContext" json:"userContext"` // 用户上下文
|
||||
DeviceInfo *DeviceInfo `bson:"deviceInfo" json:"deviceInfo"` // 设备信息
|
||||
LocationInfo *UnifiedLocationInfo `bson:"locationInfo" json:"locationInfo"` // 位置信息
|
||||
TemporalInfo *UnifiedTemporalInfo `bson:"temporalInfo" json:"temporalInfo"` // 时间信息
|
||||
|
||||
// 请求参数
|
||||
RequestParams *RequestParams `bson:"requestParams" json:"requestParams"` // 请求参数
|
||||
TargetingRules *TargetingRules `bson:"targetingRules" json:"targetingRules"` // 定向规则
|
||||
// 请求参数(使用合并版本)
|
||||
RequestParams *RequestParams `bson:"requestParams" json:"requestParams"` // 请求参数
|
||||
|
||||
// 定向规则(使用统一的定向结构)
|
||||
TargetingRules *UnifiedTargeting `bson:"targetingRules" json:"targetingRules"` // 定向规则
|
||||
|
||||
// 策略配置
|
||||
StrategyConfig *StrategyConfig `bson:"strategyConfig" json:"strategyConfig"` // 策略配置
|
||||
@@ -70,14 +75,111 @@ type CidRequest struct {
|
||||
Version string `bson:"version" json:"version"` // 系统版本
|
||||
}
|
||||
|
||||
// CidResponse CID响应
|
||||
// GetCollectionName 获取集合名称
|
||||
func (c *CidRequest) GetCollectionName() string {
|
||||
return CidRequestCollection
|
||||
}
|
||||
|
||||
// UnifiedUserContext 统一的用户上下文
|
||||
type UnifiedUserContext struct {
|
||||
UserID string `bson:"userId" json:"userId"` // 用户ID
|
||||
SessionID string `bson:"sessionId" json:"sessionId"` // 会话ID
|
||||
CookieID string `bson:"cookieId" json:"cookieId"` // Cookie ID
|
||||
IP string `bson:"ip" json:"ip"` // IP地址
|
||||
UserAgent string `bson:"userAgent" json:"userAgent"` // 用户代理
|
||||
Language string `bson:"language" json:"language"` // 语言
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
CustomData map[string]interface{} `bson:"customData" json:"customData"` // 自定义数据
|
||||
}
|
||||
|
||||
// UnifiedLocationInfo 统一的位置信息
|
||||
type UnifiedLocationInfo struct {
|
||||
Country string `bson:"country" json:"country"` // 国家
|
||||
Region string `bson:"region" json:"region"` // 地区/省份
|
||||
City string `bson:"city" json:"city"` // 城市
|
||||
PostalCode string `bson:"postalCode" json:"postalCode"` // 邮政编码
|
||||
Latitude float64 `bson:"latitude" json:"latitude"` // 纬度
|
||||
Longitude float64 `bson:"longitude" json:"longitude"` // 经度
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
Metro string `bson:"metro" json:"metro"` // 都市区
|
||||
Area string `bson:"area" json:"area"` // 区域
|
||||
Network string `bson:"network" json:"network"` // 网络运营商
|
||||
ConnectionType string `bson:"connectionType" json:"connectionType"` // 连接类型
|
||||
ISP string `bson:"isp" json:"isp"` // 互联网服务提供商
|
||||
}
|
||||
|
||||
// UnifiedTemporalInfo 统一的时间信息
|
||||
type UnifiedTemporalInfo struct {
|
||||
Timestamp int64 `bson:"timestamp" json:"timestamp"` // 时间戳(秒)
|
||||
Milliseconds int64 `bson:"milliseconds" json:"milliseconds"` // 毫秒数
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
DayOfWeek int `bson:"dayOfWeek" json:"dayOfWeek"` // 星期几(0-6)
|
||||
HourOfDay int `bson:"hourOfDay" json:"hourOfDay"` // 小时(0-23)
|
||||
DayOfMonth int `bson:"dayOfMonth" json:"dayOfMonth"` // 月份中的天数
|
||||
Month int `bson:"month" json:"month"` // 月份(1-12)
|
||||
Year int `bson:"year" json:"year"` // 年份
|
||||
IsWeekend bool `bson:"isWeekend" json:"isWeekend"` // 是否周末
|
||||
IsBusinessHours bool `bson:"isBusinessHours" json:"isBusinessHours"` // 是否营业时间
|
||||
Season string `bson:"season" json:"season"` // 季节
|
||||
Holiday string `bson:"holiday" json:"holiday"` // 节假日
|
||||
}
|
||||
|
||||
// DeviceInfo 设备信息
|
||||
type DeviceInfo struct {
|
||||
Type string `bson:"type" json:"type"` // 设备类型:desktop、mobile、tablet
|
||||
Brand string `bson:"brand" json:"brand"` // 设备品牌
|
||||
Model string `bson:"model" json:"model"` // 设备型号
|
||||
OS string `bson:"os" json:"os"` // 操作系统
|
||||
OSVersion string `bson:"osVersion" json:"osVersion"` // 操作系统版本
|
||||
Browser string `bson:"browser" json:"browser"` // 浏览器
|
||||
BrowserVersion string `bson:"browserVersion" json:"browserVersion"` // 浏览器版本
|
||||
ScreenWidth int `bson:"screenWidth" json:"screenWidth"` // 屏幕宽度
|
||||
ScreenHeight int `bson:"screenHeight" json:"screenHeight"` // 屏幕高度
|
||||
ViewportWidth int `bson:"viewportWidth" json:"viewportWidth"` // 视口宽度
|
||||
ViewportHeight int `bson:"viewportHeight" json:"viewportHeight"` // 视口高度
|
||||
DPI int `bson:"dpi" json:"dpi"` // 设备DPI
|
||||
IsJavaScript bool `bson:"isJavaScript" json:"isJavaScript"` // 是否支持JavaScript
|
||||
IsCookie bool `bson:"isCookie" json:"isCookie"` // 是否支持Cookie
|
||||
IsFlash bool `bson:"isFlash" json:"isFlash"` // 是否支持Flash
|
||||
IsHTTPS bool `bson:"isHTTPS" json:"isHTTPS"` // 是否HTTPS连接
|
||||
}
|
||||
|
||||
// RequestParams 请求参数(合并版本)
|
||||
type RequestParams struct {
|
||||
AdCount int `bson:"adCount" json:"adCount"` // 请求的广告数量
|
||||
AdTypes []string `bson:"adTypes" json:"adTypes"` // 广告类型
|
||||
AdSizes []string `bson:"adSizes" json:"adSizes"` // 广告尺寸
|
||||
ExcludedAdSources []string `bson:"excludedAdSources" json:"excludedAdSources"` // 排除的广告源
|
||||
RequiredAdSources []string `bson:"requiredAdSources" json:"requiredAdSources"` // 必需的广告源
|
||||
MinBidAmount int64 `bson:"minBidAmount" json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `bson:"maxBidAmount" json:"maxBidAmount"` // 最大出价(分)
|
||||
AllowDuplicates bool `bson:"allowDuplicates" json:"allowDuplicates"` // 是否允许重复广告
|
||||
FloorPrice int64 `bson:"floorPrice" json:"floorPrice"` // 底价(分)
|
||||
CeilingPrice int64 `bson:"ceilingPrice" json:"ceilingPrice"` // 封顶价(分)
|
||||
CustomParams map[string]interface{} `bson:"customParams" json:"customParams"` // 自定义参数
|
||||
}
|
||||
|
||||
// StrategyConfig 策略配置(合并版本)
|
||||
type StrategyConfig struct {
|
||||
StrategyType string `bson:"strategyType" json:"strategyType"` // 策略类型
|
||||
Priority int `bson:"priority" json:"priority"` // 优先级
|
||||
Weight float64 `bson:"weight" json:"weight"` // 权重
|
||||
MinAds int `bson:"minAds" json:"minAds"` // 最小广告数
|
||||
MaxAds int `bson:"maxAds" json:"maxAds"` // 最大广告数
|
||||
AllowDuplicates bool `bson:"allowDuplicates" json:"allowDuplicates"` // 是否允许重复
|
||||
Timeout int64 `bson:"timeout" json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `bson:"retryCount" json:"retryCount"` // 重试次数
|
||||
CustomSettings map[string]interface{} `bson:"customSettings" json:"customSettings"` // 自定义设置
|
||||
}
|
||||
|
||||
// CidResponse CID响应(合并版本)
|
||||
type CidResponse struct {
|
||||
Ads []Ad `bson:"ads" json:"ads"` // 广告列表
|
||||
TrackingInfo *TrackingInfo `bson:"trackingInfo" json:"trackingInfo"` // 跟踪信息
|
||||
Metadata *ResponseMetadata `bson:"metadata" json:"metadata"` // 响应元数据
|
||||
}
|
||||
|
||||
// Ad 广告
|
||||
// Ad 广告结构(合并版本)
|
||||
type Ad struct {
|
||||
ID string `bson:"id" json:"id"` // 广告ID
|
||||
AdSource string `bson:"adSource" json:"adSource"` // 广告源
|
||||
@@ -105,7 +207,7 @@ type Ad struct {
|
||||
Score float64 `bson:"score" json:"score"` // 评分
|
||||
}
|
||||
|
||||
// TrackingInfo 跟踪信息
|
||||
// TrackingInfo 跟踪信息(合并版本)
|
||||
type TrackingInfo struct {
|
||||
ImpressionURLs []string `bson:"impressionUrls" json:"impressionUrls"` // 展示跟踪URL
|
||||
ClickURLs []string `bson:"clickUrls" json:"clickUrls"` // 点击跟踪URL
|
||||
@@ -115,7 +217,7 @@ type TrackingInfo struct {
|
||||
BeaconURLs []string `bson:"beaconUrls" json:"beaconUrls"` // 信标URL
|
||||
}
|
||||
|
||||
// ResponseMetadata 响应元数据
|
||||
// ResponseMetadata 响应元数据(合并版本)
|
||||
type ResponseMetadata struct {
|
||||
TotalAvailableAds int `bson:"totalAvailableAds" json:"totalAvailableAds"` // 总可用广告数
|
||||
SelectedAds int `bson:"selectedAds" json:"selectedAds"` // 选择的广告数
|
||||
@@ -132,7 +234,7 @@ type ResponseMetadata struct {
|
||||
AdSourcesUsed []string `bson:"adSourcesUsed" json:"adSourcesUsed"` // 使用的广告源
|
||||
}
|
||||
|
||||
// AdSourceResponse 广告源响应
|
||||
// AdSourceResponse 广告源响应(合并版本)
|
||||
type AdSourceResponse struct {
|
||||
AdSource string `bson:"adSource" json:"adSource"` // 广告源名称
|
||||
Status string `bson:"status" json:"status"` // 响应状态:success、timeout、error
|
||||
@@ -147,164 +249,3 @@ type AdSourceResponse struct {
|
||||
TotalRevenue int64 `bson:"totalRevenue" json:"totalRevenue"` // 总收入(分)
|
||||
AverageBidAmount int64 `bson:"averageBidAmount" json:"averageBidAmount"` // 平均出价(分)
|
||||
}
|
||||
|
||||
// UserContext 用户上下文
|
||||
type UserContext struct {
|
||||
UserID string `bson:"userId" json:"userId"` // 用户ID
|
||||
SessionID string `bson:"sessionId" json:"sessionId"` // 会话ID
|
||||
CookieID string `bson:"cookieId" json:"cookieId"` // Cookie ID
|
||||
IP string `bson:"ip" json:"ip"` // IP地址
|
||||
UserAgent string `bson:"userAgent" json:"userAgent"` // 用户代理
|
||||
Language string `bson:"language" json:"language"` // 语言
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
CustomData map[string]interface{} `bson:"customData" json:"customData"` // 自定义数据
|
||||
}
|
||||
|
||||
// DeviceInfo 设备信息
|
||||
type DeviceInfo struct {
|
||||
Type string `bson:"type" json:"type"` // 设备类型:desktop、mobile、tablet
|
||||
Brand string `bson:"brand" json:"brand"` // 设备品牌
|
||||
Model string `bson:"model" json:"model"` // 设备型号
|
||||
OS string `bson:"os" json:"os"` // 操作系统
|
||||
OSVersion string `bson:"osVersion" json:"osVersion"` // 操作系统版本
|
||||
Browser string `bson:"browser" json:"browser"` // 浏览器
|
||||
BrowserVersion string `bson:"browserVersion" json:"browserVersion"` // 浏览器版本
|
||||
ScreenWidth int `bson:"screenWidth" json:"screenWidth"` // 屏幕宽度
|
||||
ScreenHeight int `bson:"screenHeight" json:"screenHeight"` // 屏幕高度
|
||||
ViewportWidth int `bson:"viewportWidth" json:"viewportWidth"` // 视口宽度
|
||||
ViewportHeight int `bson:"viewportHeight" json:"viewportHeight"` // 视口高度
|
||||
DPI int `bson:"dpi" json:"dpi"` // 设备DPI
|
||||
IsJavaScript bool `bson:"isJavaScript" json:"isJavaScript"` // 是否支持JavaScript
|
||||
IsCookie bool `bson:"isCookie" json:"isCookie"` // 是否支持Cookie
|
||||
IsFlash bool `bson:"isFlash" json:"isFlash"` // 是否支持Flash
|
||||
IsHTTPS bool `bson:"isHTTPS" json:"isHTTPS"` // 是否HTTPS连接
|
||||
}
|
||||
|
||||
// LocationInfo 位置信息
|
||||
type LocationInfo struct {
|
||||
Country string `bson:"country" json:"country"` // 国家
|
||||
Region string `bson:"region" json:"region"` // 地区/省份
|
||||
City string `bson:"city" json:"city"` // 城市
|
||||
PostalCode string `bson:"postalCode" json:"postalCode"` // 邮政编码
|
||||
Latitude float64 `bson:"latitude" json:"latitude"` // 纬度
|
||||
Longitude float64 `bson:"longitude" json:"longitude"` // 经度
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
Metro string `bson:"metro" json:"metro"` // 都市区
|
||||
Area string `bson:"area" json:"area"` // 区域
|
||||
Network string `bson:"network" json:"network"` // 网络运营商
|
||||
ConnectionType string `bson:"connectionType" json:"connectionType"` // 连接类型
|
||||
ISP string `bson:"isp" json:"isp"` // 互联网服务提供商
|
||||
}
|
||||
|
||||
// TemporalInfo 时间信息
|
||||
type TemporalInfo struct {
|
||||
Timestamp int64 `bson:"timestamp" json:"timestamp"` // 时间戳(秒)
|
||||
Milliseconds int64 `bson:"milliseconds" json:"milliseconds"` // 毫秒数
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
DayOfWeek int `bson:"dayOfWeek" json:"dayOfWeek"` // 星期几(0-6)
|
||||
HourOfDay int `bson:"hourOfDay" json:"hourOfDay"` // 小时(0-23)
|
||||
DayOfMonth int `bson:"dayOfMonth" json:"dayOfMonth"` // 月份中的天数
|
||||
Month int `bson:"month" json:"month"` // 月份(1-12)
|
||||
Year int `bson:"year" json:"year"` // 年份
|
||||
IsWeekend bool `bson:"isWeekend" json:"isWeekend"` // 是否周末
|
||||
IsBusinessHours bool `bson:"isBusinessHours" json:"isBusinessHours"` // 是否营业时间
|
||||
Season string `bson:"season" json:"season"` // 季节
|
||||
Holiday string `bson:"holiday" json:"holiday"` // 节假日
|
||||
}
|
||||
|
||||
// RequestParams 请求参数
|
||||
type RequestParams struct {
|
||||
AdCount int `bson:"adCount" json:"adCount"` // 请求的广告数量
|
||||
AdTypes []string `bson:"adTypes" json:"adTypes"` // 广告类型
|
||||
AdSizes []string `bson:"adSizes" json:"adSizes"` // 广告尺寸
|
||||
ExcludedAdSources []string `bson:"excludedAdSources" json:"excludedAdSources"` // 排除的广告源
|
||||
RequiredAdSources []string `bson:"requiredAdSources" json:"requiredAdSources"` // 必需的广告源
|
||||
MinBidAmount int64 `bson:"minBidAmount" json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `bson:"maxBidAmount" json:"maxBidAmount"` // 最大出价(分)
|
||||
AllowDuplicates bool `bson:"allowDuplicates" json:"allowDuplicates"` // 是否允许重复广告
|
||||
FloorPrice int64 `bson:"floorPrice" json:"floorPrice"` // 底价(分)
|
||||
CeilingPrice int64 `bson:"ceilingPrice" json:"ceilingPrice"` // 封顶价(分)
|
||||
CustomParams map[string]interface{} `bson:"customParams" json:"customParams"` // 自定义参数
|
||||
}
|
||||
|
||||
// TargetingRules 定向规则
|
||||
type TargetingRules struct {
|
||||
GeoTargeting *GeoTargeting `bson:"geoTargeting" json:"geoTargeting"` // 地理定向
|
||||
DemographicTargeting *DemographicTargeting `bson:"demographicTargeting" json:"demographicTargeting"` // 人口统计定向
|
||||
BehavioralTargeting *BehavioralTargeting `bson:"behavioralTargeting" json:"behavioralTargeting"` // 行为定向
|
||||
ContextualTargeting *ContextualTargeting `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
||||
DeviceTargeting *DeviceTargeting `bson:"deviceTargeting" json:"deviceTargeting"` // 设备定向
|
||||
TimeTargeting *TimeTargeting `bson:"timeTargeting" json:"timeTargeting"` // 时间定向
|
||||
CustomTargeting map[string]interface{} `bson:"customTargeting" json:"customTargeting"` // 自定义定向
|
||||
}
|
||||
|
||||
// GeoTargeting 地理定向
|
||||
type GeoTargeting struct {
|
||||
Countries []string `bson:"countries" json:"countries"` // 国家列表
|
||||
Regions []string `bson:"regions" json:"regions"` // 地区列表
|
||||
Cities []string `bson:"cities" json:"cities"` // 城市列表
|
||||
PostalCodes []string `bson:"postalCodes" json:"postalCodes"` // 邮政编码列表
|
||||
GeoTargets []string `bson:"geoTargets" json:"geoTargets"` // 地理目标
|
||||
}
|
||||
|
||||
// DemographicTargeting 人口统计定向
|
||||
type DemographicTargeting struct {
|
||||
AgeRange *AgeRange `bson:"ageRange" json:"ageRange"` // 年龄范围
|
||||
Gender []string `bson:"gender" json:"gender"` // 性别
|
||||
Income []string `bson:"income" json:"income"` // 收入水平
|
||||
Education []string `bson:"education" json:"education"` // 教育程度
|
||||
Occupation []string `bson:"occupation" json:"occupation"` // 职业类型
|
||||
Interests []string `bson:"interests" json:"interests"` // 兴趣标签
|
||||
Lifestyle []string `bson:"lifestyle" json:"lifestyle"` // 生活方式
|
||||
}
|
||||
|
||||
// BehavioralTargeting 行为定向
|
||||
type BehavioralTargeting struct {
|
||||
SearchHistory []string `bson:"searchHistory" json:"searchHistory"` // 搜索历史
|
||||
BrowseHistory []string `bson:"browseHistory" json:"browseHistory"` // 浏览历史
|
||||
PurchaseHistory []string `bson:"purchaseHistory" json:"purchaseHistory"` // 购买历史
|
||||
AdInteractions []string `bson:"adInteractions" json:"adInteractions"` // 广告互动
|
||||
Behaviors []string `bson:"behaviors" json:"behaviors"` // 行为标签
|
||||
Segments []string `bson:"segments" json:"segments"` // 用户分群
|
||||
}
|
||||
|
||||
// ContextualTargeting 上下文定向
|
||||
type ContextualTargeting struct {
|
||||
Categories []string `bson:"categories" json:"categories"` // 内容分类
|
||||
Keywords []string `bson:"keywords" json:"keywords"` // 关键词
|
||||
Tags []string `bson:"tags" json:"tags"` // 标签
|
||||
Sentiment string `bson:"sentiment" json:"sentiment"` // 情感倾向
|
||||
ContentType string `bson:"contentType" json:"contentType"` // 内容类型
|
||||
ContentRating string `bson:"contentRating" json:"contentRating"` // 内容评级
|
||||
}
|
||||
|
||||
// DeviceTargeting 设备定向
|
||||
type DeviceTargeting struct {
|
||||
DeviceTypes []string `bson:"deviceTypes" json:"deviceTypes"` // 设备类型
|
||||
OS []string `bson:"os" json:"os"` // 操作系统
|
||||
Browsers []string `bson:"browsers" json:"browsers"` // 浏览器
|
||||
Carriers []string `bson:"carriers" json:"carriers"` // 运营商
|
||||
ConnectionTypes []string `bson:"connectionTypes" json:"connectionTypes"` // 连接类型
|
||||
}
|
||||
|
||||
// TimeTargeting 时间定向
|
||||
type TimeTargeting struct {
|
||||
TimeSlots []TimeSlot `bson:"timeSlots" json:"timeSlots"` // 时间段
|
||||
DaysOfWeek []int `bson:"daysOfWeek" json:"daysOfWeek"` // 星期几
|
||||
Dates []string `bson:"dates" json:"dates"` // 日期范围
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
ExcludeHolidays bool `bson:"excludeHolidays" json:"excludeHolidays"` // 排除节假日
|
||||
}
|
||||
|
||||
// StrategyConfig 策略配置
|
||||
type StrategyConfig struct {
|
||||
StrategyType string `bson:"strategyType" json:"strategyType"` // 策略类型
|
||||
Priority int `bson:"priority" json:"priority"` // 优先级
|
||||
Weight float64 `bson:"weight" json:"weight"` // 权重
|
||||
MinAds int `bson:"minAds" json:"minAds"` // 最小广告数
|
||||
MaxAds int `bson:"maxAds" json:"maxAds"` // 最大广告数
|
||||
AllowDuplicates bool `bson:"allowDuplicates" json:"allowDuplicates"` // 是否允许重复
|
||||
Timeout int64 `bson:"timeout" json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `bson:"retryCount" json:"retryCount"` // 重试次数
|
||||
CustomSettings map[string]interface{} `bson:"customSettings" json:"customSettings"` // 自定义设置
|
||||
}
|
||||
|
||||
157
model/entity/config.go
Normal file
157
model/entity/config.go
Normal file
@@ -0,0 +1,157 @@
|
||||
package entity
|
||||
|
||||
// BaseConfig 基础配置结构
|
||||
type BaseConfig struct {
|
||||
// 优先级和权重
|
||||
Priority int `bson:"priority" json:"priority"` // 优先级
|
||||
Weight float64 `bson:"weight" json:"weight"` // 权重
|
||||
Order int `bson:"order" json:"order"` // 排序顺序
|
||||
|
||||
// 标签和分类
|
||||
Tags []string `bson:"tags" json:"tags"` // 标签
|
||||
Category string `bson:"category" json:"category"` // 分类
|
||||
Industry string `bson:"industry" json:"industry"` // 行业
|
||||
|
||||
// 配置信息
|
||||
Config string `bson:"config" json:"config"` // 配置信息(JSON格式)
|
||||
Extra map[string]interface{} `bson:"extra" json:"extra"` // 扩展字段
|
||||
Remark string `bson:"remark" json:"remark"` // 备注
|
||||
}
|
||||
|
||||
// BiddingConfig 竞价配置
|
||||
type BiddingConfig struct {
|
||||
// 竞价类型
|
||||
BiddingType string `bson:"biddingType" json:"biddingType"` // 竞价类型:cpm、cpc、cpa、rtb
|
||||
BiddingStrategy string `bson:"biddingStrategy" json:"biddingStrategy"` // 出价策略:manual、auto、target_cpa、target_roas等
|
||||
|
||||
// 出价范围
|
||||
MinBidAmount int64 `bson:"minBidAmount" json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `bson:"maxBidAmount" json:"maxBidAmount"` // 最大出价(分)
|
||||
DefaultBidAmount int64 `bson:"defaultBidAmount" json:"defaultBidAmount"` // 默认出价(分)
|
||||
BidIncrement int64 `bson:"bidIncrement" json:"bidIncrement"` // 出价增量(分)
|
||||
|
||||
// 自动优化
|
||||
AutoOptimization bool `bson:"autoOptimization" json:"autoOptimization"` // 是否自动优化
|
||||
TargetCPA int64 `bson:"targetCPA" json:"targetCPA"` // 目标CPA(分)
|
||||
TargetROAS float64 `bson:"targetROAS" json:"targetROAS"` // 目标ROAS
|
||||
ConversionValue int64 `bson:"conversionValue" json:"conversionValue"` // 转化价值
|
||||
AttributionWindow string `bson:"attributionWindow" json:"attributionWindow"` // 归因窗口
|
||||
OptimizationGoal string `bson:"optimizationGoal" json:"optimizationGoal"` // 优化目标:impressions、clicks、conversions、revenue等
|
||||
}
|
||||
|
||||
// BudgetConfig 预算配置
|
||||
type BudgetConfig struct {
|
||||
// 预算设置
|
||||
TotalBudget int64 `bson:"totalBudget" json:"totalBudget"` // 总预算(分)
|
||||
DailyBudget int64 `bson:"dailyBudget" json:"dailyBudget"` // 日预算(分)
|
||||
HourlyBudget int64 `bson:"hourlyBudget" json:"hourlyBudget"` // 小时预算(分)
|
||||
|
||||
// 投放节奏
|
||||
PaceType string `bson:"paceType" json:"paceType"` // 投放节奏:even、accelerated、standard
|
||||
IsBudgetPacing bool `bson:"isBudgetPacing" json:"isBudgetPacing"` // 是否预算匀速投放
|
||||
|
||||
// 时间配置
|
||||
StartDate int64 `bson:"startDate" json:"startDate"` // 开始投放时间
|
||||
EndDate int64 `bson:"endDate" json:"endDate"` // 结束投放时间
|
||||
TimeSlots []string `bson:"timeSlots" json:"timeSlots"` // 投放时间段
|
||||
DaysOfWeek []int `bson:"daysOfWeek" json:"daysOfWeek"` // 投放日期(0-6,0表示周日)
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
IsTimeLimited bool `bson:"isTimeLimited" json:"isTimeLimited"` // 是否限时投放
|
||||
}
|
||||
|
||||
// APIConfig API配置
|
||||
type APIConfig struct {
|
||||
// 基础配置
|
||||
Endpoint string `bson:"endpoint" json:"endpoint"` // API端点
|
||||
Version string `bson:"version" json:"version"` // API版本
|
||||
Timeout int `bson:"timeout" json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `bson:"retryCount" json:"retryCount"` // 重试次数
|
||||
|
||||
// 认证配置
|
||||
AuthType string `bson:"authType" json:"authType"` // 认证类型:api_key、oauth、basic
|
||||
AuthConfig string `bson:"authConfig" json:"authConfig"` // 认证配置(JSON字符串)
|
||||
|
||||
// 请求配置
|
||||
Headers string `bson:"headers" json:"headers"` // 请求头配置(JSON字符串)
|
||||
|
||||
// 限流配置
|
||||
RateLimit int64 `bson:"rateLimit" json:"rateLimit"` // 速率限制
|
||||
MaxRequestsPerHour int64 `bson:"maxRequestsPerHour" json:"maxRequestsPerHour"` // 每小时最大请求数
|
||||
}
|
||||
|
||||
// CreativeConfig 创意配置
|
||||
type CreativeConfig struct {
|
||||
// 轮播设置
|
||||
CreativeRotation string `bson:"creativeRotation" json:"creativeRotation"` // 创意轮播方式:optimize、even、random
|
||||
SelectedCreatives []string `bson:"selectedCreatives" json:"selectedCreatives"` // 选中的创意列表
|
||||
ExcludedCreatives []string `bson:"excludedCreatives" json:"excludedCreatives"` // 排除的创意列表
|
||||
|
||||
// 技术要求
|
||||
MaxFileSize int64 `bson:"maxFileSize" json:"maxFileSize"` // 最大文件大小(bytes)
|
||||
MaxDuration int64 `bson:"maxDuration" json:"maxDuration"` // 最大时长(秒)
|
||||
SupportedMimeTypes []string `bson:"supportedMimeTypes" json:"supportedMimeTypes"` // 支持的MIME类型
|
||||
|
||||
// 支持的格式
|
||||
SupportedFormats []string `bson:"supportedFormats" json:"supportedFormats"` // 支持的格式
|
||||
SupportedSizes []string `bson:"supportedSizes" json:"supportedSizes"` // 支持的尺寸
|
||||
}
|
||||
|
||||
// PaymentConfig 支付配置
|
||||
type PaymentConfig struct {
|
||||
// 计费模式
|
||||
BillingModel string `bson:"billingModel" json:"billingModel"` // 计费模式:CPC、CPM、CPA等
|
||||
CommissionRate float64 `bson:"commissionRate" json:"commissionRate"` // 佣金比例
|
||||
MinimumBudget int64 `bson:"minimumBudget" json:"minimumBudget"` // 最低预算(分)
|
||||
|
||||
// 结算配置
|
||||
SettlementCycle string `bson:"settlementCycle" json:"settlementCycle"` // 结算周期:daily、weekly、monthly
|
||||
PaymentTerms string `bson:"paymentTerms" json:"paymentTerms"` // 支付条款
|
||||
Currency string `bson:"currency" json:"currency"` // 货币单位
|
||||
|
||||
// 收入分成
|
||||
RevShareRate float64 `bson:"revShareRate" json:"revShareRate"` // 收入分成比例(0-1)
|
||||
MinPayment int64 `bson:"minPayment" json:"minPayment"` // 最小支付金额(分)
|
||||
TaxInclusive bool `bson:"taxInclusive" json:"taxInclusive"` // 是否含税
|
||||
EarlyPaymentDiscount float64 `bson:"earlyPaymentDiscount" json:"earlyPaymentDiscount"` // 提前付款折扣
|
||||
}
|
||||
|
||||
// FrequencyCapConfig 频次控制配置
|
||||
type FrequencyCapConfig struct {
|
||||
// 频次限制
|
||||
Impressions int `bson:"impressions" json:"impressions"` // 展示次数
|
||||
TimeWindow int `bson:"timeWindow" json:"timeWindow"` // 时间窗口(小时)
|
||||
PerUser int `bson:"perUser" json:"perUser"` // 每用户频次
|
||||
PerHour int `bson:"perHour" json:"perHour"` // 每小时频次
|
||||
PerDay int `bson:"perDay" json:"perDay"` // 每日频次
|
||||
|
||||
// 频次控制规则
|
||||
CapType string `bson:"capType" json:"capType"` // 频次类型:lifetime、daily、hourly
|
||||
CapScope string `bson:"capScope" json:"capScope"` // 频次范围:user、device、ip
|
||||
ResetRule string `bson:"resetRule" json:"resetRule"` // 重置规则:daily、weekly、monthly
|
||||
}
|
||||
|
||||
// RestrictionConfig 限制配置
|
||||
type RestrictionConfig struct {
|
||||
// 年龄限制
|
||||
AgeRestriction bool `bson:"ageRestriction" json:"ageRestriction"` // 年龄限制
|
||||
MinAge int `bson:"minAge" json:"minAge"` // 最小年龄
|
||||
MaxAge int `bson:"maxAge" json:"maxAge"` // 最大年龄
|
||||
|
||||
// 地域限制
|
||||
GeoRestrictions []string `bson:"geoRestrictions" json:"geoRestrictions"` // 地域限制
|
||||
|
||||
// 设备限制
|
||||
DeviceRestrictions []string `bson:"deviceRestrictions" json:"deviceRestrictions"` // 设备限制
|
||||
|
||||
// 分类限制
|
||||
CategoryRestrictions []string `bson:"categoryRestrictions" json:"categoryRestrictions"` // 分类限制
|
||||
|
||||
// 内容限制
|
||||
ContentRestrictions []string `bson:"contentRestrictions" json:"contentRestrictions"` // 内容限制
|
||||
|
||||
// 品牌安全
|
||||
BrandSafety bool `bson:"brandSafety" json:"brandSafety"` // 品牌安全
|
||||
BlockedCategories []string `bson:"blockedCategories" json:"blockedCategories"` // 阻止的分类
|
||||
AllowedCategories []string `bson:"allowedCategories" json:"allowedCategories"` // 允许的分类
|
||||
ExcludedKeywords []string `bson:"excludedKeywords" json:"excludedKeywords"` // 排除的关键词
|
||||
}
|
||||
69
model/entity/platform_delivery_rule.go
Normal file
69
model/entity/platform_delivery_rule.go
Normal file
@@ -0,0 +1,69 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const PlatformDeliveryRuleCollection = "platform_delivery_rule"
|
||||
|
||||
// PlatformDeliveryRule 平台投放规则实体
|
||||
type PlatformDeliveryRule struct {
|
||||
do.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等
|
||||
|
||||
// 预算配置
|
||||
BudgetConfig `bson:",inline" json:",inline"` // 内联预算配置
|
||||
|
||||
// 出价配置
|
||||
BiddingConfig `bson:",inline" json:",inline"` // 内联竞价配置
|
||||
|
||||
// 定向配置
|
||||
TargetingConfig string `bson:"targetingConfig" json:"targetingConfig"` // 定向配置(JSON格式)
|
||||
IncludeAudience []string `bson:"includeAudience" json:"includeAudience"` // 包含受众
|
||||
ExcludeAudience []string `bson:"excludeAudience" json:"excludeAudience"` // 排除受众
|
||||
|
||||
// 频次控制配置
|
||||
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
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const StatReportCollection = "stat_report"
|
||||
|
||||
// StatReport 统计报表实体
|
||||
type StatReport struct {
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
|
||||
// 报表基本信息
|
||||
AppID string `json:"appId"` // 应用ID (空字符串表示所有应用)
|
||||
ReportType string `json:"reportType"` // 报表类型:daily, weekly, monthly, quarterly, yearly
|
||||
ReportDate time.Time `json:"reportDate"` // 报表日期
|
||||
GeneratedAt time.Time `json:"generatedAt"` // 生成时间
|
||||
ReportData string `json:"reportData"` // 报表数据(JSON格式)
|
||||
|
||||
// 状态信息
|
||||
Status string `json:"status"` // 状态:generated, processing, completed
|
||||
}
|
||||
@@ -8,7 +8,8 @@ const StrategyCollection = "strategy"
|
||||
|
||||
// Strategy 匹配策略表
|
||||
type Strategy struct {
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
do.MongoBaseDO `bson:",inline" json:",inline"`
|
||||
Status string `bson:"status" json:"status"` // 状态:active、inactive、maintenance等
|
||||
|
||||
// 策略基本信息
|
||||
Name string `bson:"name" json:"name"` // 策略名称
|
||||
@@ -18,6 +19,10 @@ type Strategy struct {
|
||||
SourceWeights string `bson:"sourceWeights" json:"sourceWeights"` // 广告源权重 (JSON格式)
|
||||
MaxAdsPerReq int `bson:"maxAdsPerReq" json:"maxAdsPerReq"` // 每次请求最大广告数
|
||||
MaxReqPerHour int `bson:"maxReqPerHour" json:"maxReqPerHour"` // 每小时最大请求次数
|
||||
Priority int `bson:"priority" json:"priority"` // 优先级
|
||||
Status string `bson:"status" json:"status"` // 状态: active, inactive
|
||||
Priority int `bson:"priority" json:"priority"` // 优先级(用于策略排序)
|
||||
}
|
||||
|
||||
// GetCollectionName 获取集合名称
|
||||
func (s *Strategy) GetCollectionName() string {
|
||||
return StrategyCollection
|
||||
}
|
||||
|
||||
68
model/entity/targeting.go
Normal file
68
model/entity/targeting.go
Normal file
@@ -0,0 +1,68 @@
|
||||
package entity
|
||||
|
||||
// UnifiedTargeting 统一的定向条件
|
||||
type UnifiedTargeting struct {
|
||||
// 地理定向
|
||||
Countries []string `bson:"countries" json:"countries"` // 国家列表
|
||||
Regions []string `bson:"regions" json:"regions"` // 地区列表
|
||||
Cities []string `bson:"cities" json:"cities"` // 城市列表
|
||||
PostalCodes []string `bson:"postalCodes" json:"postalCodes"` // 邮政编码列表
|
||||
|
||||
// 人口统计定向
|
||||
AgeRange *UnifiedAgeRange `bson:"ageRange" json:"ageRange"` // 年龄范围
|
||||
Gender []string `bson:"gender" json:"gender"` // 性别
|
||||
Income []string `bson:"income" json:"income"` // 收入水平
|
||||
Education []string `bson:"education" json:"education"` // 教育程度
|
||||
Occupation []string `bson:"occupation" json:"occupation"` // 职业类型
|
||||
|
||||
// 兴趣定向
|
||||
Interests []string `bson:"interests" json:"interests"` // 兴趣标签
|
||||
Lifestyle []string `bson:"lifestyle" json:"lifestyle"` // 生活方式
|
||||
|
||||
// 行为定向
|
||||
SearchHistory []string `bson:"searchHistory" json:"searchHistory"` // 搜索历史
|
||||
BrowseHistory []string `bson:"browseHistory" json:"browseHistory"` // 浏览历史
|
||||
PurchaseHistory []string `bson:"purchaseHistory" json:"purchaseHistory"` // 购买历史
|
||||
AdInteractions []string `bson:"adInteractions" json:"adInteractions"` // 广告互动
|
||||
Behaviors []string `bson:"behaviors" json:"behaviors"` // 行为标签
|
||||
Segments []string `bson:"segments" json:"segments"` // 用户分群
|
||||
|
||||
// 上下文定向
|
||||
Categories []string `bson:"categories" json:"categories"` // 内容分类
|
||||
Keywords []string `bson:"keywords" json:"keywords"` // 关键词
|
||||
Tags []string `bson:"tags" json:"tags"` // 标签
|
||||
Sentiment string `bson:"sentiment" json:"sentiment"` // 情感倾向
|
||||
ContentType string `bson:"contentType" json:"contentType"` // 内容类型
|
||||
ContentRating string `bson:"contentRating" json:"contentRating"` // 内容评级
|
||||
|
||||
// 设备定向
|
||||
DeviceTypes []string `bson:"deviceTypes" json:"deviceTypes"` // 设备类型
|
||||
OS []string `bson:"os" json:"os"` // 操作系统
|
||||
Browsers []string `bson:"browsers" json:"browsers"` // 浏览器
|
||||
Carriers []string `bson:"carriers" json:"carriers"` // 运营商
|
||||
ConnectionTypes []string `bson:"connectionTypes" json:"connectionTypes"` // 连接类型
|
||||
|
||||
// 时间定向
|
||||
TimeSlots []UnifiedTimeSlot `bson:"timeSlots" json:"timeSlots"` // 时间段
|
||||
DaysOfWeek []int `bson:"daysOfWeek" json:"daysOfWeek"` // 星期几
|
||||
Dates []string `bson:"dates" json:"dates"` // 日期范围
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
ExcludeHolidays bool `bson:"excludeHolidays" json:"excludeHolidays"` // 排除节假日
|
||||
|
||||
// 扩展定向条件
|
||||
CustomTargeting map[string]interface{} `bson:"customTargeting" json:"customTargeting"` // 自定义定向
|
||||
}
|
||||
|
||||
// UnifiedAgeRange 统一的年龄范围
|
||||
type UnifiedAgeRange struct {
|
||||
Min int `bson:"min" json:"min"` // 最小年龄
|
||||
Max int `bson:"max" json:"max"` // 最大年龄
|
||||
}
|
||||
|
||||
// UnifiedTimeSlot 统一的时间段
|
||||
type UnifiedTimeSlot struct {
|
||||
DayOfWeek int `bson:"dayOfWeek" json:"dayOfWeek"` // 星期几:0-6,0表示星期日
|
||||
StartTime string `bson:"startTime" json:"startTime"` // 开始时间,格式:HH:mm
|
||||
EndTime string `bson:"endTime" json:"endTime"` // 结束时间,格式:HH:mm
|
||||
Timezone string `bson:"timezone" json:"timezone"` // 时区
|
||||
}
|
||||
Reference in New Issue
Block a user