Dockerfile
This commit is contained in:
@@ -1,149 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cid/model/entity"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// AddAdPositionReq 添加广告位请求
|
||||
type AddAdPositionReq struct {
|
||||
g.Meta `path:"/add" method:"post" tags:"广告位管理" summary:"添加广告位" dc:"添加新的广告位"`
|
||||
|
||||
// 基本信息
|
||||
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 *bson.ObjectID `json:"id"`
|
||||
}
|
||||
|
||||
// UpdateAdPositionReq 更新广告位请求
|
||||
type UpdateAdPositionReq struct {
|
||||
g.Meta `path:"/update" method:"put" tags:"广告位管理" summary:"更新广告位" dc:"更新广告位信息"`
|
||||
|
||||
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 {
|
||||
g.Meta `path:"/one" method:"get" tags:"广告位管理" summary:"获取广告位详情" dc:"根据ID获取单个广告位详情"`
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
type GetAdPositionRes struct {
|
||||
*entity.AdPosition
|
||||
}
|
||||
|
||||
// ListAdPositionReq 获取广告位列表请求
|
||||
type ListAdPositionReq struct {
|
||||
g.Meta `path:"/list" method:"get" tags:"广告位管理" summary:"获取广告位列表" dc:"分页查询广告位列表,支持多条件筛选"`
|
||||
*beans.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 {
|
||||
g.Meta `path:"/updateStatus" method:"patch" tags:"广告位管理" summary:"更新广告位状态" dc:"更新广告位状态"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告位ID
|
||||
Status string `json:"status" v:"required"` // 广告位状态:启用、禁用、测试
|
||||
}
|
||||
|
||||
// GetAvailableAdPositionsReq 获取可用广告位请求
|
||||
type GetAvailableAdPositionsReq struct {
|
||||
g.Meta `path:"/getAvailableAdPositions" method:"get" tags:"广告位管理" summary:"获取可用广告位列表" dc:"获取所有启用的广告位列表"`
|
||||
}
|
||||
|
||||
type GetAvailableAdPositionsRes struct {
|
||||
List []*entity.AdPosition `json:"list"`
|
||||
}
|
||||
|
||||
// MatchAdReq 匹配广告请求
|
||||
type MatchAdReq struct {
|
||||
g.Meta `path:"/matchAd" method:"post" tags:"广告位管理" summary:"匹配广告" dc:"根据广告位编码和用户信息匹配适合的广告"`
|
||||
|
||||
PositionCode string `json:"positionCode" v:"required"` // 广告位编码
|
||||
UserInfo map[string]interface{} `json:"userInfo"` // 用户信息
|
||||
}
|
||||
|
||||
type MatchAdRes struct {
|
||||
*entity.Advertisement `json:"advertisement"`
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cid/model/entity"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateAdSourceReq 创建广告源请求
|
||||
type CreateAdSourceReq struct {
|
||||
g.Meta `path:"/create" method:"post" tags:"广告源管理" summary:"创建广告源" dc:"创建新的广告源配置"`
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name" v:"required"` // 广告源名称
|
||||
Code string `json:"code" v:"required"` // 广告源编码,唯一标识
|
||||
Provider string `json:"provider" v:"required"` // 提供商:google、facebook、baidu、tencent、self等
|
||||
Type string `json:"type" v:"required|in:self,third_party,exchange"` // 类型
|
||||
Description string `json:"description"` // 描述
|
||||
|
||||
// 连接配置
|
||||
APIEndpoint string `json:"apiEndpoint" v:"required"` // API端点
|
||||
APIVersion string `json:"apiVersion"` // API版本
|
||||
AuthType string `json:"authType" v:"required|in:api_key,oauth,basic"` // 认证类型
|
||||
AuthConfig map[string]interface{} `json:"authConfig" v:"required"` // 认证配置
|
||||
Headers map[string]string `json:"headers"` // 请求头配置
|
||||
Timeout int `json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `json:"retryCount"` // 重试次数
|
||||
|
||||
// 基础配置
|
||||
SupportedFormats []string `json:"supportedFormats" v:"required"` // 支持的广告格式
|
||||
SupportedSizes []string `json:"supportedSizes"` // 支持的尺寸
|
||||
SupportedDevices []string `json:"supportedDevices"` // 支持的设备类型
|
||||
SupportedOS []string `json:"supportedOS"` // 支持的操作系统
|
||||
SupportedCountries []string `json:"supportedCountries"` // 支持的国家/地区
|
||||
|
||||
// 竞价配置
|
||||
BiddingType string `json:"biddingType" v:"required|in:cpm,cpc,cpa,rtb"` // 竞价类型
|
||||
MinBidAmount int64 `json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `json:"maxBidAmount"` // 最大出价(分)
|
||||
BidIncrement int64 `json:"bidIncrement"` // 出价增量(分)
|
||||
DefaultBidAmount int64 `json:"defaultBidAmount"` // 默认出价(分)
|
||||
AutoOptimization bool `json:"autoOptimization"` // 是否自动优化
|
||||
|
||||
// 最大广告数
|
||||
MaxAdsPerRequest int `json:"maxAdsPerRequest"` // 单次请求最大广告数量
|
||||
|
||||
// 其他配置
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见性支持
|
||||
RealTimeBidding bool `json:"realTimeBidding"` // 实时竞价
|
||||
HeaderBidding bool `json:"headerBidding"` // 标题竞价
|
||||
|
||||
// 财务设置
|
||||
BillingModel string `json:"billingModel" v:"required|in:cpm,cpc,cpa,rev_share"` // 计费模式
|
||||
PaymentTerms string `json:"paymentTerms" v:"in:net_30,net_60,net_90"` // 支付条款
|
||||
RevShareRate float64 `json:"revShareRate" v:"between:0,1"` // 收入分成比例
|
||||
MinPayment int64 `json:"minPayment"` // 最小支付金额(分)
|
||||
Currency string `json:"currency"` // 货币单位
|
||||
TaxInclusive bool `json:"taxInclusive"` // 是否含税
|
||||
|
||||
// 系统信息
|
||||
Priority int `json:"priority"` // 优先级
|
||||
}
|
||||
|
||||
type CreateAdSourceRes struct {
|
||||
Id string `json:"id"` // 广告源ID
|
||||
}
|
||||
|
||||
// GetAdSourceReq 获取广告源详情请求
|
||||
type GetAdSourceReq struct {
|
||||
g.Meta `path:"/getByID" method:"get" tags:"广告源管理" summary:"获取广告源详情" dc:"根据ID获取单个广告源详情"`
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
}
|
||||
|
||||
type GetAdSourceRes struct {
|
||||
*entity.AdSource
|
||||
}
|
||||
|
||||
// ListAdSourceReq 获取广告源列表请求
|
||||
type ListAdSourceReq struct {
|
||||
g.Meta `path:"/getList" method:"get" tags:"广告源管理" summary:"获取广告源列表" dc:"分页查询广告源列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
|
||||
Name string `json:"name"` // 广告源名称模糊查询
|
||||
Code string `json:"code"` // 广告源编码
|
||||
Provider string `json:"provider"` // 提供商
|
||||
Type string `json:"type"` // 类型
|
||||
Status string `json:"status"` // 状态
|
||||
Health string `json:"health"` // 健康状态
|
||||
}
|
||||
|
||||
type ListAdSourceRes struct {
|
||||
List []*entity.AdSource `json:"list"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// UpdateAdSourceReq 更新广告源请求
|
||||
type UpdateAdSourceReq struct {
|
||||
g.Meta `path:"/update" method:"put" tags:"广告源管理" summary:"更新广告源" dc:"更新广告源信息"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name"` // 广告源名称
|
||||
Description string `json:"description"` // 描述
|
||||
|
||||
// 连接配置
|
||||
APIEndpoint string `json:"apiEndpoint"` // API端点
|
||||
APIVersion string `json:"apiVersion"` // API版本
|
||||
AuthType string `json:"authType"` // 认证类型
|
||||
AuthConfig map[string]interface{} `json:"authConfig"` // 认证配置
|
||||
Headers map[string]string `json:"headers"` // 请求头配置
|
||||
Timeout int `json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `json:"retryCount"` // 重试次数
|
||||
|
||||
// 基础配置
|
||||
SupportedFormats []string `json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedSizes []string `json:"supportedSizes"` // 支持的尺寸
|
||||
SupportedDevices []string `json:"supportedDevices"` // 支持的设备类型
|
||||
SupportedOS []string `json:"supportedOS"` // 支持的操作系统
|
||||
SupportedCountries []string `json:"supportedCountries"` // 支持的国家/地区
|
||||
|
||||
// 竞价配置
|
||||
BiddingType string `json:"biddingType"` // 竞价类型
|
||||
MinBidAmount int64 `json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `json:"maxBidAmount"` // 最大出价(分)
|
||||
BidIncrement int64 `json:"bidIncrement"` // 出价增量(分)
|
||||
DefaultBidAmount int64 `json:"defaultBidAmount"` // 默认出价(分)
|
||||
AutoOptimization bool `json:"autoOptimization"` // 是否自动优化
|
||||
|
||||
// 最大广告数
|
||||
MaxAdsPerRequest int `json:"maxAdsPerRequest"` // 单次请求最大广告数量
|
||||
|
||||
// 其他配置
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见性支持
|
||||
RealTimeBidding bool `json:"realTimeBidding"` // 实时竞价
|
||||
HeaderBidding bool `json:"headerBidding"` // 标题竞价
|
||||
|
||||
// 财务设置
|
||||
BillingModel string `json:"billingModel"` // 计费模式
|
||||
PaymentTerms string `json:"paymentTerms"` // 支付条款
|
||||
RevShareRate float64 `json:"revShareRate"` // 收入分成比例
|
||||
MinPayment int64 `json:"minPayment"` // 最小支付金额(分)
|
||||
Currency string `json:"currency"` // 货币单位
|
||||
TaxInclusive bool `json:"taxInclusive"` // 是否含税
|
||||
|
||||
// 系统信息
|
||||
Priority int `json:"priority"` // 优先级
|
||||
}
|
||||
|
||||
// UpdateAdSourceStatusReq 更新广告源状态请求
|
||||
type UpdateAdSourceStatusReq struct {
|
||||
// g.Meta `path:"/adsource" method:"patch" tags:"广告源管理" summary:"更新广告源状态" dc:"更新广告源状态"` // 暂时注释,缺少对应的controller方法
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
Status string `json:"status" v:"required"` // 广告源状态:active、inactive、maintenance
|
||||
}
|
||||
|
||||
// DeleteAdSourceReq 删除广告源请求
|
||||
type DeleteAdSourceReq struct {
|
||||
g.Meta `path:"/delete" method:"delete" tags:"广告源管理" summary:"删除广告源" dc:"删除指定的广告源"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
}
|
||||
|
||||
// TestAdSourceReq 测试广告源连接请求
|
||||
type TestAdSourceReq struct {
|
||||
// g.Meta `path:"/adsource-test" method:"post" tags:"广告源管理" summary:"测试广告源连接" dc:"测试广告源的连接性和可用性"` // 暂时注释,缺少对应的controller方法
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
}
|
||||
|
||||
type TestAdSourceRes struct {
|
||||
Success bool `json:"success"` // 测试是否成功
|
||||
ResponseTime int64 `json:"responseTime"` // 响应时间(毫秒)
|
||||
ErrorMessage string `json:"errorMessage"` // 错误信息
|
||||
SupportedFormats []string `json:"supportedFormats"` // 支持的广告格式
|
||||
}
|
||||
|
||||
// DeleteAdSourceRes 删除广告源响应
|
||||
type DeleteAdSourceRes struct {
|
||||
Success bool `json:"success"` // 删除是否成功
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package dto
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// GetAdSourceStatisticsReq 获取广告源统计数据请求
|
||||
type GetAdSourceStatisticsReq struct {
|
||||
g.Meta `path:"/adsource-statistics" method:"get" tags:"广告源管理" summary:"获取广告源统计数据" dc:"获取广告源的详细统计数据"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始日期
|
||||
EndDate int64 `json:"endDate" v:"required"` // 结束日期
|
||||
Dimension string `json:"dimension"` // 统计维度:day、week、month
|
||||
}
|
||||
|
||||
type GetAdSourceStatisticsRes struct {
|
||||
// 概览数据
|
||||
Overview AdSourceOverviewStats `json:"overview"`
|
||||
|
||||
// 趋势数据
|
||||
Trends []AdSourceTrendData `json:"trends"`
|
||||
|
||||
// 性能数据
|
||||
Performance AdSourcePerformanceStats `json:"performance"`
|
||||
|
||||
// 错误统计
|
||||
Errors []AdSourceErrorStats `json:"errors"`
|
||||
}
|
||||
|
||||
// AdSourceOverviewStats 广告源概览统计
|
||||
type AdSourceOverviewStats struct {
|
||||
TotalRequests int64 `json:"totalRequests"` // 总请求数
|
||||
SuccessfulRequests int64 `json:"successfulRequests"` // 成功请求数
|
||||
FailedRequests int64 `json:"failedRequests"` // 失败请求数
|
||||
TotalImpressions int64 `json:"totalImpressions"` // 总展示次数
|
||||
TotalClicks int64 `json:"totalClicks"` // 总点击次数
|
||||
TotalConversions int64 `json:"totalConversions"` // 总转化次数
|
||||
TotalRevenue int64 `json:"totalRevenue"` // 总收入(分)
|
||||
SuccessRate float64 `json:"successRate"` // 成功率
|
||||
ErrorRate float64 `json:"errorRate"` // 错误率
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
ECPM int64 `json:"ecpm"` // 有效千次展示成本(分)
|
||||
ECPC int64 `json:"ecpc"` // 有效点击成本(分)
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
Uptime float64 `json:"uptime"` // 可用性(百分比)
|
||||
}
|
||||
|
||||
// AdSourceTrendData 广告源趋势数据
|
||||
type AdSourceTrendData struct {
|
||||
Date int64 `json:"date"` // 日期
|
||||
Requests int64 `json:"requests"` // 请求数
|
||||
Impressions int64 `json:"impressions"` // 展示次数
|
||||
Clicks int64 `json:"clicks"` // 点击次数
|
||||
Conversions int64 `json:"conversions"` // 转化次数
|
||||
Revenue int64 `json:"revenue"` // 收入(分)
|
||||
SuccessRate float64 `json:"successRate"` // 成功率
|
||||
ErrorRate float64 `json:"errorRate"` // 错误率
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
ECPM int64 `json:"ecpm"` // 有效千次展示成本(分)
|
||||
ResponseTime float64 `json:"responseTime"` // 平均响应时间(毫秒)
|
||||
}
|
||||
|
||||
// AdSourcePerformanceStats 广告源性能统计
|
||||
type AdSourcePerformanceStats struct {
|
||||
// 响应时间分布
|
||||
ResponseTimeDistribution map[string]int64 `json:"responseTimeDistribution"` // 响应时间分布
|
||||
|
||||
// 错误类型统计
|
||||
ErrorTypes map[string]int64 `json:"errorTypes"` // 错误类型统计
|
||||
|
||||
// 地区性能
|
||||
RegionalPerformance map[string]AdSourceRegionalStats `json:"regionalPerformance"` // 地区性能
|
||||
|
||||
// 设备性能
|
||||
DevicePerformance map[string]AdSourceDeviceStats `json:"devicePerformance"` // 设备性能
|
||||
}
|
||||
|
||||
// AdSourceErrorStats 广告源错误统计
|
||||
type AdSourceErrorStats struct {
|
||||
ErrorType string `json:"errorType"` // 错误类型
|
||||
Count int64 `json:"count"` // 错误次数
|
||||
Percentage float64 `json:"percentage"` // 占比
|
||||
LastOccurred int64 `json:"lastOccurred"` // 最后发生时间
|
||||
}
|
||||
|
||||
// AdSourceRegionalStats 广告源地区统计
|
||||
type AdSourceRegionalStats struct {
|
||||
Region string `json:"region"` // 地区
|
||||
Requests int64 `json:"requests"` // 请求数
|
||||
Impressions int64 `json:"impressions"` // 展示次数
|
||||
Clicks int64 `json:"clicks"` // 点击次数
|
||||
Revenue int64 `json:"revenue"` // 收入(分)
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
ResponseTime float64 `json:"responseTime"` // 平均响应时间(毫秒)
|
||||
}
|
||||
|
||||
// AdSourceDeviceStats 广告源设备统计
|
||||
type AdSourceDeviceStats struct {
|
||||
Device string `json:"device"` // 设备类型
|
||||
Requests int64 `json:"requests"` // 请求数
|
||||
Impressions int64 `json:"impressions"` // 展示次数
|
||||
Clicks int64 `json:"clicks"` // 点击次数
|
||||
Revenue int64 `json:"revenue"` // 收入(分)
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
ResponseTime float64 `json:"responseTime"` // 平均响应时间(毫秒)
|
||||
}
|
||||
|
||||
// AdSourceTestMetrics 广告源测试质量指标
|
||||
type AdSourceTestMetrics struct {
|
||||
SuccessRate float64 `json:"successRate"` // 成功率
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cid/model/entity"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AddAdvertisementReq 添加广告请求
|
||||
type AddAdvertisementReq struct {
|
||||
g.Meta `path:"/add" method:"post" tags:"广告管理" summary:"添加广告" dc:"添加新的广告"`
|
||||
|
||||
// 广告基本信息
|
||||
Title string `json:"title" v:"required"` // 广告标题
|
||||
Description string `json:"description"` // 广告描述
|
||||
AdvertiserId string `json:"advertiserId" v:"required"` // 广告主ID
|
||||
AdPositionId string `json:"adPositionId" v:"required"` // 广告位ID
|
||||
AdType string `json:"adType" v:"required"` // 广告类型:图片、视频、文字等
|
||||
AdFormat string `json:"adFormat" v:"required"` // 广告格式
|
||||
MaterialUrl string `json:"materialUrl" v:"required"` // 广告素材URL
|
||||
TargetUrl string `json:"targetUrl" v:"required"` // 目标链接
|
||||
|
||||
// 投放设置
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始投放时间
|
||||
EndDate int64 `json:"endDate" v:"required"` // 结束投放时间
|
||||
Budget int64 `json:"budget" v:"required"` // 预算(分)
|
||||
DailyBudget int64 `json:"dailyBudget"` // 日预算(分)
|
||||
BidAmount int64 `json:"bidAmount" v:"required"` // 出价(分)
|
||||
BillingType string `json:"billingType" v:"required"` // 计费类型:CPC、CPM、CPA等
|
||||
|
||||
// 投放条件
|
||||
Targeting *entity.UnifiedTargeting `json:"targeting"` // 定向条件
|
||||
}
|
||||
|
||||
type AddAdvertisementRes struct {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
// UpdateAdvertisementReq 更新广告请求
|
||||
type UpdateAdvertisementReq struct {
|
||||
g.Meta `path:"/update" method:"put" tags:"广告管理" summary:"更新广告" dc:"更新广告信息"`
|
||||
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
|
||||
// 广告基本信息
|
||||
Title string `json:"title"` // 广告标题
|
||||
Description string `json:"description"` // 广告描述
|
||||
AdvertiserId string `json:"advertiserId"` // 广告主ID
|
||||
AdPositionId string `json:"adPositionId"` // 广告位ID
|
||||
AdType string `json:"adType"` // 广告类型:图片、视频、文字等
|
||||
AdFormat string `json:"adFormat"` // 广告格式
|
||||
MaterialUrl string `json:"materialUrl"` // 广告素材URL
|
||||
TargetUrl string `json:"targetUrl"` // 目标链接
|
||||
|
||||
// 投放设置
|
||||
StartDate *int64 `json:"startDate"` // 开始投放时间
|
||||
EndDate *int64 `json:"endDate"` // 结束投放时间
|
||||
Budget *int64 `json:"budget"` // 预算(分)
|
||||
DailyBudget *int64 `json:"dailyBudget"` // 日预算(分)
|
||||
BidAmount *int64 `json:"bidAmount"` // 出价(分)
|
||||
BillingType string `json:"billingType"` // 计费类型:CPC、CPM、CPA等
|
||||
|
||||
// 投放条件
|
||||
Targeting *entity.UnifiedTargeting `json:"targeting"` // 定向条件
|
||||
|
||||
// 状态信息
|
||||
Status *string `json:"status"` // 广告状态:待审核、审核中、已通过、已拒绝、投放中、已暂停、已结束
|
||||
AuditStatus *string `json:"auditStatus"` // 审核状态:通过、拒绝
|
||||
AuditReason *string `json:"auditReason"` // 审核不通过原因
|
||||
}
|
||||
|
||||
// GetAdvertisementReq 获取广告详情请求
|
||||
type GetAdvertisementReq struct {
|
||||
g.Meta `path:"/getOne" method:"get" tags:"广告管理" summary:"获取广告详情" dc:"根据ID获取单个广告详情"`
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
type GetAdvertisementRes struct {
|
||||
*entity.Advertisement
|
||||
}
|
||||
|
||||
// ListAdvertisementReq 获取广告列表请求
|
||||
type ListAdvertisementReq struct {
|
||||
g.Meta `path:"/list" method:"get" tags:"广告管理" summary:"获取广告列表" dc:"分页查询广告列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
|
||||
AdvertiserId string `json:"advertiserId"` // 广告主ID
|
||||
AdPositionId string `json:"adPositionId"` // 广告位ID
|
||||
AdType string `json:"adType"` // 广告类型
|
||||
Status string `json:"status"` // 广告状态
|
||||
AuditStatus string `json:"auditStatus"` // 审核状态
|
||||
Title string `json:"title"` // 广告标题模糊查询
|
||||
DateRange []string `json:"dateRange"` // 创建时间范围 [start, end]
|
||||
}
|
||||
|
||||
type ListAdvertisementRes struct {
|
||||
List []*entity.Advertisement `json:"list"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// AuditAdvertisementReq 审核广告请求
|
||||
type AuditAdvertisementReq struct {
|
||||
g.Meta `path:"/audit" method:"post" tags:"广告管理" summary:"审核广告" dc:"审核广告,通过或拒绝"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告ID
|
||||
AuditStatus string `json:"auditStatus" v:"required"` // 审核状态:通过、拒绝
|
||||
AuditReason string `json:"auditReason"` // 审核不通过原因
|
||||
}
|
||||
|
||||
// UpdateAdStatusReq 更新广告状态请求
|
||||
type UpdateAdStatusReq struct {
|
||||
g.Meta `path:"/updateStatus" method:"patch" tags:"广告管理" summary:"更新广告状态" dc:"更新广告状态"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告ID
|
||||
Status string `json:"status" v:"required"` // 广告状态:启用、禁用
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cid/model/entity"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AddAdvertiserReq 添加广告主请求
|
||||
type AddAdvertiserReq struct {
|
||||
g.Meta `path:"/add" method:"post" tags:"广告主管理" summary:"添加广告主" dc:"添加新的广告主"`
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name" v:"required"` // 广告主名称
|
||||
ContactName string `json:"contactName" v:"required"` // 联系人姓名
|
||||
ContactPhone string `json:"contactPhone" v:"required"` // 联系电话
|
||||
ContactEmail string `json:"contactEmail" v:"required"` // 联系邮箱
|
||||
Company string `json:"company" v:"required"` // 公司名称
|
||||
Industry string `json:"industry" v:"required"` // 所属行业
|
||||
Scale string `json:"scale"` // 公司规模
|
||||
|
||||
// 证件信息
|
||||
BusinessLicenseUrl string `json:"businessLicenseUrl" v:"required"` // 营业执照URL
|
||||
ICPLicenseUrl string `json:"icpLicenseUrl"` // ICP备案截图URL
|
||||
OtherLicenseUrls []string `json:"otherLicenseUrls"` // 其他证件URL
|
||||
|
||||
// 财务信息
|
||||
BankName string `json:"bankName" v:"required"` // 开户银行
|
||||
BankAccount string `json:"bankAccount" v:"required"` // 银行账号
|
||||
AccountName string `json:"accountName" v:"required"` // 账户名称
|
||||
|
||||
// 合同信息
|
||||
ContractId string `json:"contractId"` // 合同编号
|
||||
ContractType string `json:"contractType"` // 合同类型
|
||||
ContractUrl string `json:"contractUrl"` // 合同文件URL
|
||||
SignDate int64 `json:"signDate"` // 签约日期
|
||||
ExpireDate int64 `json:"expireDate"` // 到期日期
|
||||
|
||||
// 系统信息
|
||||
AccountBalance int64 `json:"accountBalance"` // 账户余额(分)
|
||||
CreditLimit int64 `json:"creditLimit"` // 授信额度(分)
|
||||
Remark string `json:"remark"` // 备注
|
||||
}
|
||||
|
||||
type AddAdvertiserRes struct {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
// UpdateAdvertiserReq 更新广告主请求
|
||||
type UpdateAdvertiserReq struct {
|
||||
g.Meta `path:"/update" method:"put" tags:"广告主管理" summary:"更新广告主" dc:"更新广告主信息"`
|
||||
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name"` // 广告主名称
|
||||
ContactName string `json:"contactName"` // 联系人姓名
|
||||
ContactPhone string `json:"contactPhone"` // 联系电话
|
||||
ContactEmail string `json:"contactEmail"` // 联系邮箱
|
||||
Company string `json:"company"` // 公司名称
|
||||
Industry string `json:"industry"` // 所属行业
|
||||
Scale string `json:"scale"` // 公司规模
|
||||
|
||||
// 证件信息
|
||||
BusinessLicenseUrl string `json:"businessLicenseUrl"` // 营业执照URL
|
||||
ICPLicenseUrl string `json:"icpLicenseUrl"` // ICP备案截图URL
|
||||
OtherLicenseUrls []string `json:"otherLicenseUrls"` // 其他证件URL
|
||||
|
||||
// 财务信息
|
||||
BankName string `json:"bankName"` // 开户银行
|
||||
BankAccount string `json:"bankAccount"` // 银行账号
|
||||
AccountName string `json:"accountName"` // 账户名称
|
||||
|
||||
// 合同信息
|
||||
ContractId string `json:"contractId"` // 合同编号
|
||||
ContractType string `json:"contractType"` // 合同类型
|
||||
ContractUrl string `json:"contractUrl"` // 合同文件URL
|
||||
SignDate *int64 `json:"signDate"` // 签约日期
|
||||
ExpireDate *int64 `json:"expireDate"` // 到期日期
|
||||
|
||||
// 系统信息
|
||||
AccountBalance *int64 `json:"accountBalance"` // 账户余额(分)
|
||||
CreditLimit *int64 `json:"creditLimit"` // 授信额度(分)
|
||||
Remark string `json:"remark"` // 备注
|
||||
|
||||
// 状态信息
|
||||
Status *string `json:"status"` // 广告主状态:待审核、已审核、已拒绝、已冻结
|
||||
AuditStatus *string `json:"auditStatus"` // 审核状态
|
||||
AuditReason *string `json:"auditReason"` // 审核不通过原因
|
||||
}
|
||||
|
||||
// GetAdvertiserReq 获取广告主详情请求
|
||||
type GetAdvertiserReq struct {
|
||||
g.Meta `path:"/getOne" method:"get" tags:"广告主管理" summary:"获取广告主详情" dc:"根据ID获取单个广告主详情"`
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
type GetAdvertiserRes struct {
|
||||
*entity.Advertiser
|
||||
}
|
||||
|
||||
// ListAdvertiserReq 获取广告主列表请求
|
||||
type ListAdvertiserReq struct {
|
||||
g.Meta `path:"/list" method:"get" tags:"广告主管理" summary:"获取广告主列表" dc:"分页查询广告主列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
|
||||
Name string `json:"name"` // 广告主名称模糊查询
|
||||
ContactName string `json:"contactName"` // 联系人模糊查询
|
||||
Company string `json:"company"` // 公司名称模糊查询
|
||||
Industry string `json:"industry"` // 所属行业
|
||||
Status string `json:"status"` // 广告主状态
|
||||
AuditStatus string `json:"auditStatus"` // 审核状态
|
||||
DateRange []string `json:"dateRange"` // 创建时间范围 [start, end]
|
||||
}
|
||||
|
||||
type ListAdvertiserRes struct {
|
||||
List []*entity.Advertiser `json:"list"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// AuditAdvertiserReq 审核广告主请求
|
||||
type AuditAdvertiserReq struct {
|
||||
g.Meta `path:"/audit" method:"post" tags:"广告主管理" summary:"审核广告主" dc:"审核广告主,通过或拒绝"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
AuditStatus string `json:"auditStatus" v:"required"` // 审核状态:通过、拒绝
|
||||
AuditReason string `json:"auditReason"` // 审核不通过原因
|
||||
}
|
||||
|
||||
// UpdateAdvertiserStatusReq 更新广告主状态请求
|
||||
type UpdateAdvertiserStatusReq struct {
|
||||
g.Meta `path:"/updateStatus" method:"patch" tags:"广告主管理" summary:"更新广告主状态" dc:"更新广告主状态"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
Status string `json:"status" v:"required"` // 广告主状态:启用、禁用、冻结
|
||||
}
|
||||
|
||||
// RechargeAdvertiserReq 广告主充值请求
|
||||
type RechargeAdvertiserReq struct {
|
||||
g.Meta `path:"/recharge" method:"post" tags:"广告主管理" summary:"广告主充值" dc:"为广告主账户充值"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
Amount int64 `json:"amount" v:"required"` // 充值金额(分)
|
||||
Remark string `json:"remark"` // 充值备注
|
||||
}
|
||||
|
||||
// UpdateCreditLimitReq 更新授信额度请求
|
||||
type UpdateCreditLimitReq struct {
|
||||
g.Meta `path:"/updateCreditLimit" method:"post" tags:"广告主管理" summary:"更新授信额度" dc:"更新广告主的授信额度"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
CreditLimit int64 `json:"creditLimit" v:"required"` // 授信额度(分)
|
||||
Remark string `json:"remark"` // 备注说明
|
||||
}
|
||||
|
||||
// GetAdvertiserBalanceReq 获取广告主余额请求
|
||||
type GetAdvertiserBalanceReq struct {
|
||||
g.Meta `path:"/getBalance" method:"get" tags:"广告主管理" summary:"获取广告主余额" dc:"根据ID获取广告主账户余额和授信额度"`
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
}
|
||||
|
||||
// GetAdvertiserBalanceRes 获取广告主余额响应
|
||||
type GetAdvertiserBalanceRes struct {
|
||||
Balance int64 `json:"balance"` // 账户余额(分)
|
||||
CreditLimit int64 `json:"creditLimit"` // 授信额度(分)
|
||||
}
|
||||
95
model/dto/app/application_dto.go
Normal file
95
model/dto/app/application_dto.go
Normal file
@@ -0,0 +1,95 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"cid/consts/app"
|
||||
entity "cid/model/entity/app"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateApplicationReq 创建应用请求
|
||||
type CreateApplicationReq struct {
|
||||
g.Meta `path:"/createApplication" method:"post" tags:"应用管理" summary:"创建应用" dc:"创建新的应用"`
|
||||
Name string `json:"name" v:"required" dc:"应用名称"`
|
||||
AppCode string `json:"appCode" v:"required" dc:"应用编码(唯一标识)"`
|
||||
Type app.AppType `json:"type" v:"required" dc:"应用类型"`
|
||||
Status app.AppStatus `json:"status" dc:"应用状态" d:"active"`
|
||||
Description string `json:"description" dc:"应用描述"`
|
||||
AccessConfig map[string]interface{} `json:"accessConfig" dc:"接入配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
CallbackConfig map[string]interface{} `json:"callbackConfig" dc:"回调配置"`
|
||||
}
|
||||
|
||||
// CreateApplicationRes 创建应用响应
|
||||
type CreateApplicationRes struct {
|
||||
Id int64 `json:"id" dc:"应用ID"`
|
||||
}
|
||||
|
||||
// ListApplicationReq 获取应用列表请求
|
||||
type ListApplicationReq struct {
|
||||
g.Meta `path:"/listApplications" method:"get" tags:"应用管理" summary:"获取应用列表" dc:"分页查询应用列表"`
|
||||
*beans.Page
|
||||
Name string `json:"name" dc:"应用名称"`
|
||||
AppCode string `json:"appCode" dc:"应用编码"`
|
||||
Type app.AppType `json:"type" dc:"应用类型"`
|
||||
Status app.AppStatus `json:"status" dc:"应用状态"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索应用名称或编码)"`
|
||||
}
|
||||
|
||||
// ListApplicationRes 获取应用列表响应
|
||||
type ListApplicationRes struct {
|
||||
List []ApplicationItem `json:"list" dc:"应用列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type ApplicationItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
Name string `json:"name"`
|
||||
AppCode string `json:"appCode"`
|
||||
Type app.AppType `json:"type"`
|
||||
TypeName string `json:"typeName"`
|
||||
Status app.AppStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
Description string `json:"description"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetApplicationReq 获取应用详情请求
|
||||
type GetApplicationReq struct {
|
||||
g.Meta `path:"/getApplication" method:"get" tags:"应用管理" summary:"获取应用详情" dc:"获取应用详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
}
|
||||
|
||||
// GetApplicationRes 获取应用详情响应
|
||||
type GetApplicationRes struct {
|
||||
*entity.Application
|
||||
}
|
||||
|
||||
// UpdateApplicationReq 更新应用请求
|
||||
type UpdateApplicationReq struct {
|
||||
g.Meta `path:"/updateApplication" method:"put" tags:"应用管理" summary:"更新应用" dc:"更新应用信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
Name string `json:"name" dc:"应用名称"`
|
||||
AppCode string `json:"appCode" dc:"应用编码"`
|
||||
Type app.AppType `json:"type" dc:"应用类型"`
|
||||
Status app.AppStatus `json:"status,omitempty" dc:"应用状态"`
|
||||
Description string `json:"description" dc:"应用描述"`
|
||||
AccessConfig map[string]interface{} `json:"accessConfig" dc:"接入配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
CallbackConfig map[string]interface{} `json:"callbackConfig" dc:"回调配置"`
|
||||
}
|
||||
|
||||
// DeleteApplicationReq 删除应用请求
|
||||
type DeleteApplicationReq struct {
|
||||
g.Meta `path:"/deleteApplication" method:"delete" tags:"应用管理" summary:"删除应用" dc:"删除应用"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
}
|
||||
|
||||
// UpdateApplicationStatusReq 更新应用状态请求
|
||||
type UpdateApplicationStatusReq struct {
|
||||
g.Meta `path:"/updateApplicationStatus" method:"put" tags:"应用管理" summary:"更新应用状态" dc:"更新应用状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
Status app.AppStatus `json:"status" v:"required|in:active,inactive" dc:"状态:active启用/inactive停用"`
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateApplicationReq 创建应用请求
|
||||
type CreateApplicationReq struct {
|
||||
g.Meta `path:"/createApplication" method:"post" summary:"创建应用"`
|
||||
|
||||
TenantID interface{} `json:"tenantId" v:"required#租户ID不能为空"`
|
||||
Name string `json:"name" v:"required#应用名称不能为空"`
|
||||
Code string `json:"code" v:"required#应用编码不能为空"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform" v:"required#平台不能为空|in:web,h5,android,ios#平台类型错误"`
|
||||
PackageName string `json:"packageName"`
|
||||
AppStoreURL string `json:"appStoreUrl"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
CallbackURL string `json:"callbackUrl"`
|
||||
}
|
||||
|
||||
// CreateApplicationRes 创建应用响应
|
||||
type CreateApplicationRes struct {
|
||||
ID int64 `json:"id"`
|
||||
AppKey string `json:"appKey"`
|
||||
AppSecret string `json:"appSecret"`
|
||||
}
|
||||
|
||||
// UpdateApplicationReq 更新应用请求
|
||||
type UpdateApplicationReq struct {
|
||||
g.Meta `path:"/updateApplication" method:"put" summary:"更新应用"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform" v:"in:web,h5,android,ios#平台类型错误"`
|
||||
PackageName string `json:"packageName"`
|
||||
AppStoreURL string `json:"appStoreUrl"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
CallbackURL string `json:"callbackUrl"`
|
||||
}
|
||||
|
||||
// UpdateApplicationRes 更新应用响应
|
||||
type UpdateApplicationRes struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// GetApplicationReq 获取应用请求
|
||||
type GetApplicationReq struct {
|
||||
g.Meta `path:"/getApplication" method:"get" summary:"获取应用信息"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
}
|
||||
|
||||
// GetApplicationRes 获取应用响应
|
||||
type GetApplicationRes struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID interface{} `json:"tenantId"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform"`
|
||||
PackageName string `json:"packageName"`
|
||||
AppStoreURL string `json:"appStoreUrl"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
Status string `json:"status"`
|
||||
AppKey string `json:"appKey"`
|
||||
CallbackURL string `json:"callbackUrl"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListApplicationsReq 获取应用列表请求
|
||||
type ListApplicationsReq struct {
|
||||
g.Meta `path:"/listApplications" method:"get" summary:"获取应用列表"`
|
||||
|
||||
TenantID int64 `json:"tenantId" v:"required#租户ID不能为空"`
|
||||
Platform string `json:"platform"`
|
||||
Status string `json:"status"`
|
||||
Page int `json:"page" d:"1"`
|
||||
Size int `json:"size" d:"20"`
|
||||
}
|
||||
|
||||
// ListApplicationsRes 获取应用列表响应
|
||||
type ListApplicationsRes struct {
|
||||
List []ApplicationItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
Page int `json:"page"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
// ApplicationItem 应用列表项
|
||||
type ApplicationItem struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform"`
|
||||
PackageName string `json:"packageName"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
Status string `json:"status"`
|
||||
DailyRequests int64 `json:"dailyRequests"`
|
||||
MonthlyRequests int64 `json:"monthlyRequests"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
}
|
||||
|
||||
// ResetAPIKeysReq 重置API密钥请求
|
||||
type ResetAPIKeysReq struct {
|
||||
g.Meta `path:"/resetAPIKeys" method:"post" summary:"重置API密钥"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
}
|
||||
|
||||
// ResetAPIKeysRes 重置API密钥响应
|
||||
type ResetAPIKeysRes struct {
|
||||
AppKey string `json:"appKey"`
|
||||
AppSecret string `json:"appSecret"`
|
||||
}
|
||||
|
||||
// ValidateApplicationReq 验证应用请求
|
||||
type ValidateApplicationReq struct {
|
||||
g.Meta `path:"/validateApplication" method:"post" summary:"验证应用权限"`
|
||||
|
||||
AppKey string `json:"appKey" v:"required#应用密钥不能为空"`
|
||||
AppSecret string `json:"appSecret" v:"required#应用密钥不能为空"`
|
||||
}
|
||||
|
||||
// ValidateApplicationRes 验证应用响应
|
||||
type ValidateApplicationRes struct {
|
||||
Valid bool `json:"valid"`
|
||||
AppID int64 `json:"appId"`
|
||||
AppName string `json:"appName"`
|
||||
TenantID int64 `json:"tenantId"`
|
||||
TenantName string `json:"tenantName"`
|
||||
Platform string `json:"platform"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
}
|
||||
|
||||
// DeleteApplicationReq 删除应用请求
|
||||
type DeleteApplicationReq struct {
|
||||
g.Meta `path:"/deleteApplication" method:"delete" summary:"删除应用"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
}
|
||||
|
||||
// DeleteApplicationRes 删除应用响应
|
||||
type DeleteApplicationRes struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
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 interface{} `json:"tenant_id"` // 租户ID
|
||||
TenantName string `json:"tenant_name"` // 租户名称
|
||||
GeneratedAt string `json:"generated_at"` // 生成时间
|
||||
}
|
||||
|
||||
// CIDRequestHistory CID请求历史记录
|
||||
type CIDRequestHistory struct {
|
||||
Id int64 `json:"id"` // 记录ID
|
||||
TenantId interface{} `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"` // 每页数量
|
||||
}
|
||||
|
||||
// TenantInfo 租户信息
|
||||
type TenantInfo struct {
|
||||
Id string `json:"id"` // 租户ID
|
||||
Name string `json:"name"` // 租户名称
|
||||
Level string `json:"level"` // 租户级别
|
||||
}
|
||||
102
model/dto/data/api_interface_dto.go
Normal file
102
model/dto/data/api_interface_dto.go
Normal file
@@ -0,0 +1,102 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"cid/consts/data"
|
||||
entity "cid/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateApiInterfaceReq 创建接口请求
|
||||
type CreateApiInterfaceReq struct {
|
||||
g.Meta `path:"/createApiInterface" method:"post" tags:"接口管理" summary:"创建接口" dc:"创建新的数据接口"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"所属平台ID"`
|
||||
Name string `json:"name" v:"required" dc:"接口名称"`
|
||||
Code string `json:"code" v:"required" dc:"接口编码"`
|
||||
Url string `json:"url" v:"required" dc:"接口地址"`
|
||||
Method data.ApiMethod `json:"method" v:"required" dc:"请求方法"`
|
||||
Status data.PlatformStatus `json:"status" dc:"接口状态" d:"active"`
|
||||
AuthType string `json:"authType" dc:"认证类型"`
|
||||
RequestConfig map[string]interface{} `json:"requestConfig" dc:"请求配置"`
|
||||
ResponseConfig map[string]interface{} `json:"responseConfig" dc:"响应配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"接口独立限流配置"`
|
||||
}
|
||||
|
||||
// CreateApiInterfaceRes 创建接口响应
|
||||
type CreateApiInterfaceRes struct {
|
||||
Id int64 `json:"id" dc:"接口ID"`
|
||||
}
|
||||
|
||||
// ListApiInterfaceReq 获取接口列表请求
|
||||
type ListApiInterfaceReq struct {
|
||||
g.Meta `path:"/listApiInterfaces" method:"get" tags:"接口管理" summary:"获取接口列表" dc:"分页查询接口列表"`
|
||||
*beans.Page
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
Name string `json:"name" dc:"接口名称"`
|
||||
Code string `json:"code" dc:"接口编码"`
|
||||
Method data.ApiMethod `json:"method" dc:"请求方法"`
|
||||
Status data.PlatformStatus `json:"status" dc:"接口状态"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索名称或编码)"`
|
||||
}
|
||||
|
||||
// ListApiInterfaceRes 获取接口列表响应
|
||||
type ListApiInterfaceRes struct {
|
||||
List []ApiInterfaceItem `json:"list" dc:"接口列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type ApiInterfaceItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
PlatformId int64 `json:"platformId"`
|
||||
PlatformName string `json:"platformName"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Url string `json:"url"`
|
||||
Method data.ApiMethod `json:"method"`
|
||||
Status data.PlatformStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetApiInterfaceReq 获取接口详情请求
|
||||
type GetApiInterfaceReq struct {
|
||||
g.Meta `path:"/getApiInterface" method:"get" tags:"接口管理" summary:"获取接口详情" dc:"获取接口详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
}
|
||||
|
||||
// GetApiInterfaceRes 获取接口详情响应
|
||||
type GetApiInterfaceRes struct {
|
||||
*entity.ApiInterface
|
||||
PlatformName string `json:"platformName,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateApiInterfaceReq 更新接口请求
|
||||
type UpdateApiInterfaceReq struct {
|
||||
g.Meta `path:"/updateApiInterface" method:"put" tags:"接口管理" summary:"更新接口" dc:"更新接口信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
PlatformId int64 `json:"platformId" dc:"所属平台ID"`
|
||||
Name string `json:"name" dc:"接口名称"`
|
||||
Code string `json:"code" dc:"接口编码"`
|
||||
Url string `json:"url" dc:"接口地址"`
|
||||
Method data.ApiMethod `json:"method" dc:"请求方法"`
|
||||
Status data.PlatformStatus `json:"status,omitempty" dc:"接口状态"`
|
||||
AuthType string `json:"authType" dc:"认证类型"`
|
||||
RequestConfig map[string]interface{} `json:"requestConfig" dc:"请求配置"`
|
||||
ResponseConfig map[string]interface{} `json:"responseConfig" dc:"响应配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"接口独立限流配置"`
|
||||
}
|
||||
|
||||
// DeleteApiInterfaceReq 删除接口请求
|
||||
type DeleteApiInterfaceReq struct {
|
||||
g.Meta `path:"/deleteApiInterface" method:"delete" tags:"接口管理" summary:"删除接口" dc:"删除接口"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
}
|
||||
|
||||
// UpdateApiInterfaceStatusReq 更新接口状态请求
|
||||
type UpdateApiInterfaceStatusReq struct {
|
||||
g.Meta `path:"/updateApiInterfaceStatus" method:"put" tags:"接口管理" summary:"更新接口状态" dc:"更新接口状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
Status data.PlatformStatus `json:"status" v:"required|in:active,inactive" dc:"状态:active启用/inactive停用"`
|
||||
}
|
||||
99
model/dto/data/data_fetch_dto.go
Normal file
99
model/dto/data/data_fetch_dto.go
Normal file
@@ -0,0 +1,99 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"cid/consts/data"
|
||||
entity "cid/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ExecuteDataFetchReq 执行数据获取请求
|
||||
type ExecuteDataFetchReq struct {
|
||||
g.Meta `path:"/executeDataFetch" method:"post" tags:"数据获取" summary:"执行数据获取" dc:"执行接口数据获取"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
RequestParams map[string]interface{} `json:"requestParams" dc:"请求参数"`
|
||||
}
|
||||
|
||||
// ExecuteDataFetchRes 执行数据获取响应
|
||||
type ExecuteDataFetchRes struct {
|
||||
RequestId string `json:"requestId" dc:"请求ID"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
Message string `json:"message" dc:"消息"`
|
||||
}
|
||||
|
||||
// ListDataFetchLogReq 获取数据获取日志列表请求
|
||||
type ListDataFetchLogReq struct {
|
||||
g.Meta `path:"/listDataFetchLogs" method:"get" tags:"数据获取" summary:"获取数据获取日志" dc:"分页查询数据获取日志"`
|
||||
*beans.Page
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" dc:"接口ID"`
|
||||
RequestId string `json:"requestId" dc:"请求ID"`
|
||||
Status data.FetchStatus `json:"status" dc:"执行状态"`
|
||||
StartTime int64 `json:"startTime" dc:"开始时间(时间戳)"`
|
||||
EndTime int64 `json:"endTime" dc:"结束时间(时间戳)"`
|
||||
}
|
||||
|
||||
// ListDataFetchLogRes 获取数据获取日志列表响应
|
||||
type ListDataFetchLogRes struct {
|
||||
List []DataFetchLogItem `json:"list" dc:"日志列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type DataFetchLogItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
PlatformId int64 `json:"platformId"`
|
||||
PlatformName string `json:"platformName"`
|
||||
InterfaceId int64 `json:"interfaceId"`
|
||||
InterfaceName string `json:"interfaceName"`
|
||||
RequestId string `json:"requestId"`
|
||||
Status data.FetchStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
StartTime int64 `json:"startTime"`
|
||||
EndTime int64 `json:"endTime"`
|
||||
Duration int `json:"duration"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
RetryCount int `json:"retryCount"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
}
|
||||
|
||||
// GetDataFetchLogReq 获取数据获取日志详情请求
|
||||
type GetDataFetchLogReq struct {
|
||||
g.Meta `path:"/getDataFetchLog" method:"get" tags:"数据获取" summary:"获取数据获取日志详情" dc:"获取数据获取日志详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"日志ID"`
|
||||
}
|
||||
|
||||
// GetDataFetchLogRes 获取数据获取日志详情响应
|
||||
type GetDataFetchLogRes struct {
|
||||
*entity.DataFetchLog
|
||||
PlatformName string `json:"platformName,omitempty"`
|
||||
InterfaceName string `json:"interfaceName,omitempty"`
|
||||
}
|
||||
|
||||
// BatchExecuteDataFetchReq 批量执行数据获取请求
|
||||
type BatchExecuteDataFetchReq struct {
|
||||
g.Meta `path:"/batchExecuteDataFetch" method:"post" tags:"数据获取" summary:"批量执行数据获取" dc:"批量执行接口数据获取"`
|
||||
InterfaceIds []int64 `json:"interfaceIds" v:"required" dc:"接口ID列表"`
|
||||
RequestParams map[string]interface{} `json:"requestParams" dc:"请求参数(所有接口共用)"`
|
||||
}
|
||||
|
||||
// BatchExecuteDataFetchRes 批量执行数据获取响应
|
||||
type BatchExecuteDataFetchRes struct {
|
||||
SuccessCount int `json:"successCount" dc:"成功数量"`
|
||||
FailedCount int `json:"failedCount" dc:"失败数量"`
|
||||
RequestIds []string `json:"requestIds" dc:"请求ID列表"`
|
||||
}
|
||||
|
||||
// ReExecuteDataFetchReq 重新执行数据获取请求
|
||||
type ReExecuteDataFetchReq struct {
|
||||
g.Meta `path:"/reExecuteDataFetch" method:"post" tags:"数据获取" summary:"重新执行数据获取" dc:"重新执行失败的数据获取"`
|
||||
LogId int64 `json:"logId" v:"required" dc:"日志ID"`
|
||||
}
|
||||
|
||||
// ReExecuteDataFetchRes 重新执行数据获取响应
|
||||
type ReExecuteDataFetchRes struct {
|
||||
RequestId string `json:"requestId" dc:"请求ID"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
Message string `json:"message" dc:"消息"`
|
||||
}
|
||||
91
model/dto/data/platform_dto.go
Normal file
91
model/dto/data/platform_dto.go
Normal file
@@ -0,0 +1,91 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"cid/consts/data"
|
||||
entity "cid/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreatePlatformReq 创建平台请求
|
||||
type CreatePlatformReq struct {
|
||||
g.Meta `path:"/createPlatform" method:"post" tags:"平台管理" summary:"创建平台" dc:"创建新的数据源平台"`
|
||||
Name string `json:"name" v:"required" dc:"平台名称"`
|
||||
Type data.SyncPlatform `json:"type" v:"required" dc:"平台类型"`
|
||||
Status data.PlatformStatus `json:"status" dc:"平台状态" d:"active"`
|
||||
Description string `json:"description" dc:"平台描述"`
|
||||
AuthConfig map[string]interface{} `json:"authConfig" dc:"认证配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
PlatformConfig map[string]interface{} `json:"platformConfig" dc:"平台专用配置"`
|
||||
}
|
||||
|
||||
// CreatePlatformRes 创建平台响应
|
||||
type CreatePlatformRes struct {
|
||||
Id int64 `json:"id" dc:"平台ID"`
|
||||
}
|
||||
|
||||
// ListPlatformReq 获取平台列表请求
|
||||
type ListPlatformReq struct {
|
||||
g.Meta `path:"/listPlatforms" method:"get" tags:"平台管理" summary:"获取平台列表" dc:"分页查询平台列表"`
|
||||
*beans.Page
|
||||
Name string `json:"name" dc:"平台名称"`
|
||||
Type data.SyncPlatform `json:"type" dc:"平台类型"`
|
||||
Status data.PlatformStatus `json:"status" dc:"平台状态"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索平台名称)"`
|
||||
}
|
||||
|
||||
// ListPlatformRes 获取平台列表响应
|
||||
type ListPlatformRes struct {
|
||||
List []PlatformItem `json:"list" dc:"平台列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type PlatformItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
Name string `json:"name"`
|
||||
Type data.SyncPlatform `json:"type"`
|
||||
TypeName string `json:"typeName"`
|
||||
Status data.PlatformStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
Description string `json:"description"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetPlatformReq 获取平台详情请求
|
||||
type GetPlatformReq struct {
|
||||
g.Meta `path:"/getPlatform" method:"get" tags:"平台管理" summary:"获取平台详情" dc:"获取平台详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
}
|
||||
|
||||
// GetPlatformRes 获取平台详情响应
|
||||
type GetPlatformRes struct {
|
||||
*entity.Platform
|
||||
}
|
||||
|
||||
// UpdatePlatformReq 更新平台请求
|
||||
type UpdatePlatformReq struct {
|
||||
g.Meta `path:"/updatePlatform" method:"put" tags:"平台管理" summary:"更新平台" dc:"更新平台信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
Name string `json:"name" dc:"平台名称"`
|
||||
Type data.SyncPlatform `json:"type" dc:"平台类型"`
|
||||
Status data.PlatformStatus `json:"status,omitempty" dc:"平台状态"`
|
||||
Description string `json:"description" dc:"平台描述"`
|
||||
AuthConfig map[string]interface{} `json:"authConfig" dc:"认证配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
PlatformConfig map[string]interface{} `json:"platformConfig" dc:"平台专用配置"`
|
||||
}
|
||||
|
||||
// DeletePlatformReq 删除平台请求
|
||||
type DeletePlatformReq struct {
|
||||
g.Meta `path:"/deletePlatform" method:"delete" tags:"平台管理" summary:"删除平台" dc:"删除平台"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
}
|
||||
|
||||
// UpdatePlatformStatusReq 更新平台状态请求
|
||||
type UpdatePlatformStatusReq struct {
|
||||
g.Meta `path:"/updatePlatformStatus" method:"put" tags:"平台管理" summary:"更新平台状态" dc:"更新平台状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
Status data.PlatformStatus `json:"status" v:"required|in:active,inactive" dc:"状态:active启用/inactive停用"`
|
||||
}
|
||||
125
model/dto/mapping/data_mapping_dto.go
Normal file
125
model/dto/mapping/data_mapping_dto.go
Normal file
@@ -0,0 +1,125 @@
|
||||
package mapping
|
||||
|
||||
import (
|
||||
"cid/consts/mapping"
|
||||
entity "cid/model/entity/mapping"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateDataMappingReq 创建数据映射请求
|
||||
type CreateDataMappingReq struct {
|
||||
g.Meta `path:"/createDataMapping" method:"post" tags:"数据映射" summary:"创建数据映射" dc:"创建数据映射规则"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
SourceField string `json:"sourceField" v:"required" dc:"源字段"`
|
||||
TargetField string `json:"targetField" v:"required" dc:"目标字段"`
|
||||
FieldType string `json:"fieldType" v:"required" dc:"字段类型"`
|
||||
DefaultValue string `json:"defaultValue" dc:"默认值"`
|
||||
TransformRule map[string]interface{} `json:"transformRule" dc:"转换规则"`
|
||||
Priority int `json:"priority" dc:"优先级" d:"0"`
|
||||
Status mapping.MappingStatus `json:"status" dc:"状态" d:"active"`
|
||||
}
|
||||
|
||||
// CreateDataMappingRes 创建数据映射响应
|
||||
type CreateDataMappingRes struct {
|
||||
Id int64 `json:"id" dc:"映射ID"`
|
||||
}
|
||||
|
||||
// ListDataMappingReq 获取数据映射列表请求
|
||||
type ListDataMappingReq struct {
|
||||
g.Meta `path:"/listDataMappings" method:"get" tags:"数据映射" summary:"获取数据映射列表" dc:"分页查询数据映射列表"`
|
||||
*beans.Page
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" dc:"接口ID"`
|
||||
SourceField string `json:"sourceField" dc:"源字段"`
|
||||
TargetField string `json:"targetField" dc:"目标字段"`
|
||||
Status mapping.MappingStatus `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// ListDataMappingRes 获取数据映射列表响应
|
||||
type ListDataMappingRes struct {
|
||||
List []DataMappingItem `json:"list" dc:"映射列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type DataMappingItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
PlatformId int64 `json:"platformId"`
|
||||
PlatformName string `json:"platformName"`
|
||||
InterfaceId int64 `json:"interfaceId"`
|
||||
InterfaceName string `json:"interfaceName"`
|
||||
SourceField string `json:"sourceField"`
|
||||
TargetField string `json:"targetField"`
|
||||
FieldType string `json:"fieldType"`
|
||||
DefaultValue string `json:"defaultValue"`
|
||||
TransformRule map[string]interface{} `json:"transformRule"`
|
||||
Priority int `json:"priority"`
|
||||
Status mapping.MappingStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetDataMappingReq 获取数据映射详情请求
|
||||
type GetDataMappingReq struct {
|
||||
g.Meta `path:"/getDataMapping" method:"get" tags:"数据映射" summary:"获取数据映射详情" dc:"获取数据映射详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"映射ID"`
|
||||
}
|
||||
|
||||
// GetDataMappingRes 获取数据映射详情响应
|
||||
type GetDataMappingRes struct {
|
||||
*entity.DataMapping
|
||||
PlatformName string `json:"platformName,omitempty"`
|
||||
InterfaceName string `json:"interfaceName,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateDataMappingReq 更新数据映射请求
|
||||
type UpdateDataMappingReq struct {
|
||||
g.Meta `path:"/updateDataMapping" method:"put" tags:"数据映射" summary:"更新数据映射" dc:"更新数据映射规则"`
|
||||
Id int64 `json:"id" v:"required" dc:"映射ID"`
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" dc:"接口ID"`
|
||||
SourceField string `json:"sourceField" dc:"源字段"`
|
||||
TargetField string `json:"targetField" dc:"目标字段"`
|
||||
FieldType string `json:"fieldType" dc:"字段类型"`
|
||||
DefaultValue string `json:"defaultValue" dc:"默认值"`
|
||||
TransformRule map[string]interface{} `json:"transformRule" dc:"转换规则"`
|
||||
Priority int `json:"priority" dc:"优先级"`
|
||||
Status mapping.MappingStatus `json:"status,omitempty" dc:"状态"`
|
||||
}
|
||||
|
||||
// DeleteDataMappingReq 删除数据映射请求
|
||||
type DeleteDataMappingReq struct {
|
||||
g.Meta `path:"/deleteDataMapping" method:"delete" tags:"数据映射" summary:"删除数据映射" dc:"删除数据映射"`
|
||||
Id int64 `json:"id" v:"required" dc:"映射ID"`
|
||||
}
|
||||
|
||||
// BatchCreateDataMappingReq 批量创建数据映射请求
|
||||
type BatchCreateDataMappingReq struct {
|
||||
g.Meta `path:"/batchCreateDataMappings" method:"post" tags:"数据映射" summary:"批量创建数据映射" dc:"批量创建数据映射规则"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
Mappings []CreateDataMappingReq `json:"mappings" v:"required" dc:"映射规则列表"`
|
||||
}
|
||||
|
||||
// BatchCreateDataMappingRes 批量创建数据映射响应
|
||||
type BatchCreateDataMappingRes struct {
|
||||
SuccessCount int `json:"successCount" dc:"成功数量"`
|
||||
FailedCount int `json:"failedCount" dc:"失败数量"`
|
||||
Ids []int64 `json:"ids" dc:"映射ID列表"`
|
||||
}
|
||||
|
||||
// ExecuteDataMappingReq 执行数据映射请求
|
||||
type ExecuteDataMappingReq struct {
|
||||
g.Meta `path:"/executeDataMapping" method:"post" tags:"数据映射" summary:"执行数据映射" dc:"执行数据字段映射"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
SourceData map[string]interface{} `json:"sourceData" v:"required" dc:"源数据"`
|
||||
}
|
||||
|
||||
// ExecuteDataMappingRes 执行数据映射响应
|
||||
type ExecuteDataMappingRes struct {
|
||||
TargetData map[string]interface{} `json:"targetData" dc:"目标数据"`
|
||||
AppliedRules []string `json:"appliedRules" dc:"应用的映射规则"`
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SetTenantRateLimitReq 设置租户限流配置请求
|
||||
type SetTenantRateLimitReq struct {
|
||||
g.Meta `path:"/setTenantRateLimit" method:"post" tags:"租户限流" summary:"设置租户限流配置" dc:"设置指定租户的请求次数限制配置(实际使用全局配置)"`
|
||||
|
||||
TenantID int64 `json:"tenant_id" v:"required"` // 租户ID(仅用于记录,实际使用全局配置)
|
||||
RequestsPerSecond float64 `json:"requests_per_second" v:"required"` // 每秒请求数
|
||||
Burst int `json:"burst" v:"required"` // 突发请求数
|
||||
WindowSeconds int `json:"window_seconds" v:"required"` // 时间窗口(秒)
|
||||
}
|
||||
|
||||
// SetTenantRateLimitRes 设置租户限流配置响应
|
||||
type SetTenantRateLimitRes struct {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// GetTenantRateLimitUsageReq 获取租户限流使用情况请求
|
||||
type GetTenantRateLimitUsageReq struct {
|
||||
g.Meta `path:"/getTenantRateLimitUsage" method:"get" tags:"租户限流" summary:"获取租户限流使用情况" dc:"获取指定租户的请求次数使用情况"`
|
||||
|
||||
TenantID int64 `json:"tenant_id" v:"required"` // 租户ID
|
||||
}
|
||||
|
||||
// GetTenantRateLimitUsageRes 获取租户限流使用情况响应
|
||||
type GetTenantRateLimitUsageRes struct {
|
||||
TenantID int64 `json:"tenant_id"` // 租户ID
|
||||
CurrentUsed int64 `json:"current_used"` // 当前已使用请求数
|
||||
MaxAllowed int64 `json:"max_allowed"` // 最大允许请求数(基于全局配置)
|
||||
UsagePercent float64 `json:"usage_percent"` // 使用率百分比
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateStrategyReq 创建策略请求
|
||||
type CreateStrategyReq struct {
|
||||
g.Meta `path:"/create" method:"post" tags:"策略管理" summary:"创建匹配策略" dc:"创建新的广告匹配策略"`
|
||||
Name string `json:"name" v:"required|length:3,50"` // 策略名称
|
||||
Description string `json:"description" v:"max:500"` // 描述
|
||||
TenantLevel string `json:"tenant_level" v:"required|in:basic,standard,premium"` // 租户级别
|
||||
MinConversion float64 `json:"min_conversion" v:"required|min:0|max:1"` // 最低转化率
|
||||
MaxConversion float64 `json:"max_conversion" v:"required|min:0|max:1"` // 最高转化率
|
||||
SourceWeights map[string]int `json:"source_weights" v:"required"` // 广告源权重
|
||||
MaxAdsPerReq int `json:"max_ads_per_req" v:"required|min:1|max:50"` // 每次请求最大广告数
|
||||
MaxReqPerHour int `json:"max_req_per_hour" v:"required|min:1"` // 每小时最大请求次数
|
||||
Priority int `json:"priority" v:"required|min:0|max:100"` // 优先级
|
||||
Status string `json:"status" v:"required|in:active,inactive"` // 状态
|
||||
}
|
||||
|
||||
// UpdateStrategyReq 更新策略请求
|
||||
type UpdateStrategyReq struct {
|
||||
g.Meta `path:"/update" method:"put" tags:"策略管理" summary:"更新匹配策略" dc:"更新现有的广告匹配策略"`
|
||||
Id int64 `json:"id" v:"required"` // 策略ID
|
||||
Name string `json:"name" v:"required|length:3,50"` // 策略名称
|
||||
Description string `json:"description" v:"max:500"` // 描述
|
||||
TenantLevel string `json:"tenant_level" v:"required|in:basic,standard,premium"` // 租户级别
|
||||
MinConversion float64 `json:"min_conversion" v:"required|min:0|max:1"` // 最低转化率
|
||||
MaxConversion float64 `json:"max_conversion" v:"required|min:0|max:1"` // 最高转化率
|
||||
SourceWeights map[string]int `json:"source_weights" v:"required"` // 广告源权重
|
||||
MaxAdsPerReq int `json:"max_ads_per_req" v:"required|min:1|max:50"` // 每次请求最大广告数
|
||||
MaxReqPerHour int `json:"max_req_per_hour" v:"required|min:1"` // 每小时最大请求次数
|
||||
Priority int `json:"priority" v:"required|min:0|max:100"` // 优先级
|
||||
Status string `json:"status" v:"required|in:active,inactive"` // 状态
|
||||
}
|
||||
|
||||
// DeleteStrategyReq 删除策略请求
|
||||
type DeleteStrategyReq struct {
|
||||
g.Meta `path:"/delete" method:"delete" tags:"策略管理" summary:"删除匹配策略" dc:"删除指定的广告匹配策略"`
|
||||
Id int64 `json:"id" v:"required"` // 策略ID
|
||||
}
|
||||
|
||||
// GetStrategyReq 获取策略请求
|
||||
type GetStrategyReq struct {
|
||||
g.Meta `path:"/getByID" method:"get" tags:"策略管理" summary:"获取策略详情" dc:"获取指定策略的详细信息"`
|
||||
Id int64 `json:"id" v:"required"` // 策略ID
|
||||
}
|
||||
|
||||
// GetStrategyListReq 获取策略列表请求
|
||||
type GetStrategyListReq struct {
|
||||
g.Meta `path:"/getList" method:"get" tags:"策略管理" summary:"获取策略列表" dc:"分页获取策略列表"`
|
||||
Page int `json:"page" v:"required|min:1"` // 页码
|
||||
Size int `json:"size" v:"required|min:1|max:100"` // 每页数量
|
||||
TenantLevel string `json:"tenant_level"` // 租户级别筛选
|
||||
Status string `json:"status"` // 状态筛选
|
||||
}
|
||||
|
||||
// StrategyRes 策略响应
|
||||
type StrategyRes struct {
|
||||
Id int64 `json:"id"` // ID
|
||||
Name string `json:"name"` // 策略名称
|
||||
Description string `json:"description"` // 描述
|
||||
TenantLevel string `json:"tenant_level"` // 租户级别
|
||||
MinConversion float64 `json:"min_conversion"` // 最低转化率
|
||||
MaxConversion float64 `json:"max_conversion"` // 最高转化率
|
||||
SourceWeights map[string]int `json:"source_weights"` // 广告源权重
|
||||
MaxAdsPerReq int `json:"max_ads_per_req"` // 每次请求最大广告数
|
||||
MaxReqPerHour int `json:"max_req_per_hour"` // 每小时最大请求次数
|
||||
Priority int `json:"priority"` // 优先级
|
||||
Status string `json:"status"` // 状态
|
||||
CreatedAt string `json:"created_at"` // 创建时间
|
||||
UpdatedAt string `json:"updated_at"` // 更新时间
|
||||
CreatedBy int64 `json:"created_by"` // 创建人
|
||||
UpdatedBy int64 `json:"updated_by"` // 更新人
|
||||
}
|
||||
|
||||
// GetStrategyListRes 获取策略列表响应
|
||||
type GetStrategyListRes struct {
|
||||
List []*StrategyRes `json:"list"` // 策略列表
|
||||
Total int64 `json:"total"` // 总数
|
||||
Page int `json:"page"` // 当前页
|
||||
Size int `json:"size"` // 每页数量
|
||||
}
|
||||
|
||||
// DeleteStrategyRes 删除策略响应
|
||||
type DeleteStrategyRes struct {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
Reference in New Issue
Block a user