2025-12-06 09:10:24 +08:00
|
|
|
|
package dto
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2025-12-09 16:10:45 +08:00
|
|
|
|
"cid/model/entity"
|
2025-12-06 09:10:24 +08:00
|
|
|
|
|
|
|
|
|
|
"gitee.com/red-future---jilin-g/common/http"
|
|
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// AddAdPositionReq 添加广告位请求
|
|
|
|
|
|
type AddAdPositionReq struct {
|
2025-12-06 15:24:30 +08:00
|
|
|
|
g.Meta `path:"/add" method:"post" tags:"广告位管理" summary:"添加广告位" dc:"添加新的广告位"`
|
2025-12-06 09:10:24 +08:00
|
|
|
|
|
|
|
|
|
|
// 基本信息
|
|
|
|
|
|
Name string `json:"name" v:"required"` // 广告位名称
|
|
|
|
|
|
Description string `json:"description"` // 广告位描述
|
|
|
|
|
|
PositionCode string `json:"positionCode" v:"required"` // 广告位编码,用于标识
|
|
|
|
|
|
AdFormat string `json:"adFormat" v:"required"` // 支持的广告格式
|
|
|
|
|
|
|
|
|
|
|
|
// 尺寸信息
|
|
|
|
|
|
Width int `json:"width" v:"required"` // 宽度(px)
|
|
|
|
|
|
Height int `json:"height" v:"required"` // 高度(px)
|
|
|
|
|
|
|
|
|
|
|
|
// 位置信息
|
|
|
|
|
|
Page string `json:"page" v:"required"` // 所属页面
|
|
|
|
|
|
Section string `json:"section" v:"required"` // 页面区域
|
|
|
|
|
|
Location string `json:"location" v:"required"` // 具体位置
|
|
|
|
|
|
|
|
|
|
|
|
// 展示设置
|
|
|
|
|
|
MaxAds int `json:"maxAds"` // 最大广告数量
|
|
|
|
|
|
RefreshInterval int `json:"refreshInterval"` // 刷新间隔(秒)
|
|
|
|
|
|
IsLazyLoad bool `json:"isLazyLoad"` // 是否懒加载
|
|
|
|
|
|
|
|
|
|
|
|
// 定价设置
|
|
|
|
|
|
PricingModel string `json:"pricingModel" v:"required"` // 计费模型:CPC、CPM、CPA等
|
|
|
|
|
|
BasePrice int64 `json:"basePrice" v:"required"` // 基础价格(分)
|
|
|
|
|
|
FloorPrice int64 `json:"floorPrice" v:"required"` // 底价(分)
|
|
|
|
|
|
PriceUnit string `json:"priceUnit" v:"required"` // 价格单位:千次展示、单次点击、单次转化等
|
|
|
|
|
|
|
|
|
|
|
|
// 展示规则
|
|
|
|
|
|
DisplayRules *entity.DisplayRules `json:"displayRules"` // 展示规则
|
|
|
|
|
|
|
|
|
|
|
|
// 状态信息
|
|
|
|
|
|
Status string `json:"status" v:"required"` // 广告位状态:启用、禁用、测试
|
|
|
|
|
|
IsExclusive bool `json:"isExclusive"` // 是否独占广告位
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type AddAdPositionRes struct {
|
|
|
|
|
|
Id string `json:"id"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// UpdateAdPositionReq 更新广告位请求
|
|
|
|
|
|
type UpdateAdPositionReq struct {
|
2025-12-06 15:24:30 +08:00
|
|
|
|
g.Meta `path:"/update" method:"put" tags:"广告位管理" summary:"更新广告位" dc:"更新广告位信息"`
|
2025-12-06 09:10:24 +08:00
|
|
|
|
|
|
|
|
|
|
Id string `json:"id" v:"required"` // ID
|
|
|
|
|
|
|
|
|
|
|
|
// 基本信息
|
|
|
|
|
|
Name string `json:"name"` // 广告位名称
|
|
|
|
|
|
Description string `json:"description"` // 广告位描述
|
|
|
|
|
|
PositionCode string `json:"positionCode"` // 广告位编码,用于标识
|
|
|
|
|
|
AdFormat string `json:"adFormat"` // 支持的广告格式
|
|
|
|
|
|
|
|
|
|
|
|
// 尺寸信息
|
|
|
|
|
|
Width *int `json:"width"` // 宽度(px)
|
|
|
|
|
|
Height *int `json:"height"` // 高度(px)
|
|
|
|
|
|
|
|
|
|
|
|
// 位置信息
|
|
|
|
|
|
Page string `json:"page"` // 所属页面
|
|
|
|
|
|
Section string `json:"section"` // 页面区域
|
|
|
|
|
|
Location string `json:"location"` // 具体位置
|
|
|
|
|
|
|
|
|
|
|
|
// 展示设置
|
|
|
|
|
|
MaxAds *int `json:"maxAds"` // 最大广告数量
|
|
|
|
|
|
RefreshInterval *int `json:"refreshInterval"` // 刷新间隔(秒)
|
|
|
|
|
|
IsLazyLoad *bool `json:"isLazyLoad"` // 是否懒加载
|
|
|
|
|
|
|
|
|
|
|
|
// 定价设置
|
|
|
|
|
|
PricingModel string `json:"pricingModel"` // 计费模型:CPC、CPM、CPA等
|
|
|
|
|
|
BasePrice *int64 `json:"basePrice"` // 基础价格(分)
|
|
|
|
|
|
FloorPrice *int64 `json:"floorPrice"` // 底价(分)
|
|
|
|
|
|
PriceUnit string `json:"priceUnit"` // 价格单位:千次展示、单次点击、单次转化等
|
|
|
|
|
|
|
|
|
|
|
|
// 展示规则
|
|
|
|
|
|
DisplayRules *entity.DisplayRules `json:"displayRules"` // 展示规则
|
|
|
|
|
|
|
|
|
|
|
|
// 状态信息
|
|
|
|
|
|
Status *string `json:"status"` // 广告位状态:启用、禁用、测试
|
|
|
|
|
|
IsExclusive *bool `json:"isExclusive"` // 是否独占广告位
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetAdPositionReq 获取广告位详情请求
|
|
|
|
|
|
type GetAdPositionReq struct {
|
2025-12-06 15:24:30 +08:00
|
|
|
|
g.Meta `path:"/one" method:"get" tags:"广告位管理" summary:"获取广告位详情" dc:"根据ID获取单个广告位详情"`
|
2025-12-06 09:10:24 +08:00
|
|
|
|
Id string `json:"id" v:"required"` // ID
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetAdPositionRes struct {
|
|
|
|
|
|
*entity.AdPosition
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ListAdPositionReq 获取广告位列表请求
|
|
|
|
|
|
type ListAdPositionReq struct {
|
2025-12-06 15:24:30 +08:00
|
|
|
|
g.Meta `path:"/list" method:"get" tags:"广告位管理" summary:"获取广告位列表" dc:"分页查询广告位列表,支持多条件筛选"`
|
2025-12-06 09:10:24 +08:00
|
|
|
|
http.Page
|
|
|
|
|
|
|
|
|
|
|
|
Name string `json:"name"` // 广告位名称模糊查询
|
|
|
|
|
|
PositionCode string `json:"positionCode"` // 广告位编码
|
|
|
|
|
|
PageName string `json:"pageName"` // 所属页面
|
|
|
|
|
|
Section string `json:"section"` // 页面区域
|
|
|
|
|
|
Status string `json:"status"` // 广告位状态
|
|
|
|
|
|
AdFormat string `json:"adFormat"` // 广告格式
|
|
|
|
|
|
DateRange []string `json:"dateRange"` // 创建时间范围 [start, end]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ListAdPositionRes struct {
|
|
|
|
|
|
List []*entity.AdPosition `json:"list"`
|
|
|
|
|
|
Total int `json:"total"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// UpdateAdPositionStatusReq 更新广告位状态请求
|
|
|
|
|
|
type UpdateAdPositionStatusReq struct {
|
2025-12-06 15:24:30 +08:00
|
|
|
|
g.Meta `path:"/updateStatus" method:"patch" tags:"广告位管理" summary:"更新广告位状态" dc:"更新广告位状态"`
|
2025-12-06 09:10:24 +08:00
|
|
|
|
|
|
|
|
|
|
Id string `json:"id" v:"required"` // 广告位ID
|
|
|
|
|
|
Status string `json:"status" v:"required"` // 广告位状态:启用、禁用、测试
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetAvailableAdPositionsReq 获取可用广告位请求
|
|
|
|
|
|
type GetAvailableAdPositionsReq struct {
|
2025-12-06 15:41:38 +08:00
|
|
|
|
g.Meta `path:"/getAvailableAdPositions" method:"get" tags:"广告位管理" summary:"获取可用广告位列表" dc:"获取所有启用的广告位列表"`
|
2025-12-06 09:10:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type GetAvailableAdPositionsRes struct {
|
|
|
|
|
|
List []*entity.AdPosition `json:"list"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MatchAdReq 匹配广告请求
|
|
|
|
|
|
type MatchAdReq struct {
|
2025-12-06 15:41:38 +08:00
|
|
|
|
g.Meta `path:"/matchAd" method:"post" tags:"广告位管理" summary:"匹配广告" dc:"根据广告位编码和用户信息匹配适合的广告"`
|
2025-12-06 09:10:24 +08:00
|
|
|
|
|
|
|
|
|
|
PositionCode string `json:"positionCode" v:"required"` // 广告位编码
|
|
|
|
|
|
UserInfo map[string]interface{} `json:"userInfo"` // 用户信息
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type MatchAdRes struct {
|
|
|
|
|
|
*entity.Advertisement `json:"advertisement"`
|
|
|
|
|
|
}
|