初始化项目
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cidService/model/entity"
|
||||
"cidservice/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AddAdPositionReq 添加广告位请求
|
||||
type AddAdPositionReq struct {
|
||||
g.Meta `path:"/adposition/add" method:"post" tags:"广告位管理" summary:"添加广告位" dc:"添加新的广告位"`
|
||||
g.Meta `path:"/add" method:"post" tags:"广告位管理" summary:"添加广告位" dc:"添加新的广告位"`
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name" v:"required"` // 广告位名称
|
||||
@@ -51,7 +51,7 @@ type AddAdPositionRes struct {
|
||||
|
||||
// UpdateAdPositionReq 更新广告位请求
|
||||
type UpdateAdPositionReq struct {
|
||||
g.Meta `path:"/adposition/update" method:"post" tags:"广告位管理" summary:"更新广告位" dc:"更新广告位信息"`
|
||||
g.Meta `path:"/update" method:"put" tags:"广告位管理" summary:"更新广告位" dc:"更新广告位信息"`
|
||||
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
|
||||
@@ -91,7 +91,7 @@ type UpdateAdPositionReq struct {
|
||||
|
||||
// GetAdPositionReq 获取广告位详情请求
|
||||
type GetAdPositionReq struct {
|
||||
g.Meta `path:"/adposition/one" method:"get" tags:"广告位管理" summary:"获取广告位详情" dc:"根据ID获取单个广告位详情"`
|
||||
g.Meta `path:"/one" method:"get" tags:"广告位管理" summary:"获取广告位详情" dc:"根据ID获取单个广告位详情"`
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ type GetAdPositionRes struct {
|
||||
|
||||
// ListAdPositionReq 获取广告位列表请求
|
||||
type ListAdPositionReq struct {
|
||||
g.Meta `path:"/adposition/list" method:"get" tags:"广告位管理" summary:"获取广告位列表" dc:"分页查询广告位列表,支持多条件筛选"`
|
||||
g.Meta `path:"/list" method:"get" tags:"广告位管理" summary:"获取广告位列表" dc:"分页查询广告位列表,支持多条件筛选"`
|
||||
http.Page
|
||||
|
||||
Name string `json:"name"` // 广告位名称模糊查询
|
||||
@@ -120,7 +120,7 @@ type ListAdPositionRes struct {
|
||||
|
||||
// UpdateAdPositionStatusReq 更新广告位状态请求
|
||||
type UpdateAdPositionStatusReq struct {
|
||||
g.Meta `path:"/adposition/status" method:"post" tags:"广告位管理" summary:"更新广告位状态" dc:"更新广告位状态"`
|
||||
g.Meta `path:"/updateStatus" method:"patch" tags:"广告位管理" summary:"更新广告位状态" dc:"更新广告位状态"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告位ID
|
||||
Status string `json:"status" v:"required"` // 广告位状态:启用、禁用、测试
|
||||
@@ -128,7 +128,7 @@ type UpdateAdPositionStatusReq struct {
|
||||
|
||||
// GetAdPositionStatisticsReq 获取广告位统计数据请求
|
||||
type GetAdPositionStatisticsReq struct {
|
||||
g.Meta `path:"/adposition/statistics" method:"get" tags:"广告位管理" summary:"获取广告位统计数据" dc:"获取广告位的统计数据"`
|
||||
g.Meta `path:"getStatisticsAdPosition" method:"get" tags:"广告位管理" summary:"获取广告位统计数据" dc:"获取广告位的统计数据"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告位ID
|
||||
StatType string `json:"statType" v:"required"` // 统计类型:天、周、月
|
||||
@@ -143,7 +143,7 @@ type GetAdPositionStatisticsRes struct {
|
||||
|
||||
// GetAvailableAdPositionsReq 获取可用广告位请求
|
||||
type GetAvailableAdPositionsReq struct {
|
||||
g.Meta `path:"/adposition/available" method:"get" tags:"广告位管理" summary:"获取可用广告位列表" dc:"获取所有启用的广告位列表"`
|
||||
g.Meta `path:"getAvailableAdPositions" method:"get" tags:"广告位管理" summary:"获取可用广告位列表" dc:"获取所有启用的广告位列表"`
|
||||
}
|
||||
|
||||
type GetAvailableAdPositionsRes struct {
|
||||
@@ -152,7 +152,7 @@ type GetAvailableAdPositionsRes struct {
|
||||
|
||||
// MatchAdReq 匹配广告请求
|
||||
type MatchAdReq struct {
|
||||
g.Meta `path:"/adposition/match" method:"post" tags:"广告位管理" summary:"匹配广告" dc:"根据广告位编码和用户信息匹配适合的广告"`
|
||||
g.Meta `path:"matchAdAdPosition" method:"post" tags:"广告位管理" summary:"匹配广告" dc:"根据广告位编码和用户信息匹配适合的广告"`
|
||||
|
||||
PositionCode string `json:"positionCode" v:"required"` // 广告位编码
|
||||
UserInfo map[string]interface{} `json:"userInfo"` // 用户信息
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cidService/model/entity"
|
||||
"cidservice/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// CreateAdSourceReq 创建广告源请求
|
||||
type CreateAdSourceReq struct {
|
||||
g.Meta `path:"/adsource/create" method:"post" tags:"广告源管理" summary:"创建广告源" dc:"创建新的广告源配置"`
|
||||
g.Meta `path:"createAdSource" method:"post" tags:"广告源管理" summary:"创建广告源" dc:"创建新的广告源配置"`
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name" v:"required"` // 广告源名称
|
||||
@@ -69,7 +69,7 @@ type CreateAdSourceRes struct {
|
||||
|
||||
// GetAdSourceReq 获取广告源详情请求
|
||||
type GetAdSourceReq struct {
|
||||
g.Meta `path:"/adsource/one" method:"get" tags:"广告源管理" summary:"获取广告源详情" dc:"根据ID获取单个广告源详情"`
|
||||
g.Meta `path:"getByIDAdSource" method:"get" tags:"广告源管理" summary:"获取广告源详情" dc:"根据ID获取单个广告源详情"`
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ type GetAdSourceRes struct {
|
||||
|
||||
// ListAdSourceReq 获取广告源列表请求
|
||||
type ListAdSourceReq struct {
|
||||
g.Meta `path:"/adsource/list" method:"get" tags:"广告源管理" summary:"获取广告源列表" dc:"分页查询广告源列表,支持多条件筛选"`
|
||||
g.Meta `path:"getListAdSource" method:"get" tags:"广告源管理" summary:"获取广告源列表" dc:"分页查询广告源列表,支持多条件筛选"`
|
||||
http.Page
|
||||
|
||||
Name string `json:"name"` // 广告源名称模糊查询
|
||||
@@ -97,7 +97,7 @@ type ListAdSourceRes struct {
|
||||
|
||||
// UpdateAdSourceReq 更新广告源请求
|
||||
type UpdateAdSourceReq struct {
|
||||
g.Meta `path:"/adsource/update" method:"post" tags:"广告源管理" summary:"更新广告源" dc:"更新广告源信息"`
|
||||
g.Meta `path:"updateAdSource" method:"put" tags:"广告源管理" summary:"更新广告源" dc:"更新广告源信息"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
|
||||
@@ -152,7 +152,7 @@ type UpdateAdSourceReq struct {
|
||||
|
||||
// UpdateAdSourceStatusReq 更新广告源状态请求
|
||||
type UpdateAdSourceStatusReq struct {
|
||||
g.Meta `path:"/adsource/status" method:"post" tags:"广告源管理" summary:"更新广告源状态" dc:"更新广告源状态"`
|
||||
g.Meta `path:"/adsource" method:"patch" tags:"广告源管理" summary:"更新广告源状态" dc:"更新广告源状态"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
Status string `json:"status" v:"required"` // 广告源状态:active、inactive、maintenance
|
||||
@@ -160,14 +160,14 @@ type UpdateAdSourceStatusReq struct {
|
||||
|
||||
// DeleteAdSourceReq 删除广告源请求
|
||||
type DeleteAdSourceReq struct {
|
||||
g.Meta `path:"/adsource/delete" method:"post" tags:"广告源管理" summary:"删除广告源" dc:"删除指定的广告源"`
|
||||
g.Meta `path:"deleteAdSource" 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:"测试广告源的连接性和可用性"`
|
||||
g.Meta `path:"/adsource-test" method:"post" tags:"广告源管理" summary:"测试广告源连接" dc:"测试广告源的连接性和可用性"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
}
|
||||
@@ -195,7 +195,7 @@ type AdSourceTestMetrics struct {
|
||||
|
||||
// GetAdSourceStatisticsReq 获取广告源统计数据请求
|
||||
type GetAdSourceStatisticsReq struct {
|
||||
g.Meta `path:"/adsource/statistics" method:"get" tags:"广告源管理" summary:"获取广告源统计数据" dc:"获取广告源的详细统计数据"`
|
||||
g.Meta `path:"/adsource-statistics" method:"get" tags:"广告源管理" summary:"获取广告源统计数据" dc:"获取广告源的详细统计数据"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告源ID
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始日期
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cidService/model/entity"
|
||||
"cidservice/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// GetAdStatisticsReq 获取广告统计数据请求
|
||||
type GetAdStatisticsReq struct {
|
||||
g.Meta `path:"/statistics/list" method:"get" tags:"广告统计" summary:"获取广告统计数据" dc:"获取广告的统计数据"`
|
||||
g.Meta `path:"getStatisticsAdStatistics" method:"get" tags:"广告统计" summary:"获取广告统计数据" dc:"获取广告的统计数据"`
|
||||
|
||||
// 分页参数
|
||||
http.Page
|
||||
@@ -42,7 +42,7 @@ type GetAdStatisticsRes struct {
|
||||
|
||||
// GetDashboardReq 获取仪表盘数据请求
|
||||
type GetDashboardReq struct {
|
||||
g.Meta `path:"/dashboard" method:"get" tags:"广告仪表盘" summary:"获取仪表盘数据" dc:"获取广告系统的仪表盘统计数据"`
|
||||
g.Meta `path:"getDashboardAdStatistics" method:"get" tags:"广告仪表盘" summary:"获取仪表盘数据" dc:"获取广告系统的仪表盘统计数据"`
|
||||
|
||||
// 时间范围
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始日期
|
||||
@@ -103,7 +103,7 @@ type RankData struct {
|
||||
|
||||
// GenerateDailyStatisticsReq 生成每日统计数据请求
|
||||
type GenerateDailyStatisticsReq struct {
|
||||
g.Meta `path:"/statistics/generate-daily" method:"post" tags:"广告统计" summary:"生成每日统计数据" dc:"手动生成指定日期的广告统计数据"`
|
||||
g.Meta `path:"generateDailyStatisticsAdStatistics" method:"post" tags:"广告统计" summary:"生成每日统计数据" dc:"手动生成指定日期的广告统计数据"`
|
||||
|
||||
Date int64 `json:"date" v:"required"` // 日期时间戳
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cidService/model/entity"
|
||||
"cidservice/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AddAdvertisementReq 添加广告请求
|
||||
type AddAdvertisementReq struct {
|
||||
g.Meta `path:"/advertisement/add" method:"post" tags:"广告管理" summary:"添加广告" dc:"添加新的广告"`
|
||||
g.Meta `path:"addAdvertisement" method:"post" tags:"广告管理" summary:"添加广告" dc:"添加新的广告"`
|
||||
|
||||
// 广告基本信息
|
||||
Title string `json:"title" v:"required"` // 广告标题
|
||||
@@ -40,7 +40,7 @@ type AddAdvertisementRes struct {
|
||||
|
||||
// UpdateAdvertisementReq 更新广告请求
|
||||
type UpdateAdvertisementReq struct {
|
||||
g.Meta `path:"/advertisement/update" method:"post" tags:"广告管理" summary:"更新广告" dc:"更新广告信息"`
|
||||
g.Meta `path:"updateAdvertisement" method:"put" tags:"广告管理" summary:"更新广告" dc:"更新广告信息"`
|
||||
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
|
||||
@@ -74,7 +74,7 @@ type UpdateAdvertisementReq struct {
|
||||
|
||||
// GetAdvertisementReq 获取广告详情请求
|
||||
type GetAdvertisementReq struct {
|
||||
g.Meta `path:"/advertisement/one" method:"get" tags:"广告管理" summary:"获取广告详情" dc:"根据ID获取单个广告详情"`
|
||||
g.Meta `path:"getOneAdvertisement" method:"get" tags:"广告管理" summary:"获取广告详情" dc:"根据ID获取单个广告详情"`
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ type GetAdvertisementRes struct {
|
||||
|
||||
// ListAdvertisementReq 获取广告列表请求
|
||||
type ListAdvertisementReq struct {
|
||||
g.Meta `path:"/advertisement/list" method:"get" tags:"广告管理" summary:"获取广告列表" dc:"分页查询广告列表,支持多条件筛选"`
|
||||
g.Meta `path:"listAdvertisement" method:"get" tags:"广告管理" summary:"获取广告列表" dc:"分页查询广告列表,支持多条件筛选"`
|
||||
http.Page
|
||||
|
||||
AdvertiserId string `json:"advertiserId"` // 广告主ID
|
||||
@@ -103,7 +103,7 @@ type ListAdvertisementRes struct {
|
||||
|
||||
// AuditAdvertisementReq 审核广告请求
|
||||
type AuditAdvertisementReq struct {
|
||||
g.Meta `path:"/advertisement/audit" method:"post" tags:"广告管理" summary:"审核广告" dc:"审核广告,通过或拒绝"`
|
||||
g.Meta `path:"auditAdvertisement" method:"post" tags:"广告管理" summary:"审核广告" dc:"审核广告,通过或拒绝"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告ID
|
||||
AuditStatus string `json:"auditStatus" v:"required"` // 审核状态:通过、拒绝
|
||||
@@ -112,7 +112,7 @@ type AuditAdvertisementReq struct {
|
||||
|
||||
// UpdateAdStatusReq 更新广告状态请求
|
||||
type UpdateAdStatusReq struct {
|
||||
g.Meta `path:"/advertisement/status" method:"post" tags:"广告管理" summary:"更新广告状态" dc:"更新广告状态"`
|
||||
g.Meta `path:"updateStatusAdvertisement" method:"patch" tags:"广告管理" summary:"更新广告状态" dc:"更新广告状态"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告ID
|
||||
Status string `json:"status" v:"required"` // 广告状态:启用、禁用
|
||||
@@ -120,7 +120,7 @@ type UpdateAdStatusReq struct {
|
||||
|
||||
// GetAdStatisticsReq 获取广告统计数据请求
|
||||
type GetAdStatisticsForAdvertisementReq struct {
|
||||
g.Meta `path:"/advertisement/statistics" method:"get" tags:"广告管理" summary:"获取广告统计数据" dc:"获取广告的统计数据"`
|
||||
g.Meta `path:"getStatisticsAdvertisement" method:"get" tags:"广告管理" summary:"获取广告统计数据" dc:"获取广告的统计数据"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告ID
|
||||
StatType string `json:"statType" v:"required"` // 统计类型:天、周、月
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cidService/model/entity"
|
||||
"cidservice/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AddAdvertiserReq 添加广告主请求
|
||||
type AddAdvertiserReq struct {
|
||||
g.Meta `path:"/advertiser/add" method:"post" tags:"广告主管理" summary:"添加广告主" dc:"添加新的广告主"`
|
||||
g.Meta `path:"addAdvertiser" method:"post" tags:"广告主管理" summary:"添加广告主" dc:"添加新的广告主"`
|
||||
|
||||
// 基本信息
|
||||
Name string `json:"name" v:"required"` // 广告主名称
|
||||
@@ -49,7 +49,7 @@ type AddAdvertiserRes struct {
|
||||
|
||||
// UpdateAdvertiserReq 更新广告主请求
|
||||
type UpdateAdvertiserReq struct {
|
||||
g.Meta `path:"/advertiser/update" method:"post" tags:"广告主管理" summary:"更新广告主" dc:"更新广告主信息"`
|
||||
g.Meta `path:"updateAdvertiser" method:"put" tags:"广告主管理" summary:"更新广告主" dc:"更新广告主信息"`
|
||||
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
|
||||
@@ -92,7 +92,7 @@ type UpdateAdvertiserReq struct {
|
||||
|
||||
// GetAdvertiserReq 获取广告主详情请求
|
||||
type GetAdvertiserReq struct {
|
||||
g.Meta `path:"/advertiser/one" method:"get" tags:"广告主管理" summary:"获取广告主详情" dc:"根据ID获取单个广告主详情"`
|
||||
g.Meta `path:"getOneAdvertiser" method:"get" tags:"广告主管理" summary:"获取广告主详情" dc:"根据ID获取单个广告主详情"`
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ type GetAdvertiserRes struct {
|
||||
|
||||
// ListAdvertiserReq 获取广告主列表请求
|
||||
type ListAdvertiserReq struct {
|
||||
g.Meta `path:"/advertiser/list" method:"get" tags:"广告主管理" summary:"获取广告主列表" dc:"分页查询广告主列表,支持多条件筛选"`
|
||||
g.Meta `path:"listAdvertiser" method:"get" tags:"广告主管理" summary:"获取广告主列表" dc:"分页查询广告主列表,支持多条件筛选"`
|
||||
http.Page
|
||||
|
||||
Name string `json:"name"` // 广告主名称模糊查询
|
||||
@@ -121,7 +121,7 @@ type ListAdvertiserRes struct {
|
||||
|
||||
// AuditAdvertiserReq 审核广告主请求
|
||||
type AuditAdvertiserReq struct {
|
||||
g.Meta `path:"/advertiser/audit" method:"post" tags:"广告主管理" summary:"审核广告主" dc:"审核广告主,通过或拒绝"`
|
||||
g.Meta `path:"auditAdvertiser" method:"post" tags:"广告主管理" summary:"审核广告主" dc:"审核广告主,通过或拒绝"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
AuditStatus string `json:"auditStatus" v:"required"` // 审核状态:通过、拒绝
|
||||
@@ -130,7 +130,7 @@ type AuditAdvertiserReq struct {
|
||||
|
||||
// UpdateAdvertiserStatusReq 更新广告主状态请求
|
||||
type UpdateAdvertiserStatusReq struct {
|
||||
g.Meta `path:"/advertiser/status" method:"post" tags:"广告主管理" summary:"更新广告主状态" dc:"更新广告主状态"`
|
||||
g.Meta `path:"updateStatusAdvertiser" method:"patch" tags:"广告主管理" summary:"更新广告主状态" dc:"更新广告主状态"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
Status string `json:"status" v:"required"` // 广告主状态:启用、禁用、冻结
|
||||
@@ -138,7 +138,7 @@ type UpdateAdvertiserStatusReq struct {
|
||||
|
||||
// RechargeAdvertiserReq 广告主充值请求
|
||||
type RechargeAdvertiserReq struct {
|
||||
g.Meta `path:"/advertiser/recharge" method:"post" tags:"广告主管理" summary:"广告主充值" dc:"为广告主账户充值"`
|
||||
g.Meta `path:"rechargeAdvertiser" method:"post" tags:"广告主管理" summary:"广告主充值" dc:"为广告主账户充值"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
Amount int64 `json:"amount" v:"required"` // 充值金额(分)
|
||||
@@ -147,7 +147,7 @@ type RechargeAdvertiserReq struct {
|
||||
|
||||
// UpdateCreditLimitReq 更新授信额度请求
|
||||
type UpdateCreditLimitReq struct {
|
||||
g.Meta `path:"/advertiser/credit" method:"post" tags:"广告主管理" summary:"更新授信额度" dc:"更新广告主的授信额度"`
|
||||
g.Meta `path:"updateCreditLimitAdvertiser" method:"post" tags:"广告主管理" summary:"更新授信额度" dc:"更新广告主的授信额度"`
|
||||
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
CreditLimit int64 `json:"creditLimit" v:"required"` // 授信额度(分)
|
||||
@@ -156,7 +156,7 @@ type UpdateCreditLimitReq struct {
|
||||
|
||||
// GetAdvertiserBalanceReq 获取广告主余额请求
|
||||
type GetAdvertiserBalanceReq struct {
|
||||
g.Meta `path:"/advertiser/balance" method:"get" tags:"广告主管理" summary:"获取广告主余额" dc:"根据ID获取广告主账户余额和授信额度"`
|
||||
g.Meta `path:"getBalanceAdvertiser" method:"get" tags:"广告主管理" summary:"获取广告主余额" dc:"根据ID获取广告主账户余额和授信额度"`
|
||||
Id string `json:"id" v:"required"` // 广告主ID
|
||||
}
|
||||
|
||||
|
||||
157
model/dto/application_dto.go
Normal file
157
model/dto/application_dto.go
Normal file
@@ -0,0 +1,157 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateApplicationReq 创建应用请求
|
||||
type CreateApplicationReq struct {
|
||||
g.Meta `path:"createApplication" method:"post" summary:"创建应用"`
|
||||
|
||||
TenantID int64 `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 int64 `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:"/applications-reset-keys" 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:"/applications-validate" 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:"/applications" method:"delete" summary:"删除应用"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
}
|
||||
|
||||
// DeleteApplicationRes 删除应用响应
|
||||
type DeleteApplicationRes struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
// GenerateCIDReq 生成CID请求
|
||||
type GenerateCIDReq struct {
|
||||
g.Meta `path:"/cid/generate" method:"post" tags:"CID服务" summary:"生成CID广告" dc:"为当前用户生成CID广告"`
|
||||
g.Meta `path:"/cid-generate" 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"` // 请求参数
|
||||
@@ -38,7 +38,7 @@ type GenerateCIDRes struct {
|
||||
|
||||
// GetCIDStatisticsReq 获取CID统计请求
|
||||
type GetCIDStatisticsReq struct {
|
||||
g.Meta `path:"/cid/statistics" method:"get" tags:"CID服务" summary:"获取CID统计" dc:"获取CID服务的统计信息"`
|
||||
g.Meta `path:"/cid-statistics" 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"` // 开始日期
|
||||
@@ -67,7 +67,7 @@ type CIDRequestHistory struct {
|
||||
|
||||
// GetCIDHistoryReq 获取CID历史请求
|
||||
type GetCIDHistoryReq struct {
|
||||
g.Meta `path:"/cid/history" method:"get" tags:"CID服务" summary:"获取CID历史记录" dc:"分页获取用户的CID请求历史"`
|
||||
g.Meta `path:"/cid-history" 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"` // 每页数量
|
||||
}
|
||||
|
||||
35
model/dto/rate_limit_dto.go
Normal file
35
model/dto/rate_limit_dto.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SetTenantRateLimitReq 设置租户限流配置请求
|
||||
type SetTenantRateLimitReq struct {
|
||||
g.Meta `path:"/ratelimit-tenant-set" 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:"/ratelimit-tenant-usage" 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,7 +1,7 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cidService/model/entity"
|
||||
"cidservice/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
168
model/dto/stat_report_dto.go
Normal file
168
model/dto/stat_report_dto.go
Normal file
@@ -0,0 +1,168 @@
|
||||
package dto
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// 报表生成请求
|
||||
type ReportGenerateReq struct {
|
||||
g.Meta `path:"/report/generate" method:"post"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type" v:"required|in:daily,monthly,quarterly,yearly"`
|
||||
Date string `json:"date"` // 格式: 2024-01-01 (daily), 2024-01 (monthly), 2024-Q1 (quarterly), 2024 (yearly)
|
||||
}
|
||||
|
||||
// 报表生成响应
|
||||
type ReportGenerateResp struct {
|
||||
ReportID int64 `json:"report_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
// 报表列表请求
|
||||
type ReportListReq struct {
|
||||
g.Meta `path:"/report/list" method:"get"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
StartDate string `json:"start_date"`
|
||||
EndDate string `json:"end_date"`
|
||||
Page int `json:"page" d:"1"`
|
||||
PageSize int `json:"page_size" d:"20"`
|
||||
}
|
||||
|
||||
// 报表列表响应
|
||||
type ReportListResp struct {
|
||||
Reports []*ReportDTO `json:"reports"`
|
||||
Total int `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// 报表详情请求
|
||||
type ReportDetailReq struct {
|
||||
g.Meta `path:"/report/detail" method:"get"`
|
||||
ReportID int64 `json:"report_id" v:"required"`
|
||||
}
|
||||
|
||||
// 报表详情响应
|
||||
type ReportDetailResp struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
GeneratedAt string `json:"generated_at"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
// 报表DTO
|
||||
type ReportDTO struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
GeneratedAt string `json:"generated_at"`
|
||||
}
|
||||
|
||||
// 统计查询请求
|
||||
type StatQueryReq struct {
|
||||
g.Meta `path:"/stat/query" method:"get"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
AdType string `json:"ad_type"`
|
||||
Platform string `json:"platform"`
|
||||
Region string `json:"region"`
|
||||
StartDate string `json:"start_date" v:"required"`
|
||||
EndDate string `json:"end_date" v:"required"`
|
||||
Granularity string `json:"granularity" v:"in:daily,weekly,monthly" d:"daily"` // 统计粒度
|
||||
}
|
||||
|
||||
// 统计查询响应
|
||||
type StatQueryResp struct {
|
||||
Data []*StatDataPoint `json:"data"`
|
||||
Summary *StatSummary `json:"summary"`
|
||||
}
|
||||
|
||||
// 统计数据点
|
||||
type StatDataPoint struct {
|
||||
Date string `json:"date"`
|
||||
Impressions int64 `json:"impressions"`
|
||||
Clicks int64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
CTR float64 `json:"ctr"`
|
||||
AvgDuration float64 `json:"avg_duration"`
|
||||
}
|
||||
|
||||
// 统计摘要
|
||||
type StatSummary struct {
|
||||
TotalImpressions int64 `json:"total_impressions"`
|
||||
TotalClicks int64 `json:"total_clicks"`
|
||||
TotalRevenue float64 `json:"total_revenue"`
|
||||
AvgCTR float64 `json:"avg_ctr"`
|
||||
AvgDuration float64 `json:"avg_duration"`
|
||||
GrowthRate *GrowthRate `json:"growth_rate"`
|
||||
}
|
||||
|
||||
// 增长率统计
|
||||
type GrowthRate struct {
|
||||
Impressions float64 `json:"impressions"`
|
||||
Clicks float64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
CTR float64 `json:"ctr"`
|
||||
}
|
||||
|
||||
// 实时统计请求
|
||||
type RealTimeStatReq struct {
|
||||
g.Meta `path:"/stat/realtime" method:"get"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
Hours int `json:"hours" d:"24"` // 过去多少小时的统计
|
||||
}
|
||||
|
||||
// 实时统计响应
|
||||
type RealTimeStatResp struct {
|
||||
CurrentHour *HourlyStat `json:"current_hour"`
|
||||
Last24Hours []*HourlyStat `json:"last_24_hours"`
|
||||
}
|
||||
|
||||
// 小时统计
|
||||
type HourlyStat struct {
|
||||
Hour string `json:"hour"`
|
||||
Impressions int64 `json:"impressions"`
|
||||
Clicks int64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
}
|
||||
|
||||
// Controller响应结构
|
||||
|
||||
// 生成报表响应
|
||||
type ReportGenerateRes struct {
|
||||
Data *ReportGenerateResp `json:"data"`
|
||||
}
|
||||
|
||||
// 报表列表响应
|
||||
type ReportListRes struct {
|
||||
Data *ReportListResp `json:"data"`
|
||||
}
|
||||
|
||||
// 报表详情响应
|
||||
type ReportDetailRes struct {
|
||||
Data *ReportDetailResp `json:"data"`
|
||||
}
|
||||
|
||||
// 统计查询响应
|
||||
type StatQueryRes struct {
|
||||
Data *StatQueryResp `json:"data"`
|
||||
}
|
||||
|
||||
// 实时统计响应
|
||||
type RealTimeStatRes struct {
|
||||
Data *RealTimeStatResp `json:"data"`
|
||||
}
|
||||
|
||||
// 导出报表响应
|
||||
type ExportReportRes struct {
|
||||
ReportData *ReportDetailResp `json:"report_data"`
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
// CreateStrategyReq 创建策略请求
|
||||
type CreateStrategyReq struct {
|
||||
g.Meta `path:"/strategy/create" method:"post" tags:"策略管理" summary:"创建匹配策略" dc:"创建新的广告匹配策略"`
|
||||
g.Meta `path:"/strategy" 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"` // 租户级别
|
||||
@@ -14,13 +14,14 @@ type CreateStrategyReq struct {
|
||||
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:"/strategy/update" method:"put" tags:"策略管理" summary:"更新匹配策略" dc:"更新现有的广告匹配策略"`
|
||||
g.Meta `path:"/strategy" 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"` // 描述
|
||||
@@ -29,25 +30,26 @@ type UpdateStrategyReq struct {
|
||||
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:"/strategy/delete" method:"delete" tags:"策略管理" summary:"删除匹配策略" dc:"删除指定的广告匹配策略"`
|
||||
g.Meta `path:"/strategy" method:"delete" tags:"策略管理" summary:"删除匹配策略" dc:"删除指定的广告匹配策略"`
|
||||
Id int64 `json:"id" v:"required"` // 策略ID
|
||||
}
|
||||
|
||||
// GetStrategyReq 获取策略请求
|
||||
type GetStrategyReq struct {
|
||||
g.Meta `path:"/strategy/info" method:"get" tags:"策略管理" summary:"获取策略详情" dc:"获取指定策略的详细信息"`
|
||||
g.Meta `path:"/strategy" method:"get" tags:"策略管理" summary:"获取策略详情" dc:"获取指定策略的详细信息"`
|
||||
Id int64 `json:"id" v:"required"` // 策略ID
|
||||
}
|
||||
|
||||
// GetStrategyListReq 获取策略列表请求
|
||||
type GetStrategyListReq struct {
|
||||
g.Meta `path:"/strategy/list" method:"get" tags:"策略管理" summary:"获取策略列表" dc:"分页获取策略列表"`
|
||||
g.Meta `path:"/strategies" 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"` // 租户级别筛选
|
||||
@@ -56,20 +58,21 @@ type GetStrategyListReq struct {
|
||||
|
||||
// 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"` // 每次请求最大广告数
|
||||
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"` // 更新人
|
||||
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 获取策略列表响应
|
||||
|
||||
@@ -1,163 +1,167 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
"time"
|
||||
)
|
||||
|
||||
const AdSourceCollection = "ad_source"
|
||||
|
||||
// AdSource 广告源实体
|
||||
type AdSource struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||||
Creator string `json:"creator"` // 创建者
|
||||
Updater string `json:"updater"` // 更新者
|
||||
TenantId int64 `json:"tenantId"` // 租户ID
|
||||
IsDeleted bool `json:"isDeleted"` // 是否删除
|
||||
|
||||
// 基本信息
|
||||
Name string `bson:"name" json:"name"` // 广告源名称
|
||||
Code string `bson:"code" json:"code"` // 广告源编码,唯一标识
|
||||
Provider string `bson:"provider" json:"provider"` // 提供商:google、facebook、baidu、tencent、self等
|
||||
Type string `bson:"type" json:"type"` // 类型:self(自营)、third_party(第三方)、exchange(广告交易平台)
|
||||
Description string `bson:"description" json:"description"` // 描述
|
||||
Name string `json:"name"` // 广告源名称
|
||||
Code string `json:"code"` // 广告源编码,唯一标识
|
||||
Provider string `json:"provider"` // 提供商:google、facebook、baidu、tencent、self等
|
||||
Type string `json:"type"` // 类型:self(自营)、third_party(第三方)、exchange(广告交易平台)
|
||||
Description string `json:"description"` // 描述
|
||||
|
||||
// 连接配置
|
||||
Config *AdSourceConfig `bson:"config" json:"config"` // 广告源配置
|
||||
Config string `json:"config"` // 广告源配置(JSON字符串)
|
||||
|
||||
// API配置
|
||||
APIEndpoint string `bson:"apiEndpoint" json:"apiEndpoint"` // API端点
|
||||
APIVersion string `bson:"apiVersion" json:"apiVersion"` // API版本
|
||||
AuthType string `bson:"authType" json:"authType"` // 认证类型:api_key、oauth、basic
|
||||
AuthConfig map[string]interface{} `bson:"authConfig" json:"authConfig"` // 认证配置
|
||||
Headers map[string]string `bson:"headers" json:"headers"` // 请求头配置
|
||||
Timeout int `bson:"timeout" json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `bson:"retryCount" json:"retryCount"` // 重试次数
|
||||
APIEndpoint string `json:"apiEndpoint"` // API端点
|
||||
APIVersion string `json:"apiVersion"` // API版本
|
||||
AuthType string `json:"authType"` // 认证类型:api_key、oauth、basic
|
||||
AuthConfig string `json:"authConfig"` // 认证配置(JSON字符串)
|
||||
Headers string `json:"headers"` // 请求头配置(JSON字符串)
|
||||
Timeout int `json:"timeout"` // 超时时间(毫秒)
|
||||
RetryCount int `json:"retryCount"` // 重试次数
|
||||
|
||||
// 广告源能力
|
||||
Capabilities *AdSourceCapabilities `bson:"capabilities" json:"capabilities"` // 广告源能力
|
||||
Capabilities string `json:"capabilities"` // 广告源能力(JSON字符串)
|
||||
|
||||
// 质量指标
|
||||
QualityMetrics *AdSourceQualityMetrics `bson:"qualityMetrics" json:"qualityMetrics"` // 质量指标
|
||||
QualityMetrics string `json:"qualityMetrics"` // 质量指标(JSON字符串)
|
||||
|
||||
// 财务设置
|
||||
PaymentTerms *PaymentTerms `bson:"paymentTerms" json:"paymentTerms"` // 支付条款
|
||||
PaymentTerms string `json:"paymentTerms"` // 支付条款(JSON字符串)
|
||||
|
||||
// 状态信息
|
||||
Status string `bson:"status" json:"status"` // 广告源状态:active、inactive、maintenance
|
||||
Health string `bson:"health" json:"health"` // 健康状态:healthy、degraded、unhealthy
|
||||
LastCheckAt int64 `bson:"lastCheckAt" json:"lastCheckAt"` // 最后检查时间
|
||||
Status string `json:"status"` // 广告源状态:active、inactive、maintenance
|
||||
Health string `json:"health"` // 健康状态:healthy、degraded、unhealthy
|
||||
LastCheckAt int64 `json:"lastCheckAt"` // 最后检查时间
|
||||
|
||||
// 统计信息
|
||||
TotalRequests int64 `bson:"totalRequests" json:"totalRequests"` // 总请求数
|
||||
SuccessfulRequests int64 `bson:"successfulRequests" json:"successfulRequests"` // 成功请求数
|
||||
FailedRequests int64 `bson:"failedRequests" json:"failedRequests"` // 失败请求数
|
||||
AverageResponseTime float64 `bson:"averageResponseTime" json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
FillRate float64 `bson:"fillRate" json:"fillRate"` // 填充率
|
||||
CTR float64 `bson:"ctr" json:"ctr"` // 点击率
|
||||
CVR float64 `bson:"cvr" json:"cvr"` // 转化率
|
||||
TotalRequests int64 `json:"totalRequests"` // 总请求数
|
||||
SuccessfulRequests int64 `json:"successfulRequests"` // 成功请求数
|
||||
FailedRequests int64 `json:"failedRequests"` // 失败请求数
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
|
||||
// 系统信息
|
||||
Priority int `bson:"priority" json:"priority"` // 优先级,数值越高优先级越高
|
||||
Priority int `json:"priority"` // 优先级,数值越高优先级越高
|
||||
}
|
||||
|
||||
// AdSourceConfig 广告源配置
|
||||
type AdSourceConfig struct {
|
||||
// 基础配置
|
||||
SupportedFormats []string `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedSizes []string `bson:"supportedSizes" json:"supportedSizes"` // 支持的尺寸
|
||||
SupportedDevices []string `bson:"supportedDevices" json:"supportedDevices"` // 支持的设备类型
|
||||
SupportedOS []string `bson:"supportedOS" json:"supportedOS"` // 支持的操作系统
|
||||
SupportedCountries []string `bson:"supportedCountries" json:"supportedCountries"` // 支持的国家/地区
|
||||
SupportedFormats []string `json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedSizes []string `json:"supportedSizes"` // 支持的尺寸
|
||||
SupportedDevices []string `json:"supportedDevices"` // 支持的设备类型
|
||||
SupportedOS []string `json:"supportedOS"` // 支持的操作系统
|
||||
SupportedCountries []string `json:"supportedCountries"` // 支持的国家/地区
|
||||
|
||||
// 竞价配置
|
||||
BiddingType string `bson:"biddingType" json:"biddingType"` // 竞价类型:cpm、cpc、cpa、rtb
|
||||
MinBidAmount int64 `bson:"minBidAmount" json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `bson:"maxBidAmount" json:"maxBidAmount"` // 最大出价(分)
|
||||
BidIncrement int64 `bson:"bidIncrement" json:"bidIncrement"` // 出价增量(分)
|
||||
DefaultBidAmount int64 `bson:"defaultBidAmount" json:"defaultBidAmount"` // 默认出价(分)
|
||||
AutoOptimization bool `bson:"autoOptimization" json:"autoOptimization"` // 是否自动优化
|
||||
BiddingType string `json:"biddingType"` // 竞价类型:cpm、cpc、cpa、rtb
|
||||
MinBidAmount int64 `json:"minBidAmount"` // 最小出价(分)
|
||||
MaxBidAmount int64 `json:"maxBidAmount"` // 最大出价(分)
|
||||
BidIncrement int64 `json:"bidIncrement"` // 出价增量(分)
|
||||
DefaultBidAmount int64 `json:"defaultBidAmount"` // 默认出价(分)
|
||||
AutoOptimization bool `json:"autoOptimization"` // 是否自动优化
|
||||
|
||||
// 定向配置
|
||||
TargetingSupport *TargetingSupport `bson:"targetingSupport" json:"targetingSupport"` // 定向支持
|
||||
TargetingSupport *TargetingSupport `json:"targetingSupport"` // 定向支持
|
||||
|
||||
// 其他配置
|
||||
MaxAdsPerRequest int `bson:"maxAdsPerRequest" json:"maxAdsPerRequest"` // 单次请求最大广告数量
|
||||
BrandSafety bool `bson:"brandSafety" json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `bson:"viewability" json:"viewability"` // 可见性支持
|
||||
MaxAdsPerRequest int `json:"maxAdsPerRequest"` // 单次请求最大广告数量
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见性支持
|
||||
}
|
||||
|
||||
// TargetingSupport 定向支持
|
||||
type TargetingSupport struct {
|
||||
GeoTargeting bool `bson:"geoTargeting" json:"geoTargeting"` // 地理定向
|
||||
DemographicTargeting bool `bson:"demographicTargeting" json:"demographicTargeting"` // 人口统计定向
|
||||
BehavioralTargeting bool `bson:"behavioralTargeting" json:"behavioralTargeting"` // 行为定向
|
||||
ContextualTargeting bool `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
||||
DeviceTargeting bool `bson:"deviceTargeting" json:"deviceTargeting"` // 设备定向
|
||||
TimeTargeting bool `bson:"timeTargeting" json:"timeTargeting"` // 时间定向
|
||||
Retargeting bool `bson:"retargeting" json:"retargeting"` // 重定向
|
||||
CookieTargeting bool `bson:"cookieTargeting" json:"cookieTargeting"` // Cookie定向
|
||||
GeoTargeting bool `json:"geoTargeting"` // 地理定向
|
||||
DemographicTargeting bool `json:"demographicTargeting"` // 人口统计定向
|
||||
BehavioralTargeting bool `json:"behavioralTargeting"` // 行为定向
|
||||
ContextualTargeting bool `json:"contextualTargeting"` // 上下文定向
|
||||
DeviceTargeting bool `json:"deviceTargeting"` // 设备定向
|
||||
TimeTargeting bool `json:"timeTargeting"` // 时间定向
|
||||
Retargeting bool `json:"retargeting"` // 重定向
|
||||
CookieTargeting bool `json:"cookieTargeting"` // Cookie定向
|
||||
}
|
||||
|
||||
// AdSourceCapabilities 广告源能力
|
||||
type AdSourceCapabilities struct {
|
||||
// 广告格式
|
||||
SupportedFormats []AdFormat `bson:"supportedFormats" json:"supportedFormats"` // 支持的广告格式
|
||||
SupportedFormats []AdFormat `json:"supportedFormats"` // 支持的广告格式
|
||||
|
||||
// 功能特性
|
||||
RealTimeBidding bool `bson:"realTimeBidding" json:"realTimeBidding"` // 实时竞价
|
||||
HeaderBidding bool `bson:"headerBidding" json:"headerBidding"` // 标题竞价
|
||||
ProgrammaticDirect bool `bson:"programmaticDirect" json:"programmaticDirect"` // 程序化直购
|
||||
PrivateMarketplace bool `bson:"privateMarketplace" json:"privateMarketplace"` // 私有交易市场
|
||||
RealTimeBidding bool `json:"realTimeBidding"` // 实时竞价
|
||||
HeaderBidding bool `json:"headerBidding"` // 标题竞价
|
||||
ProgrammaticDirect bool `json:"programmaticDirect"` // 程序化直购
|
||||
PrivateMarketplace bool `json:"privateMarketplace"` // 私有交易市场
|
||||
|
||||
// 质量控制
|
||||
FraudDetection bool `bson:"fraudDetection" json:"fraudDetection"` // 反欺诈检测
|
||||
BrandSafety bool `bson:"brandSafety" json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `bson:"viewability" json:"viewability"` // 可见度验证
|
||||
CreativeApproval bool `bson:"creativeApproval" json:"creativeApproval"` // 创意审核
|
||||
FraudDetection bool `json:"fraudDetection"` // 反欺诈检测
|
||||
BrandSafety bool `json:"brandSafety"` // 品牌安全
|
||||
Viewability bool `json:"viewability"` // 可见度验证
|
||||
CreativeApproval bool `json:"creativeApproval"` // 创意审核
|
||||
|
||||
// 数据能力
|
||||
AudienceTargeting bool `bson:"audienceTargeting" json:"audienceTargeting"` // 受众定向
|
||||
ContextualTargeting bool `bson:"contextualTargeting" json:"contextualTargeting"` // 上下文定向
|
||||
CrossDeviceTargeting bool `bson:"crossDeviceTargeting" json:"crossDeviceTargeting"` // 跨设备定向
|
||||
AudienceTargeting bool `json:"audienceTargeting"` // 受众定向
|
||||
ContextualTargeting bool `json:"contextualTargeting"` // 上下文定向
|
||||
CrossDeviceTargeting bool `json:"crossDeviceTargeting"` // 跨设备定向
|
||||
}
|
||||
|
||||
// AdFormat 广告格式
|
||||
type AdFormat struct {
|
||||
Type string `bson:"type" json:"type"` // 格式类型:banner、video、native、interstitial等
|
||||
Name string `bson:"name" json:"name"` // 格式名称
|
||||
Width int `bson:"width" json:"width"` // 宽度
|
||||
Height int `bson:"height" json:"height"` // 高度
|
||||
MimeType string `bson:"mimeType" json:"mimeType"` // MIME类型
|
||||
Type string `json:"type"` // 格式类型:banner、video、native、interstitial等
|
||||
Name string `json:"name"` // 格式名称
|
||||
Width int `json:"width"` // 宽度
|
||||
Height int `json:"height"` // 高度
|
||||
MimeType string `json:"mimeType"` // MIME类型
|
||||
}
|
||||
|
||||
// AdSourceQualityMetrics 广告源质量指标
|
||||
type AdSourceQualityMetrics struct {
|
||||
// 性能指标
|
||||
AverageResponseTime float64 `bson:"averageResponseTime" json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
SuccessRate float64 `bson:"successRate" json:"successRate"` // 成功率
|
||||
ErrorRate float64 `bson:"errorRate" json:"errorRate"` // 错误率
|
||||
Uptime float64 `bson:"uptime" json:"uptime"` // 可用性(百分比)
|
||||
AverageResponseTime float64 `json:"averageResponseTime"` // 平均响应时间(毫秒)
|
||||
SuccessRate float64 `json:"successRate"` // 成功率
|
||||
ErrorRate float64 `json:"errorRate"` // 错误率
|
||||
Uptime float64 `json:"uptime"` // 可用性(百分比)
|
||||
|
||||
// 广告质量
|
||||
CTR float64 `bson:"ctr" json:"ctr"` // 点击率
|
||||
CVR float64 `bson:"cvr" json:"cvr"` // 转化率
|
||||
FillRate float64 `bson:"fillRate" json:"fillRate"` // 填充率
|
||||
ViewabilityRate float64 `bson:"viewabilityRate" json:"viewabilityRate"` // 可见率
|
||||
BrandSafetyScore float64 `bson:"brandSafetyScore" json:"brandSafetyScore"` // 品牌安全评分
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
FillRate float64 `json:"fillRate"` // 填充率
|
||||
ViewabilityRate float64 `json:"viewabilityRate"` // 可见率
|
||||
BrandSafetyScore float64 `json:"brandSafetyScore"` // 品牌安全评分
|
||||
|
||||
// 财务指标
|
||||
eCPM int64 `bson:"ecpm" json:"ecpm"` // 有效千次展示成本(分)
|
||||
eCPC int64 `bson:"ecpc" json:"ecpc"` // 有效点击成本(分)
|
||||
RevenuePerRequest int64 `bson:"revenuePerRequest" json:"revenuePerRequest"` // 每请求收入(分)
|
||||
Ecpm int64 `json:"ecpm"` // 有效千次展示成本(分)
|
||||
Ecpc int64 `json:"ecpc"` // 有效点击成本(分)
|
||||
RevenuePerRequest int64 `json:"revenuePerRequest"` // 每请求收入(分)
|
||||
|
||||
// 时间指标
|
||||
LastUpdated int64 `bson:"lastUpdated" json:"lastUpdated"` // 最后更新时间
|
||||
MetricsUpdateWindow int `bson:"metricsUpdateWindow" json:"metricsUpdateWindow"` // 指标更新窗口(分钟)
|
||||
LastUpdated int64 `json:"lastUpdated"` // 最后更新时间
|
||||
MetricsUpdateWindow int `json:"metricsUpdateWindow"` // 指标更新窗口(分钟)
|
||||
}
|
||||
|
||||
// PaymentTerms 支付条款
|
||||
type PaymentTerms struct {
|
||||
BillingModel string `bson:"billingModel" json:"billingModel"` // 计费模式:cpm、cpc、cpa、rev_share
|
||||
PaymentTerms string `bson:"paymentTerms" json:"paymentTerms"` // 支付条款:net_30、net_60、net_90
|
||||
RevShareRate float64 `bson:"revShareRate" json:"revShareRate"` // 收入分成比例(0-1)
|
||||
MinPayment int64 `bson:"minPayment" json:"minPayment"` // 最小支付金额(分)
|
||||
Currency string `bson:"currency" json:"currency"` // 货币单位
|
||||
TaxInclusive bool `bson:"taxInclusive" json:"taxInclusive"` // 是否含税
|
||||
EarlyPaymentDiscount float64 `bson:"earlyPaymentDiscount" json:"earlyPaymentDiscount"` // 提前付款折扣
|
||||
BillingModel string `json:"billingModel"` // 计费模式:cpm、cpc、cpa、rev_share
|
||||
PaymentTerms string `json:"paymentTerms"` // 支付条款:net_30、net_60、net_90
|
||||
RevShareRate float64 `json:"revShareRate"` // 收入分成比例(0-1)
|
||||
MinPayment int64 `json:"minPayment"` // 最小支付金额(分)
|
||||
Currency string `json:"currency"` // 货币单位
|
||||
TaxInclusive bool `json:"taxInclusive"` // 是否含税
|
||||
EarlyPaymentDiscount float64 `json:"earlyPaymentDiscount"` // 提前付款折扣
|
||||
}
|
||||
|
||||
44
model/entity/ad_type.go
Normal file
44
model/entity/ad_type.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const AdTypeCollection = "ad_type"
|
||||
|
||||
// AdType 广告类型实体
|
||||
type AdType struct {
|
||||
do.MongoBaseDO `bson:",inline"`
|
||||
|
||||
// 广告类型信息
|
||||
Name string `bson:"name" json:"name"` // 广告类型名称
|
||||
Code string `bson:"code" json:"code"` // 广告类型编码
|
||||
Description string `bson:"description" json:"description"` // 广告类型描述
|
||||
Icon string `bson:"icon" json:"icon"` // 广告类型图标
|
||||
|
||||
// 类型配置
|
||||
Category string `bson:"category" json:"category"` // 分类:display, video, native, interstitial
|
||||
Platforms []string `bson:"platforms" json:"platforms"` // 支持的平台
|
||||
Formats []string `bson:"formats" json:"formats"` // 支持格式
|
||||
Dimensions []string `bson:"dimensions" json:"dimensions"` // 尺寸规格
|
||||
|
||||
// 技术要求
|
||||
MaxFileSize int64 `bson:"maxFileSize" json:"maxFileSize"` // 最大文件大小(bytes)
|
||||
MaxDuration int64 `bson:"maxDuration" json:"maxDuration"` // 最大时长(秒)
|
||||
SupportedMimeTypes []string `bson:"supportedMimeTypes" json:"supportedMimeTypes"` // 支持的MIME类型
|
||||
|
||||
// 业务配置
|
||||
BidType string `bson:"bidType" json:"bidType"` // 竞价类型:CPM, CPC, CPA
|
||||
MinBidPrice int64 `bson:"minBidPrice" json:"minBidPrice"` // 最低出价(分)
|
||||
MaxBidPrice int64 `bson:"maxBidPrice" json:"maxBidPrice"` // 最高出价(分)
|
||||
|
||||
// 状态信息
|
||||
Status string `bson:"status" json:"status"` // 状态:active, inactive
|
||||
SortOrder int `bson:"sortOrder" json:"sortOrder"` // 排序顺序
|
||||
|
||||
// 统计信息
|
||||
DailyImpression int64 `bson:"dailyImpression" json:"dailyImpression"` // 日展示量
|
||||
DailyClick int64 `bson:"dailyClick" json:"dailyClick"` // 日点击量
|
||||
|
||||
Remark string `bson:"remark" json:"remark"` // 备注
|
||||
}
|
||||
51
model/entity/application.go
Normal file
51
model/entity/application.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Application 应用实体
|
||||
type Application struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||||
Creator string `json:"creator"` // 创建者
|
||||
Updater string `json:"updater"` // 更新者
|
||||
TenantId int64 `json:"tenantId"` // 租户ID
|
||||
IsDeleted bool `json:"isDeleted"` // 是否删除
|
||||
|
||||
// 应用信息
|
||||
Name string `json:"name"` // 应用名称
|
||||
Code string `json:"code"` // 应用编码
|
||||
Description string `json:"description"` // 应用描述
|
||||
Icon string `json:"icon"` // 应用图标
|
||||
|
||||
// 平台信息
|
||||
Platform string `json:"platform"` // 平台:web, h5, android, ios
|
||||
PackageName string `json:"packageName"` // 包名(Android)/Bundle ID(iOS)
|
||||
AppStoreURL string `json:"appStoreUrl"` // 应用商店链接
|
||||
|
||||
// 配置信息
|
||||
Categories []string `json:"categories"` // 应用分类
|
||||
Tags []string `json:"tags"` // 应用标签
|
||||
Config string `json:"config"` // 应用配置(JSON格式)
|
||||
AdTypes []string `json:"adTypes"` // 支持的广告类型
|
||||
|
||||
// 状态信息
|
||||
Status string `json:"status"` // 状态:active, inactive, audit
|
||||
AuditStatus string `json:"auditStatus"` // 审核状态
|
||||
AuditReason string `json:"auditReason"` // 审核原因
|
||||
|
||||
// 统计信息
|
||||
DailyRequests int64 `json:"dailyRequests"` // 日请求量
|
||||
MonthlyRequests int64 `json:"monthlyRequests"` // 月请求量
|
||||
|
||||
// API密钥
|
||||
AppKey string `json:"appKey"` // 应用密钥
|
||||
AppSecret string `json:"appSecret"` // 应用密钥
|
||||
|
||||
// 回调信息
|
||||
CallbackURL string `json:"callbackUrl"` // 回调URL
|
||||
|
||||
Remark string `json:"remark"` // 备注
|
||||
}
|
||||
26
model/entity/stat_report.go
Normal file
26
model/entity/stat_report.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// StatReport 统计报表实体
|
||||
type StatReport struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||||
Creator string `json:"creator"` // 创建者
|
||||
Updater string `json:"updater"` // 更新者
|
||||
TenantId int64 `json:"tenantId"` // 租户ID
|
||||
IsDeleted bool `json:"isDeleted"` // 是否删除
|
||||
|
||||
// 报表基本信息
|
||||
AppID int64 `json:"appId"` // 应用ID
|
||||
ReportType string `json:"reportType"` // 报表类型:daily, weekly, monthly, quarterly, yearly
|
||||
ReportDate time.Time `json:"reportDate"` // 报表日期
|
||||
GeneratedAt time.Time `json:"generatedAt"` // 生成时间
|
||||
ReportData string `json:"reportData"` // 报表数据(JSON格式)
|
||||
|
||||
// 状态信息
|
||||
Status string `json:"status"` // 状态:generated, processing, completed
|
||||
}
|
||||
@@ -6,18 +6,19 @@ import (
|
||||
|
||||
// Strategy 匹配策略表
|
||||
type Strategy struct {
|
||||
Id int64 `json:"id" orm:"id,primary"` // ID
|
||||
Name string `json:"name" orm:"name"` // 策略名称
|
||||
Description string `json:"description" orm:"description"` // 描述
|
||||
TenantLevel string `json:"tenant_level" orm:"tenant_level"` // 适用租户级别
|
||||
MinConversion float64 `json:"min_conversion" orm:"min_conversion"` // 最低转化率
|
||||
MaxConversion float64 `json:"max_conversion" orm:"max_conversion"` // 最高转化率
|
||||
SourceWeights string `json:"source_weights" orm:"source_weights"` // 广告源权重 (JSON格式)
|
||||
MaxAdsPerReq int `json:"max_ads_per_req" orm:"max_ads_per_req"` // 每次请求最大广告数
|
||||
Priority int `json:"priority" orm:"priority"` // 优先级
|
||||
Status string `json:"status" orm:"status"` // 状态: active, inactive
|
||||
CreatedAt *gtime.Time `json:"created_at" orm:"created_at"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updated_at" orm:"updated_at"` // 更新时间
|
||||
CreatedBy int64 `json:"created_by" orm:"created_by"` // 创建人
|
||||
UpdatedBy int64 `json:"updated_by" orm:"updated_by"` // 更新人
|
||||
Id int64 `json:"id" orm:"id,primary"` // ID
|
||||
Name string `json:"name" orm:"name"` // 策略名称
|
||||
Description string `json:"description" orm:"description"` // 描述
|
||||
TenantLevel string `json:"tenant_level" orm:"tenant_level"` // 适用租户级别
|
||||
MinConversion float64 `json:"min_conversion" orm:"min_conversion"` // 最低转化率
|
||||
MaxConversion float64 `json:"max_conversion" orm:"max_conversion"` // 最高转化率
|
||||
SourceWeights string `json:"source_weights" orm:"source_weights"` // 广告源权重 (JSON格式)
|
||||
MaxAdsPerReq int `json:"max_ads_per_req" orm:"max_ads_per_req"` // 每次请求最大广告数
|
||||
MaxReqPerHour int `json:"max_req_per_hour" orm:"max_req_per_hour"` // 每小时最大请求次数
|
||||
Priority int `json:"priority" orm:"priority"` // 优先级
|
||||
Status string `json:"status" orm:"status"` // 状态: active, inactive
|
||||
CreatedAt *gtime.Time `json:"created_at" orm:"created_at"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updated_at" orm:"updated_at"` // 更新时间
|
||||
CreatedBy int64 `json:"created_by" orm:"created_by"` // 创建人
|
||||
UpdatedBy int64 `json:"updated_by" orm:"updated_by"` // 更新人
|
||||
}
|
||||
|
||||
39
model/entity/tenant.go
Normal file
39
model/entity/tenant.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
)
|
||||
|
||||
const TenantCollection = "tenant"
|
||||
|
||||
// Tenant 租户实体
|
||||
type Tenant struct {
|
||||
do.MongoBaseDO `bson:",inline"`
|
||||
|
||||
// 租户信息
|
||||
Name string `bson:"name" json:"name"` // 租户名称
|
||||
Code string `bson:"code" json:"code"` // 租户编码
|
||||
Description string `bson:"description" json:"description"` // 租户描述
|
||||
Logo string `bson:"logo" json:"logo"` // 租户Logo
|
||||
Domain string `bson:"domain" json:"domain"` // 租户域名
|
||||
|
||||
// 联系信息
|
||||
ContactName string `bson:"contactName" json:"contactName"` // 联系人姓名
|
||||
ContactPhone string `bson:"contactPhone" json:"contactPhone"` // 联系电话
|
||||
ContactEmail string `bson:"contactEmail" json:"contactEmail"` // 联系邮箱
|
||||
|
||||
// 状态信息
|
||||
Status string `bson:"status" json:"status"` // 状态:active, inactive, suspended
|
||||
PackageType string `bson:"packageType" json:"packageType"` // 套餐类型:basic, standard, premium
|
||||
ExpireTime int64 `bson:"expireTime" json:"expireTime"` // 套餐到期时间
|
||||
|
||||
// 限制信息
|
||||
MaxApps int64 `bson:"maxApps" json:"maxApps"` // 最大应用数
|
||||
MaxUsers int64 `bson:"maxUsers" json:"maxUsers"` // 最大用户数
|
||||
MaxRequestPerDay int64 `bson:"maxRequestPerDay" json:"maxRequestPerDay"` // 每日最大请求数
|
||||
|
||||
// 配置信息
|
||||
Config map[string]interface{} `bson:"config" json:"config"` // 租户配置
|
||||
|
||||
Remark string `bson:"remark" json:"remark"` // 备注
|
||||
}
|
||||
Reference in New Issue
Block a user