v1.0
This commit is contained in:
@@ -301,17 +301,16 @@ type (
|
||||
AdminAuditRealNameResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
// 系统配置查询
|
||||
// 系统配置查询(价格配置已移除,改为产品配置表管理)
|
||||
AdminGetAgentConfigResp {
|
||||
BasePrice float64 `json:"base_price"` // 基础底价
|
||||
SystemMaxPrice float64 `json:"system_max_price"` // 系统价格上限
|
||||
PriceThreshold float64 `json:"price_threshold"` // 提价标准阈值
|
||||
PriceFeeRate float64 `json:"price_fee_rate"` // 提价手续费比例
|
||||
LevelBonus LevelBonusConfig `json:"level_bonus"` // 等级加成配置
|
||||
UpgradeFee UpgradeFeeConfig `json:"upgrade_fee"` // 升级费用配置
|
||||
UpgradeRebate UpgradeRebateConfig `json:"upgrade_rebate"` // 升级返佣配置
|
||||
TaxRate float64 `json:"tax_rate"` // 税率
|
||||
TaxExemptionAmount float64 `json:"tax_exemption_amount"` // 免税额度
|
||||
LevelBonus LevelBonusConfig `json:"level_bonus"` // 等级加成配置
|
||||
UpgradeFee UpgradeFeeConfig `json:"upgrade_fee"` // 升级费用配置
|
||||
UpgradeRebate UpgradeRebateConfig `json:"upgrade_rebate"` // 升级返佣配置
|
||||
DirectParentRebate DirectParentRebateConfig `json:"direct_parent_rebate"` // 直接上级返佣配置
|
||||
MaxGoldRebateAmount float64 `json:"max_gold_rebate_amount"` // 黄金代理最大返佣金额
|
||||
CommissionFreeze CommissionFreezeConfig `json:"commission_freeze"` // 佣金冻结配置
|
||||
TaxRate float64 `json:"tax_rate"` // 税率
|
||||
TaxExemptionAmount float64 `json:"tax_exemption_amount"` // 免税额度
|
||||
}
|
||||
LevelBonusConfig {
|
||||
Diamond int64 `json:"diamond"` // 钻石加成:0
|
||||
@@ -327,23 +326,36 @@ type (
|
||||
NormalToGoldRebate float64 `json:"normal_to_gold_rebate"` // 普通→黄金返佣:139
|
||||
ToDiamondRebate float64 `json:"to_diamond_rebate"` // 升级为钻石返佣:680
|
||||
}
|
||||
// 系统配置更新
|
||||
DirectParentRebateConfig {
|
||||
Diamond float64 `json:"diamond"` // 直接上级是钻石的返佣金额(6元)
|
||||
Gold float64 `json:"gold"` // 直接上级是黄金的返佣金额(3元)
|
||||
Normal float64 `json:"normal"` // 直接上级是普通的返佣金额(2元)
|
||||
}
|
||||
CommissionFreezeConfig {
|
||||
Ratio float64 `json:"ratio"` // 佣金冻结比例(例如:0.1表示10%)
|
||||
Threshold float64 `json:"threshold"` // 佣金冻结阈值(订单单价达到此金额才触发冻结,单位:元)
|
||||
Days int64 `json:"days"` // 佣金冻结解冻天数(单位:天,例如:30表示30天后解冻)
|
||||
}
|
||||
// 系统配置更新(价格配置已移除,改为产品配置表管理)
|
||||
AdminUpdateAgentConfigReq {
|
||||
BasePrice *float64 `json:"base_price,optional"` // 基础底价
|
||||
SystemMaxPrice *float64 `json:"system_max_price,optional"` // 系统价格上限
|
||||
PriceThreshold *float64 `json:"price_threshold,optional"` // 提价标准阈值
|
||||
PriceFeeRate *float64 `json:"price_fee_rate,optional"` // 提价手续费比例
|
||||
TaxRate *float64 `json:"tax_rate,optional"` // 税率
|
||||
TaxExemptionAmount *float64 `json:"tax_exemption_amount,optional"` // 免税额度
|
||||
LevelBonus *LevelBonusConfig `json:"level_bonus,optional"` // 等级加成配置
|
||||
UpgradeFee *UpgradeFeeConfig `json:"upgrade_fee,optional"` // 升级费用配置
|
||||
UpgradeRebate *UpgradeRebateConfig `json:"upgrade_rebate,optional"` // 升级返佣配置
|
||||
DirectParentRebate *DirectParentRebateConfig `json:"direct_parent_rebate,optional"` // 直接上级返佣配置
|
||||
MaxGoldRebateAmount *float64 `json:"max_gold_rebate_amount,optional"` // 黄金代理最大返佣金额
|
||||
CommissionFreeze *CommissionFreezeConfig `json:"commission_freeze,optional"` // 佣金冻结配置
|
||||
TaxRate *float64 `json:"tax_rate,optional"` // 税率
|
||||
TaxExemptionAmount *float64 `json:"tax_exemption_amount,optional"` // 免税额度
|
||||
}
|
||||
AdminUpdateAgentConfigResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
// 产品配置分页查询
|
||||
AdminGetAgentProductConfigListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ProductId *int64 `form:"product_id,optional"` // 产品ID(可选)
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ProductId *int64 `form:"product_id,optional"` // 产品ID(可选)
|
||||
ProductName *string `form:"product_name,optional"` // 产品名称(可选,用于搜索)
|
||||
}
|
||||
AgentProductConfigItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
@@ -362,12 +374,11 @@ type (
|
||||
}
|
||||
// 产品配置更新
|
||||
AdminUpdateAgentProductConfigReq {
|
||||
Id int64 `json:"id"` // 主键
|
||||
BasePrice float64 `json:"base_price"` // 基础底价
|
||||
PriceRangeMin float64 `json:"price_range_min"` // 最低定价
|
||||
PriceRangeMax float64 `json:"price_range_max"` // 最高定价
|
||||
PriceThreshold float64 `json:"price_threshold"` // 提价标准阈值
|
||||
PriceFeeRate float64 `json:"price_fee_rate"` // 提价手续费比例
|
||||
Id int64 `json:"id"` // 主键
|
||||
BasePrice float64 `json:"base_price"` // 基础底价
|
||||
PriceRangeMax float64 `json:"price_range_max"` // 最高定价(对应数据库 system_max_price)
|
||||
PriceThreshold *float64 `json:"price_threshold,optional"` // 提价标准阈值(可选)
|
||||
PriceFeeRate *float64 `json:"price_fee_rate,optional"` // 提价手续费比例(可选)
|
||||
}
|
||||
AdminUpdateAgentProductConfigResp {
|
||||
Success bool `json:"success"`
|
||||
|
||||
@@ -53,7 +53,6 @@ type (
|
||||
PaymentScene string `form:"payment_scene,optional"` // 支付平台
|
||||
Amount float64 `form:"amount,optional"` // 金额
|
||||
Status string `form:"status,optional"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
IsPromotion int64 `form:"is_promotion,optional,default=-1"` // 是否推广订单:0-否,1-是
|
||||
CreateTimeStart string `form:"create_time_start,optional"` // 创建时间开始
|
||||
CreateTimeEnd string `form:"create_time_end,optional"` // 创建时间结束
|
||||
PayTimeStart string `form:"pay_time_start,optional"` // 支付时间开始
|
||||
@@ -80,7 +79,6 @@ type (
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
PayTime string `json:"pay_time"` // 支付时间
|
||||
RefundTime string `json:"refund_time"` // 退款时间
|
||||
IsPromotion int64 `json:"is_promotion"` // 是否推广订单:0-否,1-是
|
||||
IsAgentOrder bool `json:"is_agent_order"` // 是否是代理订单
|
||||
AgentProcessStatus string `json:"agent_process_status"` // 代理事务处理状态:not_agent-非代理订单,success-处理成功,failed-处理失败,pending-待处理
|
||||
}
|
||||
@@ -102,7 +100,6 @@ type (
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
PayTime string `json:"pay_time"` // 支付时间
|
||||
RefundTime string `json:"refund_time"` // 退款时间
|
||||
IsPromotion int64 `json:"is_promotion"` // 是否推广订单:0-否,1-是
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
IsAgentOrder bool `json:"is_agent_order"` // 是否是代理订单
|
||||
AgentProcessStatus string `json:"agent_process_status"` // 代理事务处理状态:not_agent-非代理订单,success-处理成功,failed-处理失败,pending-待处理
|
||||
@@ -116,7 +113,6 @@ type (
|
||||
PaymentScene string `json:"payment_scene"` // 支付平台
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Status string `json:"status,default=pending"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
IsPromotion int64 `json:"is_promotion,default=0"` // 是否推广订单:0-否,1-是
|
||||
}
|
||||
// 创建响应
|
||||
AdminCreateOrderResp {
|
||||
@@ -134,7 +130,6 @@ type (
|
||||
Status *string `json:"status,optional"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
PayTime *string `json:"pay_time,optional"` // 支付时间
|
||||
RefundTime *string `json:"refund_time,optional"` // 退款时间
|
||||
IsPromotion *int64 `json:"is_promotion,optional"` // 是否推广订单:0-否,1-是
|
||||
}
|
||||
// 更新响应
|
||||
AdminUpdateOrderResp {
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "推广服务"
|
||||
desc: "推广服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/link
|
||||
group: admin_promotion
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取推广链接列表"
|
||||
@handler GetPromotionLinkList
|
||||
get /list (GetPromotionLinkListReq) returns (GetPromotionLinkListResp)
|
||||
|
||||
@doc "获取推广链接详情"
|
||||
@handler GetPromotionLinkDetail
|
||||
get /detail/:id (GetPromotionLinkDetailReq) returns (GetPromotionLinkDetailResp)
|
||||
|
||||
@doc "创建推广链接"
|
||||
@handler CreatePromotionLink
|
||||
post /create (CreatePromotionLinkReq) returns (CreatePromotionLinkResp)
|
||||
|
||||
@doc "更新推广链接"
|
||||
@handler UpdatePromotionLink
|
||||
put /update/:id (UpdatePromotionLinkReq) returns (UpdatePromotionLinkResp)
|
||||
|
||||
@doc "删除推广链接"
|
||||
@handler DeletePromotionLink
|
||||
delete /delete/:id (DeletePromotionLinkReq) returns (DeletePromotionLinkResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
GetPromotionLinkListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Name string `form:"name,optional"` // 链接名称
|
||||
Url string `form:"url,optional"` // 推广链接URL
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
GetPromotionLinkListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []PromotionLinkItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
PromotionLinkItem {
|
||||
Id int64 `json:"id"` // 链接ID
|
||||
Name string `json:"name"` // 链接名称
|
||||
Url string `json:"url"` // 推广链接URL
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
PayAmount string `json:"pay_amount"` // 付费金额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
LastClickTime string `json:"last_click_time,optional"` // 最后点击时间
|
||||
LastPayTime string `json:"last_pay_time,optional"` // 最后付费时间
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
GetPromotionLinkDetailReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetPromotionLinkDetailResp {
|
||||
Name string `json:"name"` // 链接名称
|
||||
Url string `json:"url"` // 推广链接URL
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
PayAmount string `json:"pay_amount"` // 付费金额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
LastClickTime string `json:"last_click_time,optional"` // 最后点击时间
|
||||
LastPayTime string `json:"last_pay_time,optional"` // 最后付费时间
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
CreatePromotionLinkReq {
|
||||
Name string `json:"name"` // 链接名称
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
CreatePromotionLinkResp {
|
||||
Id int64 `json:"id"` // 链接ID
|
||||
Url string `json:"url"` // 生成的推广链接URL
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdatePromotionLinkReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
Name *string `json:"name,optional"` // 链接名称
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
UpdatePromotionLinkResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
DeletePromotionLinkReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
DeletePromotionLinkResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/link
|
||||
group: admin_promotion
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "记录链接点击"
|
||||
@handler RecordLinkClick
|
||||
get /record/:path (RecordLinkClickReq) returns (RecordLinkClickResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 记录链接点击请求
|
||||
RecordLinkClickReq {
|
||||
Path string `path:"path"` // 链接路径
|
||||
}
|
||||
|
||||
// 记录链接点击响应
|
||||
RecordLinkClickResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/stats
|
||||
group: admin_promotion
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取推广历史记录"
|
||||
@handler GetPromotionStatsHistory
|
||||
get /history (GetPromotionStatsHistoryReq) returns ([]PromotionStatsHistoryItem)
|
||||
|
||||
@doc "获取推广总统计"
|
||||
@handler GetPromotionStatsTotal
|
||||
get /total (GetPromotionStatsTotalReq) returns (GetPromotionStatsTotalResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 获取推广历史记录请求
|
||||
GetPromotionStatsHistoryReq {
|
||||
StartDate string `form:"start_date"` // 开始日期,格式:YYYY-MM-DD
|
||||
EndDate string `form:"end_date"` // 结束日期,格式:YYYY-MM-DD
|
||||
}
|
||||
|
||||
// 推广历史记录项
|
||||
PromotionStatsHistoryItem {
|
||||
Id int64 `json:"id"` // 记录ID
|
||||
LinkId int64 `json:"link_id"` // 链接ID
|
||||
PayAmount float64 `json:"pay_amount"` // 金额
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
StatsDate string `json:"stats_date"` // 统计日期
|
||||
}
|
||||
|
||||
// 获取推广总统计请求
|
||||
GetPromotionStatsTotalReq {
|
||||
}
|
||||
|
||||
// 获取推广总统计响应
|
||||
GetPromotionStatsTotalResp {
|
||||
TodayPayAmount float64 `json:"today_pay_amount"` // 今日金额
|
||||
TodayClickCount int64 `json:"today_click_count"` // 今日点击数
|
||||
TodayPayCount int64 `json:"today_pay_count"` // 今日付费次数
|
||||
TotalPayAmount float64 `json:"total_pay_amount"` // 总金额
|
||||
TotalClickCount int64 `json:"total_click_count"` // 总点击数
|
||||
TotalPayCount int64 `json:"total_pay_count"` // 总付费次数
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user