Files
cid/model/dto/cid_dto.go
2025-12-06 15:41:38 +08:00

82 lines
3.6 KiB
Go
Raw 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 dto
import (
"github.com/gogf/gf/v2/frame/g"
)
// GenerateCIDReq 生成CID请求
type GenerateCIDReq struct {
g.Meta `path:"/generateCID" method:"post" tags:"CID服务" summary:"生成CID广告" dc:"为当前用户生成CID广告"`
UserId int64 `json:"user_id"` // 用户ID可选如果不提供则从token获取
RequestType string `json:"request_type"` // 请求类型
Parameters map[string]interface{} `json:"parameters"` // 请求参数
Position string `json:"position"` // 广告位置
Count int `json:"count"` // 广告数量
}
// AdInfo 广告信息
type AdInfo struct {
Id int64 `json:"id"` // 广告ID
Title string `json:"title"` // 广告标题
Description string `json:"description"` // 广告描述
ImageUrl string `json:"image_url"` // 广告图片URL
TargetUrl string `json:"target_url"` // 目标链接
ConversionRate float64 `json:"conversion_rate"` // 转化率
Source string `json:"source"` // 广告源
Bid int `json:"bid"` // 出价(分)
}
// GenerateCIDRes 生成CID响应
type GenerateCIDRes struct {
CID string `json:"cid"` // 唯一CID
Ads []*AdInfo `json:"ads"` // 广告列表
TotalAds int `json:"total_ads"` // 总广告数
TenantId int64 `json:"tenant_id"` // 租户ID
TenantName string `json:"tenant_name"` // 租户名称
GeneratedAt string `json:"generated_at"` // 生成时间
}
// GetCIDStatisticsReq 获取CID统计请求
type GetCIDStatisticsReq struct {
g.Meta `path:"/getStatistics" method:"get" tags:"CID服务" summary:"获取CID统计" dc:"获取CID服务的统计信息"`
UserId int64 `json:"user_id"` // 用户ID可选
TenantId int64 `json:"tenant_id"` // 租户ID可选
DateFrom int64 `json:"date_from"` // 开始日期
DateTo int64 `json:"date_to"` // 结束日期
}
// GetCIDStatisticsRes 获取CID统计响应
type GetCIDStatisticsRes struct {
TotalRequests int64 `json:"total_requests"` // 总请求数
SuccessfulReq int64 `json:"successful_requests"` // 成功请求数
AverageProcessTime float64 `json:"average_process_time"` // 平均处理时间
TopSources []string `json:"top_sources"` // 主要广告源
ConversionStats map[string]float64 `json:"conversion_stats"` // 转化率统计
}
// CIDRequestHistory CID请求历史记录
type CIDRequestHistory struct {
Id int64 `json:"id"` // 记录ID
TenantId int64 `json:"tenant_id"` // 租户ID
UserId int64 `json:"user_id"` // 用户ID
RequestType string `json:"request_type"` // 请求类型
Status string `json:"status"` // 状态
ProcessTime int `json:"process_time"` // 处理时间(ms)
CreatedAt string `json:"created_at"` // 创建时间
}
// GetCIDHistoryReq 获取CID历史请求
type GetCIDHistoryReq struct {
g.Meta `path:"/getCidHistory" method:"get" tags:"CID服务" summary:"获取CID历史记录" dc:"分页获取用户的CID请求历史"`
Page int `json:"page" v:"required|min:1"` // 页码
Size int `json:"size" v:"required|min:1|max:100"` // 每页数量
}
// GetCIDHistoryRes 获取CID历史响应
type GetCIDHistoryRes struct {
List []*CIDRequestHistory `json:"list"` // 历史记录列表
Total int64 `json:"total"` // 总数
Page int `json:"page"` // 当前页
Size int `json:"size"` // 每页数量
}