优化mongo,封装count逻辑,处理objectId
This commit is contained in:
@@ -1,86 +1,16 @@
|
||||
package consts
|
||||
|
||||
// 广告源状态
|
||||
const (
|
||||
AdSourceStatusActive = "active" // 活跃
|
||||
AdSourceStatusInactive = "inactive" // 非活跃
|
||||
AdSourceStatusMaintenance = "maintenance" // 维护中
|
||||
)
|
||||
// 注意:以下枚举常量已迁移到单独的枚举文件中,请使用新的枚举类型:
|
||||
// - AdSourceStatus -> consts.AdSourceStatus (ad_source_status.go)
|
||||
// - AdSourceHealth -> consts.AdSourceHealth (ad_source_health.go)
|
||||
// - AdSourceType -> consts.AdSourceType (ad_source_type.go)
|
||||
// - AdSourceProvider -> consts.AdSourceProvider (ad_source_provider.go)
|
||||
// - AuthType -> consts.AuthType (auth_type.go)
|
||||
// - BiddingType -> consts.BiddingType (bidding_type.go)
|
||||
// - AdFormatType -> consts.AdFormatType (ad_format_type.go)
|
||||
// - BillingModel -> consts.BillingModel (billing_model.go)
|
||||
// - PaymentTerms -> consts.PaymentTerms (payment_terms.go)
|
||||
|
||||
// 广告源健康状态
|
||||
const (
|
||||
AdSourceHealthHealthy = "healthy" // 健康
|
||||
AdSourceHealthDegraded = "degraded" // 降级
|
||||
AdSourceHealthUnhealthy = "unhealthy" // 不健康
|
||||
)
|
||||
|
||||
// 广告源类型
|
||||
const (
|
||||
AdSourceTypeSelf = "self" // 自营
|
||||
AdSourceTypeThirdParty = "third_party" // 第三方
|
||||
AdSourceTypeExchange = "exchange" // 广告交易平台
|
||||
)
|
||||
|
||||
// 广告源提供商
|
||||
const (
|
||||
AdSourceProviderGoogle = "google" // Google
|
||||
AdSourceProviderBaidu = "baidu" // 百度
|
||||
AdSourceProviderTencent = "tencent" // 腾讯
|
||||
AdSourceProviderSelf = "self" // 自营
|
||||
)
|
||||
|
||||
// 认证类型
|
||||
const (
|
||||
AuthTypeAPIKey = "api_key" // API密钥
|
||||
AuthTypeOAuth = "oauth" // OAuth
|
||||
AuthTypeBasic = "basic" // Basic认证
|
||||
)
|
||||
|
||||
// 竞价类型
|
||||
const (
|
||||
BiddingTypeCPM = "cpm" // 千次展示成本
|
||||
BiddingTypeCPC = "cpc" // 每次点击成本
|
||||
BiddingTypeCPA = "cpa" // 每次行动成本
|
||||
BiddingTypeRTB = "rtb" // 实时竞价
|
||||
)
|
||||
|
||||
// 广告格式类型
|
||||
const (
|
||||
AdFormatTypeBanner = "banner" // 横幅广告
|
||||
AdFormatTypeVideo = "video" // 视频广告
|
||||
AdFormatTypeNative = "native" // 原生广告
|
||||
AdFormatTypeInterstitial = "interstitial" // 插屏广告
|
||||
)
|
||||
|
||||
// 计费模式
|
||||
const (
|
||||
BillingModelCPM = "cpm" // 千次展示成本
|
||||
BillingModelCPC = "cpc" // 每次点击成本
|
||||
BillingModelCPA = "cpa" // 每次行动成本
|
||||
BillingModelRevShare = "rev_share" // 收入分成
|
||||
)
|
||||
|
||||
// 支付条款
|
||||
const (
|
||||
PaymentTermsNet30 = "net_30" // 30天
|
||||
PaymentTermsNet60 = "net_60" // 60天
|
||||
PaymentTermsNet90 = "net_90" // 90天
|
||||
)
|
||||
|
||||
// 默认配置值
|
||||
const (
|
||||
DefaultTimeout = 5000 // 默认超时时间(毫秒)
|
||||
DefaultRetryCount = 3 // 默认重试次数
|
||||
DefaultPriority = 1 // 默认优先级
|
||||
)
|
||||
|
||||
// 错误消息
|
||||
const (
|
||||
ErrAdSourceNotFound = "广告源不存在"
|
||||
ErrAdSourceNameExists = "广告源名称已存在"
|
||||
ErrAdSourceCodeExists = "广告源编码已存在"
|
||||
ErrAdSourceInactive = "广告源非活跃状态"
|
||||
ErrAdSourceUnhealthy = "广告源健康状态异常"
|
||||
ErrRateLimitExceeded = "请求频率超限"
|
||||
ErrInvalidConfiguration = "配置参数无效"
|
||||
)
|
||||
// 配置值常量已迁移到 config.go 文件中
|
||||
// 错误消息常量已迁移到 config.go 文件中
|
||||
// MongoDB集合名称常量已迁移到 collections.go 文件中
|
||||
|
||||
Reference in New Issue
Block a user