初始化项目

This commit is contained in:
2025-12-06 15:24:30 +08:00
parent 88a2753211
commit fd08b8925f
59 changed files with 2456 additions and 447 deletions

View File

@@ -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"` // 用户信息

View File

@@ -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"` // 开始日期

View File

@@ -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"` // 日期时间戳
}

View File

@@ -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"` // 统计类型:天、周、月

View File

@@ -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
}

View 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"`
}

View File

@@ -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"` // 每页数量
}

View 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"` // 使用率百分比
}

View File

@@ -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"

View 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"`
}

View File

@@ -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 获取策略列表响应