212 lines
6.8 KiB
Plaintext
212 lines
6.8 KiB
Plaintext
|
syntax = "v1"
|
|||
|
|
|||
|
info (
|
|||
|
title: "代理服务"
|
|||
|
desc: "代理服务接口"
|
|||
|
author: "Liangzai"
|
|||
|
email: "2440983361@qq.com"
|
|||
|
version: "v1"
|
|||
|
)
|
|||
|
|
|||
|
type AgentProductConfig {
|
|||
|
ProductID int64 `json:"product_id"`
|
|||
|
CostPrice float64 `json:"cost_price"`
|
|||
|
PriceRangeMin float64 `json:"price_range_min"`
|
|||
|
PriceRangeMax float64 `json:"price_range_max"`
|
|||
|
PPricingStandard float64 `json:"p_pricing_standard"`
|
|||
|
POverpricingRatio float64 `json:"p_overpricing_ratio"`
|
|||
|
APricingStandard float64 `json:"a_pricing_standard"`
|
|||
|
APricingEnd float64 `json:"a_pricing_end"`
|
|||
|
AOverpricingRatio float64 `json:"a_overpricing_ratio"`
|
|||
|
}
|
|||
|
|
|||
|
type AgentMembershipUserConfig {
|
|||
|
ProductID int64 `json:"product_id"`
|
|||
|
PriceIncreaseAmount float64 `json:"price_increase_amount"`
|
|||
|
PriceRangeFrom float64 `json:"price_range_from"`
|
|||
|
PriceRangeTo float64 `json:"price_range_to"`
|
|||
|
PriceRatio float64 `json:"price_ratio"`
|
|||
|
}
|
|||
|
|
|||
|
type ProductConfig {
|
|||
|
ProductID int64 `json:"product_id"`
|
|||
|
CostPrice float64 `json:"cost_price"`
|
|||
|
PriceRangeMin float64 `json:"price_range_min"`
|
|||
|
PriceRangeMax float64 `json:"price_range_max"`
|
|||
|
}
|
|||
|
|
|||
|
type (
|
|||
|
AgentInfoResp {
|
|||
|
status int64 `json:"status"` // 0=待审核,1=审核通过,2=审核未通过,3=未申请
|
|||
|
isAgent bool `json:"is_agent"`
|
|||
|
agentID int64 `json:"agent_id"`
|
|||
|
level string `json:"level"`
|
|||
|
region string `json:"region"`
|
|||
|
mobile string `json:"mobile"`
|
|||
|
wechatID string `json:"wechat_id"`
|
|||
|
}
|
|||
|
// 代理申请请求参数
|
|||
|
AgentApplyReq {
|
|||
|
Region string `json:"region"`
|
|||
|
Mobile string `json:"mobile"`
|
|||
|
WechatID string `json:"wechat_id"`
|
|||
|
Code string `json:"code"`
|
|||
|
Ancestor string `json:"ancestor,optional"`
|
|||
|
}
|
|||
|
AgentApplyResp{
|
|||
|
AccessToken string `json:"accessToken"`
|
|||
|
AccessExpire int64 `json:"accessExpire"`
|
|||
|
RefreshAfter int64 `json:"refreshAfter"`
|
|||
|
}
|
|||
|
// 查询代理申请状态响应
|
|||
|
AgentAuditStatusResp {
|
|||
|
Status int64 `json:"status"` // 0=待审核,1=审核通过,2=审核未通过
|
|||
|
AuditReason string `json:"audit_reason"`
|
|||
|
}
|
|||
|
AgentGeneratingLinkReq {
|
|||
|
Product string `json:"product"`
|
|||
|
Price string `json:"price"`
|
|||
|
}
|
|||
|
AgentGeneratingLinkResp {
|
|||
|
LinkIdentifier string `json:"link_identifier"`
|
|||
|
}
|
|||
|
GetLinkDataReq {
|
|||
|
LinkIdentifier string `form:"link_identifier"`
|
|||
|
}
|
|||
|
GetLinkDataResp {
|
|||
|
Product
|
|||
|
}
|
|||
|
AgentProductConfigResp {
|
|||
|
AgentProductConfig []AgentProductConfig
|
|||
|
}
|
|||
|
// 开通代理会员请求参数
|
|||
|
AgentActivateMembershipReq {
|
|||
|
Mobile string `json:"mobile"`
|
|||
|
Type string `json:"type,oneof=VIP SVIP"` // 会员类型:vip/svip
|
|||
|
Amount float64 `json:"amount"`
|
|||
|
PaymentMethod string `json:"payment_method"`
|
|||
|
TransactionId string `json:"transaction_id"`
|
|||
|
}
|
|||
|
// 开通代理会员响应
|
|||
|
AgentActivateMembershipResp {
|
|||
|
MembershipType string `json:"membership_type"` // 最终开通的会员类型
|
|||
|
ExpireTime string `json:"expire_time"` // 到期时间
|
|||
|
}
|
|||
|
// 获取会员当前配置
|
|||
|
AgentMembershipProductConfigReq {
|
|||
|
ProductID int64 `form:"product_id"`
|
|||
|
}
|
|||
|
// 获取会员当前配置
|
|||
|
AgentMembershipProductConfigResp {
|
|||
|
AgentMembershipUserConfig AgentMembershipUserConfig `json:"agent_membership_user_config"`
|
|||
|
ProductConfig ProductConfig `json:"product_config"`
|
|||
|
PriceIncreaseMax float64 `json:"price_increase_max"`
|
|||
|
PriceIncreaseAmount float64 `json:"price_increase_amount"`
|
|||
|
PriceRatio float64 `json:"price_ratio"`
|
|||
|
}
|
|||
|
SaveAgentMembershipUserConfigReq {
|
|||
|
ProductID int64 `json:"product_id"`
|
|||
|
PriceIncreaseAmount float64 `json:"price_increase_amount"`
|
|||
|
PriceRangeFrom float64 `json:"price_range_from"`
|
|||
|
PriceRangeTo float64 `json:"price_range_to"`
|
|||
|
PriceRatio float64 `json:"price_ratio"`
|
|||
|
}
|
|||
|
)
|
|||
|
|
|||
|
type (
|
|||
|
// 收益信息
|
|||
|
GetAgentRevenueInfoReq {}
|
|||
|
GetAgentRevenueInfoResp {
|
|||
|
Balance float64 `json:"balance"`
|
|||
|
FrozenBalance float64 `json:"frozen_balance"`
|
|||
|
TotalEarnings float64 `json:"total_earnings"`
|
|||
|
DirectPush DirectPushReport `json:"direct_push"` // 直推报告数据
|
|||
|
ActiveReward ActiveReward `json:"active_reward"` // 活跃下级奖励数据
|
|||
|
}
|
|||
|
// 直推报告数据结构
|
|||
|
DirectPushReport {
|
|||
|
TotalCommission float64 `json:"total_commission"`
|
|||
|
TotalReport int `json:"total_report"`
|
|||
|
Today TimeRangeReport `json:"today"` // 近24小时数据
|
|||
|
Last7D TimeRangeReport `json:"last7d"` // 近7天数据
|
|||
|
Last30D TimeRangeReport `json:"last30d"` // 近30天数据
|
|||
|
}
|
|||
|
// 活跃下级奖励数据结构
|
|||
|
ActiveReward {
|
|||
|
TotalReward float64 `json:"total_reward"`
|
|||
|
Today ActiveRewardData `json:"today"` // 今日数据
|
|||
|
Last7D ActiveRewardData `json:"last7d"` // 近7天数据
|
|||
|
Last30D ActiveRewardData `json:"last30d"` // 近30天数据
|
|||
|
}
|
|||
|
// 通用时间范围报告结构
|
|||
|
TimeRangeReport {
|
|||
|
Commission float64 `json:"commission"` // 佣金
|
|||
|
Report int `json:"report"` // 报告量
|
|||
|
}
|
|||
|
// 活跃奖励专用结构
|
|||
|
ActiveRewardData {
|
|||
|
NewActiveReward float64 `json:"active_reward"`
|
|||
|
SubPromoteReward float64 `json:"sub_promote_reward"`
|
|||
|
SubUpgradeReward float64 `json:"sub_upgrade_reward"`
|
|||
|
SubWithdrawReward float64 `json:"sub_withdraw_reward"`
|
|||
|
}
|
|||
|
)
|
|||
|
|
|||
|
type (
|
|||
|
Commission {
|
|||
|
ProductName string `json:"product_name"`
|
|||
|
Amount float64 `json:"amount"`
|
|||
|
CreateTime string `json:"create_time"`
|
|||
|
}
|
|||
|
GetCommissionReq {
|
|||
|
Page int64 `form:"page"` // 页码
|
|||
|
PageSize int64 `form:"page_size"` // 每页数据量
|
|||
|
}
|
|||
|
GetCommissionResp {
|
|||
|
Total int64 `json:"total"` // 总记录数
|
|||
|
List []Commission `json:"list"` // 查询列表
|
|||
|
}
|
|||
|
Rewards {
|
|||
|
Type string `json:"type"`
|
|||
|
Amount float64 `json:"amount"`
|
|||
|
CreateTime string `json:"create_time"`
|
|||
|
}
|
|||
|
GetRewardsReq {
|
|||
|
Page int64 `form:"page"` // 页码
|
|||
|
PageSize int64 `form:"page_size"` // 每页数据量
|
|||
|
}
|
|||
|
GetRewardsResp {
|
|||
|
Total int64 `json:"total"` // 总记录数
|
|||
|
List []Rewards `json:"list"` // 查询列表
|
|||
|
}
|
|||
|
Withdrawal {
|
|||
|
Status int64 `json:"status"`
|
|||
|
Amount float64 `json:"amount"`
|
|||
|
WithdrawalNo string `json:"withdrawal_no"`
|
|||
|
Remark string `json:"remark"`
|
|||
|
payeeAccount string `json:"payee_account"`
|
|||
|
CreateTime string `json:"create_time"`
|
|||
|
}
|
|||
|
GetWithdrawalReq {
|
|||
|
Page int64 `form:"page"` // 页码
|
|||
|
PageSize int64 `form:"page_size"` // 每页数据量
|
|||
|
}
|
|||
|
GetWithdrawalResp {
|
|||
|
Total int64 `json:"total"` // 总记录数
|
|||
|
List []Withdrawal `json:"list"` // 查询列表
|
|||
|
}
|
|||
|
)
|
|||
|
|
|||
|
type (
|
|||
|
WithdrawalReq {
|
|||
|
Amount float64 `json:"amount"` // 提现金额
|
|||
|
payeeAccount string `json:"payee_account"`
|
|||
|
payeeName string `json:"payee_name"`
|
|||
|
}
|
|||
|
WithdrawalResp {
|
|||
|
Status int64 `json:"status"` // 1申请中 2成功 3失败
|
|||
|
failMsg string `json:"fail_msg"`
|
|||
|
}
|
|||
|
)
|
|||
|
|