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

29 lines
1.2 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 (
"gitea.com/red-future/common/beans"
)
const StrategyCollection = "strategy"
// Strategy 匹配策略表
type Strategy struct {
beans.MongoBaseDO `bson:",inline" json:",inline"`
Status string `bson:"status" json:"status"` // 状态active、inactive、maintenance等
// 策略基本信息
Name string `bson:"name" json:"name"` // 策略名称
Description string `bson:"description" json:"description"` // 描述
MinConversion float64 `bson:"minConversion" json:"minConversion"` // 最低转化率
MaxConversion float64 `bson:"maxConversion" json:"maxConversion"` // 最高转化率
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"` // 优先级(用于策略排序)
}
// GetCollectionName 获取集合名称
func (s *Strategy) GetCollectionName() string {
return StrategyCollection
}