This commit is contained in:
2025-12-02 19:57:10 +08:00
parent 3440744179
commit 08ff223ff8
188 changed files with 12337 additions and 7212 deletions

View File

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

View File

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

View File

@@ -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"` // 总付费次数
}
)

View File

@@ -32,11 +32,15 @@ type (
LinkIdentifier string `form:"link_identifier"` // 推广链接标识
}
GetLinkDataResp {
AgentId int64 `json:"agent_id"` // 代理ID
ProductId int64 `json:"product_id"` // 产品ID
SetPrice float64 `json:"set_price"` // 代理设定价格
ActualBasePrice float64 `json:"actual_base_price"` // 实际底价
ProductName string `json:"product_name"` // 产品名称
AgentId int64 `json:"agent_id"` // 代理ID
ProductId int64 `json:"product_id"` // 产品ID
SetPrice float64 `json:"set_price"` // 代理设定价格
ActualBasePrice float64 `json:"actual_base_price"` // 实际底价
ProductName string `json:"product_name"` // 产品名称
ProductEn string `json:"product_en"` // 产品英文标识
SellPrice float64 `json:"sell_price"` // 销售价格(使用代理设定价格)
Description string `json:"description"` // 产品描述
Features []Feature `json:"features"` // 产品功能列表
}
AgentApplyReq {
Region string `json:"region,optional"` // 区域(可选)
@@ -94,10 +98,33 @@ type (
Remark string `json:"remark"` // 备注
CreateTime string `json:"create_time"` // 创建时间
}
// 删除邀请码
DeleteInviteCodeReq {
Id int64 `json:"id"` // 邀请码ID
}
DeleteInviteCodeResp {}
// 获取邀请链接
GetInviteLinkReq {
InviteCode string `form:"invite_code"` // 邀请码
TargetPath string `form:"target_path,optional"` // 目标地址(可选,默认为注册页面)
}
GetInviteLinkResp {
InviteLink string `json:"invite_link"` // 邀请链接
QrCodeUrl string `json:"qr_code_url"` // 二维码URL
}
// 获取代理等级特权信息
GetLevelPrivilegeResp {
Levels []LevelPrivilegeItem `json:"levels"` // 各等级特权信息列表
}
LevelPrivilegeItem {
Level int64 `json:"level"` // 等级1=普通2=黄金3=钻石
LevelName string `json:"level_name"` // 等级名称
LevelBonus float64 `json:"level_bonus"` // 等级加成(元)
PriceReduction float64 `json:"price_reduction"` // 底价降低(元,相对于当前等级)
PromoteRebate string `json:"promote_rebate"` // 推广返佣说明
MaxPromoteRebate float64 `json:"max_promote_rebate"` // 最高推广返佣金额(元)
UpgradeRebate string `json:"upgrade_rebate"` // 下级升级返佣说明
Privileges []string `json:"privileges"` // 特权列表
CanUpgradeSubordinate bool `json:"can_upgrade_subordinate"` // 是否可以升级下级
}
)
@@ -127,10 +154,22 @@ service main {
@handler GetTeamStatistics
get /team/statistics returns (TeamStatisticsResp)
// 获取转化率统计
@handler GetConversionRate
get /conversion/rate returns (ConversionRateResp)
// 获取下级列表
@handler GetSubordinateList
get /subordinate/list (GetSubordinateListReq) returns (GetSubordinateListResp)
// 获取下级贡献详情
@handler GetSubordinateContributionDetail
get /subordinate/contribution/detail (GetSubordinateContributionDetailReq) returns (GetSubordinateContributionDetailResp)
// 获取团队列表
@handler GetTeamList
get /team/list (GetTeamListReq) returns (GetTeamListResp)
// 获取收益信息
@handler GetRevenueInfo
get /revenue returns (GetRevenueInfoResp)
@@ -139,10 +178,14 @@ service main {
@handler GetCommissionList
get /commission/list (GetCommissionListReq) returns (GetCommissionListResp)
// 获取返佣记录
// 获取返佣记录(推广返佣)
@handler GetRebateList
get /rebate/list (GetRebateListReq) returns (GetRebateListResp)
// 获取升级返佣记录
@handler GetUpgradeRebateList
get /rebate/upgrade/list (GetUpgradeRebateListReq) returns (GetUpgradeRebateListResp)
// 获取升级记录
@handler GetUpgradeList
get /upgrade/list (GetUpgradeListReq) returns (GetUpgradeListResp)
@@ -175,9 +218,17 @@ service main {
@handler GetInviteCodeList
get /invite_code/list (GetInviteCodeListReq) returns (GetInviteCodeListResp)
// 获取邀请链接
// 删除邀请码
@handler DeleteInviteCode
post /invite_code/delete (DeleteInviteCodeReq) returns (DeleteInviteCodeResp)
// 获取邀请链接(根据邀请码生成)
@handler GetInviteLink
get /invite_link returns (GetInviteLinkResp)
get /invite_link (GetInviteLinkReq) returns (GetInviteLinkResp)
// 获取代理等级特权信息
@handler GetLevelPrivilege
get /level/privilege returns (GetLevelPrivilegeResp)
}
type (
@@ -194,11 +245,13 @@ type (
}
// 生成推广链接
AgentGeneratingLinkReq {
ProductId int64 `json:"product_id"` // 产品ID
SetPrice float64 `json:"set_price"` // 设定价格
ProductId int64 `json:"product_id"` // 产品ID
SetPrice float64 `json:"set_price"` // 设定价格
TargetPath string `json:"target_path,optional"` // 目标地址(可选,默认为推广报告页面)
}
AgentGeneratingLinkResp {
LinkIdentifier string `json:"link_identifier"` // 推广链接标识
FullLink string `json:"full_link"` // 完整短链URL
}
// 产品配置
AgentProductConfigResp {
@@ -207,8 +260,7 @@ type (
ProductConfigItem {
ProductId int64 `json:"product_id"` // 产品ID
ProductName string `json:"product_name"` // 产品名称
BasePrice float64 `json:"base_price"` // 基础底价
LevelBonus float64 `json:"level_bonus"` // 等级加成
ProductEn string `json:"product_en"` // 产品英文标识
ActualBasePrice float64 `json:"actual_base_price"` // 实际底价
PriceRangeMin float64 `json:"price_range_min"` // 最低价格
PriceRangeMax float64 `json:"price_range_max"` // 最高价格
@@ -217,15 +269,31 @@ type (
}
// 团队统计
TeamStatisticsResp {
TotalCount int64 `json:"total_count"` // 团队总人数(包括自己)
DirectCount int64 `json:"direct_count"` // 直接下级数量
IndirectCount int64 `json:"indirect_count"` // 间接下级数量
ByLevel TeamLevelStats `json:"by_level"` // 按等级统计
TotalCount int64 `json:"total_count"` // 团队总人数(包括自己)
DirectCount int64 `json:"direct_count"` // 直接下级数量
IndirectCount int64 `json:"indirect_count"` // 间接下级数量
GoldCount int64 `json:"gold_count"` // 黄金代理数量
NormalCount int64 `json:"normal_count"` // 普通代理数量
TodayNewMembers int64 `json:"today_new_members"` // 今日新增成员
MonthNewMembers int64 `json:"month_new_members"` // 本月新增成员
}
TeamLevelStats {
Diamond int64 `json:"diamond"` // 钻石数量
Gold int64 `json:"gold"` // 黄金数量
Normal int64 `json:"normal"` // 普通数量
// 转化率统计
ConversionRateResp {
MyConversionRate ConversionRateData `json:"my_conversion_rate"` // 我的转化率
SubordinateConversionRate ConversionRateData `json:"subordinate_conversion_rate"` // 我的下级转化率
}
ConversionRateData {
Daily []PeriodConversionData `json:"daily"` // 日统计(今日、昨日、前日)
Weekly []PeriodConversionData `json:"weekly"` // 周统计(这周、前一周、前两周)
Monthly []PeriodConversionData `json:"monthly"` // 月统计(本月、上月、前两月)
}
PeriodConversionData {
PeriodLabel string `json:"period_label"` // 时间段标签(如:今日、昨日、前日)
QueryUsers int64 `json:"query_users"` // 查询订单数(订单数量,不是用户数)
PaidUsers int64 `json:"paid_users"` // 付费订单数(订单数量,不是用户数)
TotalAmount float64 `json:"total_amount"` // 总金额(已支付订单的总金额)
QueryUserCount int64 `json:"query_user_count"` // 查询用户数去重user_id后的用户数量
PaidUserCount int64 `json:"paid_user_count"` // 付费用户数去重user_id后的用户数量
}
// 下级列表
GetSubordinateListReq {
@@ -245,12 +313,103 @@ type (
TotalOrders int64 `json:"total_orders"` // 总订单数
TotalAmount float64 `json:"total_amount"` // 总金额
}
// 下级贡献详情
GetSubordinateContributionDetailReq {
SubordinateId int64 `form:"subordinate_id"` // 下级代理ID
Page int64 `form:"page"` // 页码
PageSize int64 `form:"page_size"` // 每页数量
TabType string `form:"tab_type,optional"` // 标签页类型order=订单列表invite=邀请列表
}
GetSubordinateContributionDetailResp {
Mobile string `json:"mobile"` // 手机号
LevelName string `json:"level_name"` // 等级名称
CreateTime string `json:"create_time"` // 创建时间
OrderStats OrderStatistics `json:"order_stats"` // 订单统计(仅统计有返佣的订单)
RebateStats RebateStatistics `json:"rebate_stats"` // 返佣统计
InviteStats InviteStatistics `json:"invite_stats"` // 邀请统计
OrderList []OrderItem `json:"order_list"` // 订单列表(仅有贡献的订单)
InviteList []InviteItem `json:"invite_list"` // 邀请列表
OrderListTotal int64 `json:"order_list_total"` // 订单列表总数
InviteListTotal int64 `json:"invite_list_total"` // 邀请列表总数
}
OrderStatistics {
TotalOrders int64 `json:"total_orders"` // 总订单量(仅统计有返佣的订单)
MonthOrders int64 `json:"month_orders"` // 月订单
TodayOrders int64 `json:"today_orders"` // 今日订单
}
RebateStatistics {
TotalRebateAmount float64 `json:"total_rebate_amount"` // 总贡献返佣金额
TodayRebateAmount float64 `json:"today_rebate_amount"` // 今日贡献返佣金额
MonthRebateAmount float64 `json:"month_rebate_amount"` // 月贡献返佣金额
}
InviteStatistics {
TotalInvites int64 `json:"total_invites"` // 总的邀请
TodayInvites int64 `json:"today_invites"` // 今日邀请
MonthInvites int64 `json:"month_invites"` // 月邀请
}
OrderItem {
OrderNo string `json:"order_no"` // 订单号
ProductId int64 `json:"product_id"` // 产品ID
ProductName string `json:"product_name"` // 产品名称
OrderAmount float64 `json:"order_amount"` // 订单金额
RebateAmount float64 `json:"rebate_amount"` // 返佣金额
CreateTime string `json:"create_time"` // 创建时间
}
InviteItem {
AgentId int64 `json:"agent_id"` // 代理ID
Level int64 `json:"level"` // 等级
LevelName string `json:"level_name"` // 等级名称
Mobile string `json:"mobile"` // 手机号
CreateTime string `json:"create_time"` // 邀请时间
}
// 团队列表
GetTeamListReq {
Page int64 `form:"page"` // 页码
PageSize int64 `form:"page_size"` // 每页数量
Mobile string `form:"mobile,optional"` // 手机号(可选,用于搜索)
}
GetTeamListResp {
Statistics TeamStatistics `json:"statistics"` // 统计数据
Total int64 `json:"total"` // 总数
List []TeamMemberItem `json:"list"` // 列表
}
TeamStatistics {
TotalMembers int64 `json:"total_members"` // 团队成员总数
TodayNewMembers int64 `json:"today_new_members"` // 团队人员今日新增
MonthNewMembers int64 `json:"month_new_members"` // 团队人员月新增
TotalQueries int64 `json:"total_queries"` // 团队总查询总量
TodayPromotions int64 `json:"today_promotions"` // 团队今日推广量
MonthPromotions int64 `json:"month_promotions"` // 团队月推广量
TotalEarnings float64 `json:"total_earnings"` // 依靠团队得到的总收益
TodayEarnings float64 `json:"today_earnings"` // 今日收益
MonthEarnings float64 `json:"month_earnings"` // 月收益
}
TeamMemberItem {
AgentId int64 `json:"agent_id"` // 代理ID
Level int64 `json:"level"` // 等级
LevelName string `json:"level_name"` // 等级名称
Mobile string `json:"mobile"` // 手机号
CreateTime string `json:"create_time"` // 加入团队时间
TodayQueries int64 `json:"today_queries"` // 当日查询量
TotalQueries int64 `json:"total_queries"` // 总查询量
TotalRebateAmount float64 `json:"total_rebate_amount"` // 返佣给我的总金额
TodayRebateAmount float64 `json:"today_rebate_amount"` // 返佣给我的今日金额
TotalInvites int64 `json:"total_invites"` // 邀请加入团队的总人数
TodayInvites int64 `json:"today_invites"` // 邀请加入团队的今日人数
IsDirect bool `json:"is_direct"` // 是否直接下级
}
// 收益信息
GetRevenueInfoResp {
Balance float64 `json:"balance"` // 可用余额
FrozenBalance float64 `json:"frozen_balance"` // 冻结余额
TotalEarnings float64 `json:"total_earnings"` // 累计收益
TotalEarnings float64 `json:"total_earnings"` // 累计收益(钱包总收益)
WithdrawnAmount float64 `json:"withdrawn_amount"` // 累计提现
CommissionTotal float64 `json:"commission_total"` // 佣金累计总收益(推广订单获得的佣金)
CommissionToday float64 `json:"commission_today"` // 佣金今日收益
CommissionMonth float64 `json:"commission_month"` // 佣金本月收益
RebateTotal float64 `json:"rebate_total"` // 返佣累计总收益(包括推广返佣和升级返佣)
RebateToday float64 `json:"rebate_today"` // 返佣今日收益
RebateMonth float64 `json:"rebate_month"` // 返佣本月收益
}
// 佣金记录
GetCommissionListReq {
@@ -264,27 +423,51 @@ type (
CommissionItem {
Id int64 `json:"id"` // 记录ID
OrderId int64 `json:"order_id"` // 订单ID
OrderNo string `json:"order_no"` // 订单号
ProductName string `json:"product_name"` // 产品名称
Amount float64 `json:"amount"` // 佣金金额
Status int64 `json:"status"` // 状态1=已发放2=已冻结3=已取消
CreateTime string `json:"create_time"` // 创建时间
}
// 返佣记录
// 返佣记录(推广返佣)
GetRebateListReq {
Page int64 `form:"page"` // 页码
PageSize int64 `form:"page_size"` // 每页数量
Page int64 `form:"page"` // 页码
PageSize int64 `form:"page_size"` // 每页数量
RebateType *int64 `form:"rebate_type,optional"` // 返佣类型可选1=直接上级返佣2=钻石上级返佣3=黄金上级返佣
}
GetRebateListResp {
Total int64 `json:"total"` // 总数
List []RebateItem `json:"list"` // 列表
}
RebateItem {
Id int64 `json:"id"` // 记录ID
SourceAgentId int64 `json:"source_agent_id"` // 来源代理ID
OrderId int64 `json:"order_id"` // 订单ID
RebateType int64 `json:"rebate_type"` // 返佣类型1=直接上级2=钻石上级3=黄金上级
Amount float64 `json:"amount"` // 返佣金额
CreateTime string `json:"create_time"` // 创建时间
Id int64 `json:"id"` // 记录ID
SourceAgentId int64 `json:"source_agent_id"` // 来源代理ID
SourceAgentMobile string `json:"source_agent_mobile"` // 来源代理手机号
SourceAgentLevel int64 `json:"source_agent_level"` // 来源代理等级1=普通2=黄金3=钻石
OrderId int64 `json:"order_id"` // 订单ID
OrderNo string `json:"order_no"` // 订单号
RebateType int64 `json:"rebate_type"` // 返佣类型1=直接上级2=钻石上级3=黄金上级
Amount float64 `json:"amount"` // 返佣金额
CreateTime string `json:"create_time"` // 创建时间
}
// 升级返佣记录
GetUpgradeRebateListReq {
Page int64 `form:"page"` // 页码
PageSize int64 `form:"page_size"` // 每页数量
}
GetUpgradeRebateListResp {
Total int64 `json:"total"` // 总数
List []UpgradeRebateItem `json:"list"` // 列表
}
UpgradeRebateItem {
Id int64 `json:"id"` // 记录ID
SourceAgentId int64 `json:"source_agent_id"` // 来源代理ID升级的代理
SourceAgentMobile string `json:"source_agent_mobile"` // 来源代理手机号
OrderNo string `json:"order_no"` // 订单号
FromLevel int64 `json:"from_level"` // 原等级
ToLevel int64 `json:"to_level"` // 目标等级
Amount float64 `json:"amount"` // 返佣金额
CreateTime string `json:"create_time"` // 创建时间
}
// 升级记录
GetUpgradeListReq {
@@ -365,3 +548,19 @@ type (
}
)
// ============================================
// 短链重定向接口公开访问不需要认证和api前缀
// ============================================
@server (
group: agent
)
service main {
// 短链重定向
@handler ShortLinkRedirect
get /s/:shortCode returns (ShortLinkRedirectResp)
}
type (
ShortLinkRedirectResp {}
)

View File

@@ -46,8 +46,8 @@ service main {
type (
PaymentReq {
Id string `json:"id"`
PayMethod string `json:"pay_method"`
PayType string `json:"pay_type" validate:"required,oneof=query agent_vip"`
PayMethod string `json:"pay_method"` // 支付方式: wechat, alipay, appleiap, test(仅开发环境), test_empty(仅开发环境-空报告模式)
PayType string `json:"pay_type" validate:"required,oneof=query agent_vip agent_upgrade"`
}
PaymentResp {
PrepayData interface{} `json:"prepay_data"`

View File

@@ -18,7 +18,6 @@ import "./front/authorization.api"
import "./admin/auth.api"
import "./admin/menu.api"
import "./admin/role.api"
import "./admin/promotion.api"
import "./admin/order.api"
import "./admin/admin_user.api"
import "./admin/platform_user.api"