Compare commits

...

5 Commits

Author SHA1 Message Date
Mrx
c4cc15f853 f 2026-02-28 17:41:30 +08:00
Mrx
fd229f0d59 add 2026-02-27 12:53:27 +08:00
Mrx
5089b37ef1 f 2026-02-06 11:08:46 +08:00
f31c2d7293 f 2026-02-01 18:08:11 +08:00
1217ba119b f 2026-02-01 18:06:07 +08:00
18 changed files with 546 additions and 304 deletions

View File

@@ -8,9 +8,9 @@ info (
) )
// 代理管理接口 // 代理管理接口
@server( @server (
prefix: /api/v1/admin/agent prefix: /api/v1/admin/agent
group: admin_agent group: admin_agent
middleware: AdminAuthInterceptor middleware: AdminAuthInterceptor
) )
service main { service main {
@@ -109,491 +109,430 @@ service main {
// 代理钱包流水分页查询 // 代理钱包流水分页查询
@handler AdminGetAgentWalletTransactionList @handler AdminGetAgentWalletTransactionList
get /wallet-transaction/list (AdminGetAgentWalletTransactionListReq) returns (AdminGetAgentWalletTransactionListResp) get /wallet-transaction/list (AdminGetAgentWalletTransactionListReq) returns (AdminGetAgentWalletTransactionListResp)
}
}
type ( type (
// 代理分页查询请求 // 代理分页查询请求
AdminGetAgentListReq { AdminGetAgentListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
Mobile *string `form:"mobile,optional"` // 手机号(可选) Mobile *string `form:"mobile,optional"` // 手机号(可选)
Region *string `form:"region,optional"` // 区域(可选) Region *string `form:"region,optional"` // 区域(可选)
ParentAgentId *int64 `form:"parent_agent_id,optional"` // 上级代理ID可选 ParentAgentId *int64 `form:"parent_agent_id,optional"` // 上级代理ID可选
} }
// 代理列表项 // 代理列表项
AgentListItem { AgentListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
UserId int64 `json:"user_id"` // 用户ID UserId int64 `json:"user_id"` // 用户ID
ParentAgentId int64 `json:"parent_agent_id"` // 上级代理ID ParentAgentId int64 `json:"parent_agent_id"` // 上级代理ID
LevelName string `json:"level_name"` // 等级名称 LevelName string `json:"level_name"` // 等级名称
Region string `json:"region"` // 区域 Region string `json:"region"` // 区域
Mobile string `json:"mobile"` // 手机号 Mobile string `json:"mobile"` // 手机号
MembershipExpiryTime string `json:"membership_expiry_time"` // 会员到期时间 MembershipExpiryTime string `json:"membership_expiry_time"` // 会员到期时间
Balance float64 `json:"balance"` // 钱包余额 Balance float64 `json:"balance"` // 钱包余额
TotalEarnings float64 `json:"total_earnings"` // 累计收益 TotalEarnings float64 `json:"total_earnings"` // 累计收益
FrozenBalance float64 `json:"frozen_balance"` // 冻结余额 FrozenBalance float64 `json:"frozen_balance"` // 冻结余额
WithdrawnAmount float64 `json:"withdrawn_amount"` // 提现总额 WithdrawnAmount float64 `json:"withdrawn_amount"` // 提现总额
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
IsRealNameVerified bool `json:"is_real_name_verified"` // 是否已实名认证 IsRealNameVerified bool `json:"is_real_name_verified"` // 是否已实名认证
RealName string `json:"real_name"` // 实名姓名 RealName string `json:"real_name"` // 实名姓名
IdCard string `json:"id_card"` // 身份证号 IdCard string `json:"id_card"` // 身份证号
RealNameStatus string `json:"real_name_status"` // 实名状态pending/approved/rejected RealNameStatus string `json:"real_name_status"` // 实名状态pending/approved/rejected
} }
// 代理分页查询响应 // 代理分页查询响应
AdminGetAgentListResp { AdminGetAgentListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentListItem `json:"items"` // 列表数据 Items []AgentListItem `json:"items"` // 列表数据
} }
// 代理推广链接分页查询请求 // 代理推广链接分页查询请求
AdminGetAgentLinkListReq { AdminGetAgentLinkListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
AgentId *int64 `form:"agent_id,optional"` // 代理ID可选 AgentId *int64 `form:"agent_id,optional"` // 代理ID可选
ProductName *string `form:"product_name,optional"` // 产品名(可选) ProductName *string `form:"product_name,optional"` // 产品名(可选)
LinkIdentifier *string `form:"link_identifier,optional"` // 推广码(可选) LinkIdentifier *string `form:"link_identifier,optional"` // 推广码(可选)
} }
// 代理推广链接列表项 // 代理推广链接列表项
AgentLinkListItem { AgentLinkListItem {
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
ProductName string `json:"product_name"` // 产品名 ProductName string `json:"product_name"` // 产品名
Price float64 `json:"price"` // 价格 Price float64 `json:"price"` // 价格
LinkIdentifier string `json:"link_identifier"` // 推广码 LinkIdentifier string `json:"link_identifier"` // 推广码
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理推广链接分页查询响应 // 代理推广链接分页查询响应
AdminGetAgentLinkListResp { AdminGetAgentLinkListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentLinkListItem `json:"items"` // 列表数据 Items []AgentLinkListItem `json:"items"` // 列表数据
} }
// 代理佣金分页查询请求 // 代理佣金分页查询请求
AdminGetAgentCommissionListReq { AdminGetAgentCommissionListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
AgentId *int64 `form:"agent_id,optional"` // 代理ID可选 AgentId *int64 `form:"agent_id,optional"` // 代理ID可选
OrderId *int64 `form:"order_id,optional"` // 订单ID可选 OrderId *int64 `form:"order_id,optional"` // 订单ID可选
ProductName *string `form:"product_name,optional"` // 产品名(可选) ProductName *string `form:"product_name,optional"` // 产品名(可选)
Status *int64 `form:"status,optional"` // 状态(可选) Status *int64 `form:"status,optional"` // 状态(可选)
CreateTimeStart *string `form:"create_time_start,optional"` // 创建时间开始(可选) CreateTimeStart *string `form:"create_time_start,optional"` // 创建时间开始(可选)
CreateTimeEnd *string `form:"create_time_end,optional"` // 创建时间结束(可选) CreateTimeEnd *string `form:"create_time_end,optional"` // 创建时间结束(可选)
} }
// 代理佣金列表项 // 代理佣金列表项
AgentCommissionListItem { AgentCommissionListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
OrderId int64 `json:"order_id"` // 订单ID OrderId int64 `json:"order_id"` // 订单ID
Amount float64 `json:"amount"` // 金额 Amount float64 `json:"amount"` // 金额
ProductName string `json:"product_name"` // 产品名 ProductName string `json:"product_name"` // 产品名
Status int64 `json:"status"` // 状态 Status int64 `json:"status"` // 状态
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理佣金分页查询响应 // 代理佣金分页查询响应
AdminGetAgentCommissionListResp { AdminGetAgentCommissionListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentCommissionListItem `json:"items"` // 列表数据 Items []AgentCommissionListItem `json:"items"` // 列表数据
} }
// 代理佣金状态更新请求 // 代理佣金状态更新请求
AdminUpdateAgentCommissionStatusReq { AdminUpdateAgentCommissionStatusReq {
Id int64 `json:"id"` // 佣金记录ID Id int64 `json:"id"` // 佣金记录ID
Status int64 `json:"status"` // 状态:0-已结算,1-冻结中,2-已取消 Status int64 `json:"status"` // 状态:0-已结算,1-冻结中,2-已取消
} }
// 代理佣金状态更新响应 // 代理佣金状态更新响应
AdminUpdateAgentCommissionStatusResp { AdminUpdateAgentCommissionStatusResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
} }
// 批量解冻代理佣金请求 // 批量解冻代理佣金请求
AdminBatchUnfreezeAgentCommissionReq { AdminBatchUnfreezeAgentCommissionReq {
AgentId *int64 `json:"agent_id,optional"` // 代理ID可选。如果不传则解冻所有冻结中的佣金 AgentId *int64 `json:"agent_id,optional"` // 代理ID可选。如果不传则解冻所有冻结中的佣金
} }
// 批量解冻代理佣金响应 // 批量解冻代理佣金响应
AdminBatchUnfreezeAgentCommissionResp { AdminBatchUnfreezeAgentCommissionResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
Count int64 `json:"count"` // 解冻的数量 Count int64 `json:"count"` // 解冻的数量
Amount float64 `json:"amount"` // 解冻的总金额 Amount float64 `json:"amount"` // 解冻的总金额
} }
// 代理奖励分页查询请求 // 代理奖励分页查询请求
AdminGetAgentRewardListReq { AdminGetAgentRewardListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
AgentId *int64 `form:"agent_id,optional"` // 代理ID可选 AgentId *int64 `form:"agent_id,optional"` // 代理ID可选
RelationAgentId *int64 `form:"relation_agent_id,optional"` // 关联代理ID可选 RelationAgentId *int64 `form:"relation_agent_id,optional"` // 关联代理ID可选
Type *string `form:"type,optional"` // 奖励类型(可选) Type *string `form:"type,optional"` // 奖励类型(可选)
} }
// 代理奖励列表项 // 代理奖励列表项
AgentRewardListItem { AgentRewardListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
RelationAgentId int64 `json:"relation_agent_id"` // 关联代理ID RelationAgentId int64 `json:"relation_agent_id"` // 关联代理ID
Amount float64 `json:"amount"` // 金额 Amount float64 `json:"amount"` // 金额
Type string `json:"type"` // 奖励类型 Type string `json:"type"` // 奖励类型
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理奖励分页查询响应 // 代理奖励分页查询响应
AdminGetAgentRewardListResp { AdminGetAgentRewardListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentRewardListItem `json:"items"` // 列表数据 Items []AgentRewardListItem `json:"items"` // 列表数据
} }
// 代理提现分页查询请求 // 代理提现分页查询请求
AdminGetAgentWithdrawalListReq { AdminGetAgentWithdrawalListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
AgentId *int64 `form:"agent_id,optional"` // 代理ID可选 AgentId *int64 `form:"agent_id,optional"` // 代理ID可选
Status *int64 `form:"status,optional"` // 状态(可选) Status *int64 `form:"status,optional"` // 状态(可选)
WithdrawNo *string `form:"withdraw_no,optional"` // 提现单号(可选) WithdrawNo *string `form:"withdraw_no,optional"` // 提现单号(可选)
WithdrawType *int64 `form:"withdraw_type,optional"` // 提现类型可选1-支付宝,2-银行卡 WithdrawType *int64 `form:"withdraw_type,optional"` // 提现类型可选1-支付宝,2-银行卡
} }
// 代理提现列表项 // 代理提现列表项
AgentWithdrawalListItem { AgentWithdrawalListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
WithdrawNo string `json:"withdraw_no"` // 提现单号 WithdrawNo string `json:"withdraw_no"` // 提现单号
Amount float64 `json:"amount"` // 金额 Amount float64 `json:"amount"` // 金额
ActualAmount float64 `json:"actual_amount"` // 实际到账金额(扣税后) ActualAmount float64 `json:"actual_amount"` // 实际到账金额(扣税后)
TaxAmount float64 `json:"tax_amount"` // 扣税金额 TaxAmount float64 `json:"tax_amount"` // 扣税金额
Status int64 `json:"status"` // 状态 TaxRate float64 `json:"tax_rate"` // 扣税比例,如 0.06 表示 6%
Status int64 `json:"status"` // 状态
PayeeAccount string `json:"payee_account"` // 收款账户 PayeeAccount string `json:"payee_account"` // 收款账户
Remark string `json:"remark"` // 备注 Remark string `json:"remark"` // 备注
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
WithdrawType int64 `json:"withdraw_type"` // 提现类型:1-支付宝,2-银行卡 WithdrawType int64 `json:"withdraw_type"` // 提现类型:1-支付宝,2-银行卡
BankCardNo string `json:"bank_card_no"` // 银行卡号 BankCardNo string `json:"bank_card_no"` // 银行卡号
BankName string `json:"bank_name"` // 开户支行 BankName string `json:"bank_name"` // 开户支行
PayeeName string `json:"payee_name"` // 收款人姓名 PayeeName string `json:"payee_name"` // 收款人姓名
} }
// 代理提现分页查询响应 // 代理提现分页查询响应
AdminGetAgentWithdrawalListResp { AdminGetAgentWithdrawalListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentWithdrawalListItem `json:"items"` // 列表数据 Items []AgentWithdrawalListItem `json:"items"` // 列表数据
} }
// 代理抽佣分页查询请求 // 代理抽佣分页查询请求
AdminGetAgentCommissionDeductionListReq { AdminGetAgentCommissionDeductionListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
AgentId *int64 `form:"agent_id,optional"` // 代理ID可选 AgentId *int64 `form:"agent_id,optional"` // 代理ID可选
ProductName *string `form:"product_name,optional"` // 产品名(可选) ProductName *string `form:"product_name,optional"` // 产品名(可选)
Type *string `form:"type,optional"` // 类型cost/pricing可选 Type *string `form:"type,optional"` // 类型cost/pricing可选
Status *int64 `form:"status,optional"` // 状态(可选) Status *int64 `form:"status,optional"` // 状态(可选)
} }
// 代理抽佣列表项 // 代理抽佣列表项
AgentCommissionDeductionListItem { AgentCommissionDeductionListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
DeductedAgentId int64 `json:"deducted_agent_id"` // 被扣代理ID DeductedAgentId int64 `json:"deducted_agent_id"` // 被扣代理ID
Amount float64 `json:"amount"` // 金额 Amount float64 `json:"amount"` // 金额
ProductName string `json:"product_name"` // 产品名 ProductName string `json:"product_name"` // 产品名
Type string `json:"type"` // 类型cost/pricing Type string `json:"type"` // 类型cost/pricing
Status int64 `json:"status"` // 状态 Status int64 `json:"status"` // 状态
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理抽佣分页查询响应 // 代理抽佣分页查询响应
AdminGetAgentCommissionDeductionListResp { AdminGetAgentCommissionDeductionListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentCommissionDeductionListItem `json:"items"` // 列表数据 Items []AgentCommissionDeductionListItem `json:"items"` // 列表数据
} }
// 平台抽佣分页查询请求 // 平台抽佣分页查询请求
AdminGetAgentPlatformDeductionListReq { AdminGetAgentPlatformDeductionListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
AgentId *int64 `form:"agent_id,optional"` // 代理ID可选 AgentId *int64 `form:"agent_id,optional"` // 代理ID可选
Type *string `form:"type,optional"` // 类型cost/pricing可选 Type *string `form:"type,optional"` // 类型cost/pricing可选
Status *int64 `form:"status,optional"` // 状态(可选) Status *int64 `form:"status,optional"` // 状态(可选)
} }
// 平台抽佣列表项 // 平台抽佣列表项
AgentPlatformDeductionListItem { AgentPlatformDeductionListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
Amount float64 `json:"amount"` // 金额 Amount float64 `json:"amount"` // 金额
Type string `json:"type"` // 类型cost/pricing Type string `json:"type"` // 类型cost/pricing
Status int64 `json:"status"` // 状态 Status int64 `json:"status"` // 状态
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 平台抽佣分页查询响应 // 平台抽佣分页查询响应
AdminGetAgentPlatformDeductionListResp { AdminGetAgentPlatformDeductionListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentPlatformDeductionListItem `json:"items"` // 列表数据 Items []AgentPlatformDeductionListItem `json:"items"` // 列表数据
} }
// 代理产品配置分页查询请求 // 代理产品配置分页查询请求
AdminGetAgentProductionConfigListReq { AdminGetAgentProductionConfigListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
ProductName *string `form:"product_name,optional"` // 产品名(可选) ProductName *string `form:"product_name,optional"` // 产品名(可选)
Id *int64 `form:"id,optional"` // 配置ID可选 Id *int64 `form:"id,optional"` // 配置ID可选
} }
// 代理产品配置分页查询响应 // 代理产品配置分页查询响应
AdminGetAgentProductionConfigListResp { AdminGetAgentProductionConfigListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentProductionConfigItem `json:"items"` // 列表数据 Items []AgentProductionConfigItem `json:"items"` // 列表数据
} }
// 代理产品配置列表项 // 代理产品配置列表项
AgentProductionConfigItem { AgentProductionConfigItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
ProductName string `json:"product_name"` // 产品名 ProductName string `json:"product_name"` // 产品名
CostPrice float64 `json:"cost_price"` // 成本 CostPrice float64 `json:"cost_price"` // 成本
PriceRangeMin float64 `json:"price_range_min"` // 最低定价 PriceRangeMin float64 `json:"price_range_min"` // 最低定价
PriceRangeMax float64 `json:"price_range_max"` // 最高定价 PriceRangeMax float64 `json:"price_range_max"` // 最高定价
PricingStandard float64 `json:"pricing_standard"` // 定价标准 PricingStandard float64 `json:"pricing_standard"` // 定价标准
OverpricingRatio float64 `json:"overpricing_ratio"` // 超价比例 OverpricingRatio float64 `json:"overpricing_ratio"` // 超价比例
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理产品配置编辑请求 // 代理产品配置编辑请求
AdminUpdateAgentProductionConfigReq { AdminUpdateAgentProductionConfigReq {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
CostPrice float64 `json:"cost_price"` // 成本 CostPrice float64 `json:"cost_price"` // 成本
PriceRangeMin float64 `json:"price_range_min"` // 最低定价 PriceRangeMin float64 `json:"price_range_min"` // 最低定价
PriceRangeMax float64 `json:"price_range_max"` // 最高定价 PriceRangeMax float64 `json:"price_range_max"` // 最高定价
PricingStandard float64 `json:"pricing_standard"` // 定价标准 PricingStandard float64 `json:"pricing_standard"` // 定价标准
OverpricingRatio float64 `json:"overpricing_ratio"` // 超价比例 OverpricingRatio float64 `json:"overpricing_ratio"` // 超价比例
} }
// 代理产品配置编辑响应 // 代理产品配置编辑响应
AdminUpdateAgentProductionConfigResp { AdminUpdateAgentProductionConfigResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
} }
// 代理会员充值订单分页查询请求 // 代理会员充值订单分页查询请求
AdminGetAgentMembershipRechargeOrderListReq { AdminGetAgentMembershipRechargeOrderListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
UserId *int64 `form:"user_id,optional"` // 用户ID可选 UserId *int64 `form:"user_id,optional"` // 用户ID可选
AgentId *int64 `form:"agent_id,optional"` // 代理ID可选 AgentId *int64 `form:"agent_id,optional"` // 代理ID可选
OrderNo *string `form:"order_no,optional"` // 订单号(可选) OrderNo *string `form:"order_no,optional"` // 订单号(可选)
PlatformOrderId *string `form:"platform_order_id,optional"` // 平台订单号(可选) PlatformOrderId *string `form:"platform_order_id,optional"` // 平台订单号(可选)
Status *string `form:"status,optional"` // 状态(可选) Status *string `form:"status,optional"` // 状态(可选)
PaymentMethod *string `form:"payment_method,optional"` // 支付方式(可选) PaymentMethod *string `form:"payment_method,optional"` // 支付方式(可选)
} }
// 代理会员充值订单列表项 // 代理会员充值订单列表项
AgentMembershipRechargeOrderListItem { AgentMembershipRechargeOrderListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
UserId int64 `json:"user_id"` // 用户ID UserId int64 `json:"user_id"` // 用户ID
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
LevelName string `json:"level_name"` // 等级名称 LevelName string `json:"level_name"` // 等级名称
Amount float64 `json:"amount"` // 金额 Amount float64 `json:"amount"` // 金额
PaymentMethod string `json:"payment_method"` // 支付方式 PaymentMethod string `json:"payment_method"` // 支付方式
OrderNo string `json:"order_no"` // 订单号 OrderNo string `json:"order_no"` // 订单号
PlatformOrderId string `json:"platform_order_id"` // 平台订单号 PlatformOrderId string `json:"platform_order_id"` // 平台订单号
Status string `json:"status"` // 状态 Status string `json:"status"` // 状态
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理会员充值订单分页查询响应 // 代理会员充值订单分页查询响应
AdminGetAgentMembershipRechargeOrderListResp { AdminGetAgentMembershipRechargeOrderListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentMembershipRechargeOrderListItem `json:"items"` // 列表数据 Items []AgentMembershipRechargeOrderListItem `json:"items"` // 列表数据
} }
// 代理会员配置分页查询请求 // 代理会员配置分页查询请求
AdminGetAgentMembershipConfigListReq { AdminGetAgentMembershipConfigListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
LevelName *string `form:"level_name,optional"` // 会员级别名称(可选) LevelName *string `form:"level_name,optional"` // 会员级别名称(可选)
} }
// 代理会员配置分页查询响应 // 代理会员配置分页查询响应
AdminGetAgentMembershipConfigListResp { AdminGetAgentMembershipConfigListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentMembershipConfigListItem `json:"items"` // 列表数据 Items []AgentMembershipConfigListItem `json:"items"` // 列表数据
} }
// 代理会员配置列表项 // 代理会员配置列表项
AgentMembershipConfigListItem { AgentMembershipConfigListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
LevelName string `json:"level_name"` // 会员级别名称 LevelName string `json:"level_name"` // 会员级别名称
Price *float64 `json:"price"` // 会员年费 Price *float64 `json:"price"` // 会员年费
ReportCommission *float64 `json:"report_commission"` // 直推报告收益 ReportCommission *float64 `json:"report_commission"` // 直推报告收益
LowerActivityReward *float64 `json:"lower_activity_reward"` // 下级活跃奖励金额 LowerActivityReward *float64 `json:"lower_activity_reward"` // 下级活跃奖励金额
NewActivityReward *float64 `json:"new_activity_reward"` // 新增活跃奖励金额 NewActivityReward *float64 `json:"new_activity_reward"` // 新增活跃奖励金额
LowerStandardCount *int64 `json:"lower_standard_count"` // 活跃下级达标个数 LowerStandardCount *int64 `json:"lower_standard_count"` // 活跃下级达标个数
NewLowerStandardCount *int64 `json:"new_lower_standard_count"` // 新增活跃下级达标个数 NewLowerStandardCount *int64 `json:"new_lower_standard_count"` // 新增活跃下级达标个数
LowerWithdrawRewardRatio *float64 `json:"lower_withdraw_reward_ratio"` // 下级提现奖励比例 LowerWithdrawRewardRatio *float64 `json:"lower_withdraw_reward_ratio"` // 下级提现奖励比例
LowerConvertVipReward *float64 `json:"lower_convert_vip_reward"` // 下级转化VIP奖励 LowerConvertVipReward *float64 `json:"lower_convert_vip_reward"` // 下级转化VIP奖励
LowerConvertSvipReward *float64 `json:"lower_convert_svip_reward"` // 下级转化SVIP奖励 LowerConvertSvipReward *float64 `json:"lower_convert_svip_reward"` // 下级转化SVIP奖励
ExemptionAmount *float64 `json:"exemption_amount"` // 免责金额 ExemptionAmount *float64 `json:"exemption_amount"` // 免责金额
PriceIncreaseMax *float64 `json:"price_increase_max"` // 提价最高金额 PriceIncreaseMax *float64 `json:"price_increase_max"` // 提价最高金额
PriceRatio *float64 `json:"price_ratio"` // 提价区间收取比例 PriceRatio *float64 `json:"price_ratio"` // 提价区间收取比例
PriceIncreaseAmount *float64 `json:"price_increase_amount"` // 在原本成本上加价的金额 PriceIncreaseAmount *float64 `json:"price_increase_amount"` // 在原本成本上加价的金额
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理会员配置编辑请求 // 代理会员配置编辑请求
AdminUpdateAgentMembershipConfigReq { AdminUpdateAgentMembershipConfigReq {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
LevelName string `json:"level_name"` // 会员级别名称 LevelName string `json:"level_name"` // 会员级别名称
Price float64 `json:"price"` // 会员年费 Price float64 `json:"price"` // 会员年费
ReportCommission float64 `json:"report_commission"` // 直推报告收益 ReportCommission float64 `json:"report_commission"` // 直推报告收益
LowerActivityReward *float64 `json:"lower_activity_reward,optional,omitempty"` // 下级活跃奖励金额 LowerActivityReward *float64 `json:"lower_activity_reward,optional,omitempty"` // 下级活跃奖励金额
NewActivityReward *float64 `json:"new_activity_reward,optional,omitempty"` // 新增活跃奖励金额 NewActivityReward *float64 `json:"new_activity_reward,optional,omitempty"` // 新增活跃奖励金额
LowerStandardCount *int64 `json:"lower_standard_count,optional,omitempty"` // 活跃下级达标个数 LowerStandardCount *int64 `json:"lower_standard_count,optional,omitempty"` // 活跃下级达标个数
NewLowerStandardCount *int64 `json:"new_lower_standard_count,optional,omitempty"` // 新增活跃下级达标个数 NewLowerStandardCount *int64 `json:"new_lower_standard_count,optional,omitempty"` // 新增活跃下级达标个数
LowerWithdrawRewardRatio *float64 `json:"lower_withdraw_reward_ratio,optional,omitempty"` // 下级提现奖励比例 LowerWithdrawRewardRatio *float64 `json:"lower_withdraw_reward_ratio,optional,omitempty"` // 下级提现奖励比例
LowerConvertVipReward *float64 `json:"lower_convert_vip_reward,optional,omitempty"` // 下级转化VIP奖励 LowerConvertVipReward *float64 `json:"lower_convert_vip_reward,optional,omitempty"` // 下级转化VIP奖励
LowerConvertSvipReward *float64 `json:"lower_convert_svip_reward,optional,omitempty"` // 下级转化SVIP奖励 LowerConvertSvipReward *float64 `json:"lower_convert_svip_reward,optional,omitempty"` // 下级转化SVIP奖励
ExemptionAmount *float64 `json:"exemption_amount,optional,omitempty"` // 免责金额 ExemptionAmount *float64 `json:"exemption_amount,optional,omitempty"` // 免责金额
PriceIncreaseMax *float64 `json:"price_increase_max,optional,omitempty"` // 提价最高金额 PriceIncreaseMax *float64 `json:"price_increase_max,optional,omitempty"` // 提价最高金额
PriceRatio *float64 `json:"price_ratio,optional,omitempty"` // 提价区间收取比例 PriceRatio *float64 `json:"price_ratio,optional,omitempty"` // 提价区间收取比例
PriceIncreaseAmount *float64 `json:"price_increase_amount,optional,omitempty"` // 在原本成本上加价的金额 PriceIncreaseAmount *float64 `json:"price_increase_amount,optional,omitempty"` // 在原本成本上加价的金额
} }
// 代理会员配置编辑响应 // 代理会员配置编辑响应
AdminUpdateAgentMembershipConfigResp { AdminUpdateAgentMembershipConfigResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
} }
// 银行卡提现审核请求 // 银行卡提现审核请求
AdminReviewBankCardWithdrawalReq { AdminReviewBankCardWithdrawalReq {
WithdrawalId int64 `json:"withdrawal_id"` // 提现记录ID WithdrawalId int64 `json:"withdrawal_id"` // 提现记录ID
Action int64 `json:"action"` // 操作:1-确认,2-拒绝 Action int64 `json:"action"` // 操作:1-确认,2-拒绝
Remark string `json:"remark"` // 备注(拒绝时必填) Remark string `json:"remark"` // 备注(拒绝时必填)
TaxRate *float64 `json:"tax_rate,optional"` // 扣税比例,如 0.06 表示 6%,不传则默认 6%
} }
// 银行卡提现审核响应 // 银行卡提现审核响应
AdminReviewBankCardWithdrawalResp { AdminReviewBankCardWithdrawalResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
} }
// 获取提现统计数据请求 // 获取提现统计数据请求
AdminGetWithdrawalStatisticsReq { AdminGetWithdrawalStatisticsReq {}
}
// 获取提现统计数据响应 // 获取提现统计数据响应
AdminGetWithdrawalStatisticsResp { AdminGetWithdrawalStatisticsResp {
TotalWithdrawalAmount float64 `json:"total_withdrawal_amount"` // 总提现金额 TotalWithdrawalAmount float64 `json:"total_withdrawal_amount"` // 总提现金额
TodayWithdrawalAmount float64 `json:"today_withdrawal_amount"` // 今日提现金额 TodayWithdrawalAmount float64 `json:"today_withdrawal_amount"` // 今日提现金额
TotalActualAmount float64 `json:"total_actual_amount"` // 总实际到账金额 TotalActualAmount float64 `json:"total_actual_amount"` // 总实际到账金额
TotalTaxAmount float64 `json:"total_tax_amount"` // 总扣税金额 TotalTaxAmount float64 `json:"total_tax_amount"` // 总扣税金额
} }
// 获取代理订单统计数据请求 // 获取代理订单统计数据请求
AdminGetAgentOrderStatisticsReq { AdminGetAgentOrderStatisticsReq {}
}
// 获取代理订单统计数据响应 // 获取代理订单统计数据响应
AdminGetAgentOrderStatisticsResp { AdminGetAgentOrderStatisticsResp {
TotalAgentOrderCount int64 `json:"total_agent_order_count"` // 总代理订单数 TotalAgentOrderCount int64 `json:"total_agent_order_count"` // 总代理订单数
TodayAgentOrderCount int64 `json:"today_agent_order_count"` // 今日代理订单数 TodayAgentOrderCount int64 `json:"today_agent_order_count"` // 今日代理订单数
} }
// 获取代理统计数据请求 // 获取代理统计数据请求
AdminGetAgentStatisticsReq { AdminGetAgentStatisticsReq {}
}
// 获取代理统计数据响应 // 获取代理统计数据响应
AdminGetAgentStatisticsResp { AdminGetAgentStatisticsResp {
TotalAgentCount int64 `json:"total_agent_count"` // 总代理数 TotalAgentCount int64 `json:"total_agent_count"` // 总代理数
TodayAgentCount int64 `json:"today_agent_count"` // 今日新增代理数 TodayAgentCount int64 `json:"today_agent_count"` // 今日新增代理数
} }
// 获取代理链接产品统计请求 // 获取代理链接产品统计请求
AdminGetAgentLinkProductStatisticsReq { AdminGetAgentLinkProductStatisticsReq {}
}
// 代理链接产品统计列表项 // 代理链接产品统计列表项
AgentLinkProductStatisticsItem { AgentLinkProductStatisticsItem {
ProductName string `json:"product_name"` // 产品名称 ProductName string `json:"product_name"` // 产品名称
LinkCount int64 `json:"link_count"` // 推广链接数量 LinkCount int64 `json:"link_count"` // 推广链接数量
} }
// 获取代理链接产品统计响应 // 获取代理链接产品统计响应
AdminGetAgentLinkProductStatisticsResp { AdminGetAgentLinkProductStatisticsResp {
Items []AgentLinkProductStatisticsItem `json:"items"` // 列表数据 Items []AgentLinkProductStatisticsItem `json:"items"` // 列表数据
} }
// 获取代理钱包信息请求 // 获取代理钱包信息请求
AdminGetAgentWalletReq { AdminGetAgentWalletReq {
AgentId int64 `path:"agent_id"` // 代理ID AgentId int64 `path:"agent_id"` // 代理ID
} }
// 获取代理钱包信息响应 // 获取代理钱包信息响应
AdminGetAgentWalletResp { AdminGetAgentWalletResp {
Balance float64 `json:"balance"` // 可用余额 Balance float64 `json:"balance"` // 可用余额
FrozenBalance float64 `json:"frozen_balance"` // 冻结余额 FrozenBalance float64 `json:"frozen_balance"` // 冻结余额
TotalEarnings float64 `json:"total_earnings"` // 总收益 TotalEarnings float64 `json:"total_earnings"` // 总收益
} }
// 修改代理钱包余额请求 // 修改代理钱包余额请求
AdminUpdateAgentWalletBalanceReq { AdminUpdateAgentWalletBalanceReq {
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
Amount float64 `json:"amount"` // 修改金额(正数增加,负数减少) Amount float64 `json:"amount"` // 修改金额(正数增加,负数减少)
} }
// 修改代理钱包余额响应 // 修改代理钱包余额响应
AdminUpdateAgentWalletBalanceResp { AdminUpdateAgentWalletBalanceResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
Balance float64 `json:"balance"` // 修改后的余额 Balance float64 `json:"balance"` // 修改后的余额
} }
// 更新系统配置请求 // 更新系统配置请求
AdminUpdateSystemConfigReq { AdminUpdateSystemConfigReq {
CommissionSafeMode *bool `json:"commission_safe_mode,optional"` // 佣金安全防御模式true-冻结模式false-直接结算模式 CommissionSafeMode *bool `json:"commission_safe_mode,optional"` // 佣金安全防御模式true-冻结模式false-直接结算模式
} }
// 更新系统配置响应 // 更新系统配置响应
AdminUpdateSystemConfigResp { AdminUpdateSystemConfigResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
} }
// 获取系统配置响应 // 获取系统配置响应
AdminGetSystemConfigResp { AdminGetSystemConfigResp {
CommissionSafeMode bool `json:"commission_safe_mode"` // 佣金安全防御模式 CommissionSafeMode bool `json:"commission_safe_mode"` // 佣金安全防御模式
} }
// 代理钱包流水分页查询请求 // 代理钱包流水分页查询请求
AdminGetAgentWalletTransactionListReq { AdminGetAgentWalletTransactionListReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
PageSize int64 `form:"pageSize"` // 每页数量 PageSize int64 `form:"pageSize"` // 每页数量
AgentId int64 `form:"agent_id"` // 代理ID AgentId int64 `form:"agent_id"` // 代理ID
TransactionType *string `form:"transaction_type,optional"` // 交易类型(可选) TransactionType *string `form:"transaction_type,optional"` // 交易类型(可选)
CreateTimeStart *string `form:"create_time_start,optional"` // 创建时间开始(可选) CreateTimeStart *string `form:"create_time_start,optional"` // 创建时间开始(可选)
CreateTimeEnd *string `form:"create_time_end,optional"` // 创建时间结束(可选) CreateTimeEnd *string `form:"create_time_end,optional"` // 创建时间结束(可选)
} }
// 代理钱包流水列表项 // 代理钱包流水列表项
AgentWalletTransactionListItem { AgentWalletTransactionListItem {
Id int64 `json:"id"` // 主键 Id int64 `json:"id"` // 主键
AgentId int64 `json:"agent_id"` // 代理ID AgentId int64 `json:"agent_id"` // 代理ID
TransactionType string `json:"transaction_type"` // 交易类型 TransactionType string `json:"transaction_type"` // 交易类型
Amount float64 `json:"amount"` // 变动金额 Amount float64 `json:"amount"` // 变动金额
BalanceBefore float64 `json:"balance_before"` // 变动前余额 BalanceBefore float64 `json:"balance_before"` // 变动前余额
BalanceAfter float64 `json:"balance_after"` // 变动后余额 BalanceAfter float64 `json:"balance_after"` // 变动后余额
FrozenBalanceBefore float64 `json:"frozen_balance_before"` // 变动前冻结余额 FrozenBalanceBefore float64 `json:"frozen_balance_before"` // 变动前冻结余额
FrozenBalanceAfter float64 `json:"frozen_balance_after"` // 变动后冻结余额 FrozenBalanceAfter float64 `json:"frozen_balance_after"` // 变动后冻结余额
TransactionId *string `json:"transaction_id"` // 关联交易ID TransactionId *string `json:"transaction_id"` // 关联交易ID
RelatedUserId *int64 `json:"related_user_id"` // 关联用户ID RelatedUserId *int64 `json:"related_user_id"` // 关联用户ID
Remark *string `json:"remark"` // 备注说明 Remark *string `json:"remark"` // 备注说明
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
} }
// 代理钱包流水分页查询响应 // 代理钱包流水分页查询响应
AdminGetAgentWalletTransactionListResp { AdminGetAgentWalletTransactionListResp {
Total int64 `json:"total"` // 总数 Total int64 `json:"total"` // 总数
Items []AgentWalletTransactionListItem `json:"items"` // 列表数据 Items []AgentWalletTransactionListItem `json:"items"` // 列表数据
} }
)
)

View File

@@ -326,12 +326,12 @@ type (
SubWithdrawReward float64 `json:"sub_withdraw_reward"` SubWithdrawReward float64 `json:"sub_withdraw_reward"`
} }
Commission { Commission {
OrderId string `json:"order_id"` // 订单号 OrderId string `json:"order_id"` // 订单号
ProductName string `json:"product_name"` ProductName string `json:"product_name"`
Amount float64 `json:"amount"` // 原始佣金金额 Amount float64 `json:"amount"` // 原始佣金金额
RefundedAmount float64 `json:"refunded_amount"` // 已退款佣金金额 RefundedAmount float64 `json:"refunded_amount"` // 已退款佣金金额
NetAmount float64 `json:"net_amount"` // 剩余净佣金金额 = amount - refunded_amount NetAmount float64 `json:"net_amount"` // 剩余净佣金金额 = amount - refunded_amount
Status int64 `json:"status"` // 状态0-已结算1-冻结中2-已退款 Status int64 `json:"status"` // 状态0-已结算1-冻结中2-已退款
CreateTime string `json:"create_time"` CreateTime string `json:"create_time"`
QueryParams map[string]interface{} `json:"query_params,omitempty"` QueryParams map[string]interface{} `json:"query_params,omitempty"`
} }
@@ -363,6 +363,7 @@ type (
Remark string `json:"remark"` Remark string `json:"remark"`
payeeAccount string `json:"payee_account"` payeeAccount string `json:"payee_account"`
CreateTime string `json:"create_time"` CreateTime string `json:"create_time"`
TaxRate float64 `json:"tax_rate"` // 扣税比例,如 0.06 表示 6%
} }
GetWithdrawalReq { GetWithdrawalReq {
Page int64 `form:"page"` // 页码 Page int64 `form:"page"` // 页码
@@ -399,17 +400,17 @@ type (
// 银行卡提现申请请求 // 银行卡提现申请请求
BankCardWithdrawalReq { BankCardWithdrawalReq {
BankCardNo string `json:"bank_card_no"` // 银行卡号 BankCardNo string `json:"bank_card_no"` // 银行卡号
BankName string `json:"bank_name"` // 开户支行 BankName string `json:"bank_name"` // 开户支行
Amount float64 `json:"amount"` // 提现金额 Amount float64 `json:"amount"` // 提现金额
} }
// 获取历史银行卡信息请求 // 获取历史银行卡信息请求
GetBankCardInfoReq {} GetBankCardInfoReq {}
// 获取历史银行卡信息响应 // 获取历史银行卡信息响应
GetBankCardInfoResp { GetBankCardInfoResp {
BankCardNo string `json:"bank_card_no"` // 银行卡号 BankCardNo string `json:"bank_card_no"` // 银行卡号
BankName string `json:"bank_name"` // 开户支行 BankName string `json:"bank_name"` // 开户支行
PayeeName string `json:"payee_name"` // 收款人姓名 PayeeName string `json:"payee_name"` // 收款人姓名
IdCard string `json:"id_card"` // 身份证号 IdCard string `json:"id_card"` // 身份证号
} }
) )

View File

@@ -17,6 +17,12 @@ VerifyCode:
SignName: "海南海宇大数据" SignName: "海南海宇大数据"
TemplateCode: "SMS_302641455" TemplateCode: "SMS_302641455"
ValidTime: 300 ValidTime: 300
Captcha:
AccessKeyID: "LTAI5tKGB3TVJbMHSoZN3yr9"
AccessKeySecret: "OCQ30GWp4yENMjmfOAaagksE18bp65"
EndpointURL: "captcha.cn-shanghai.aliyuncs.com"
SceneID: "wynt39to"
EKey: ""
Encrypt: Encrypt:
SecretKey: "ff83609b2b24fc73196aac3d3dfb874f" SecretKey: "ff83609b2b24fc73196aac3d3dfb874f"
WestConfig: WestConfig:

View File

@@ -19,6 +19,12 @@ VerifyCode:
SignName: "海南海宇大数据" SignName: "海南海宇大数据"
TemplateCode: "SMS_302641455" TemplateCode: "SMS_302641455"
ValidTime: 300 ValidTime: 300
Captcha:
AccessKeyID: "LTAI5tKGB3TVJbMHSoZN3yr9"
AccessKeySecret: "OCQ30GWp4yENMjmfOAaagksE18bp65"
EndpointURL: "captcha.cn-shanghai.aliyuncs.com"
SceneID: "wynt39to"
EKey: ""
Encrypt: Encrypt:
SecretKey: "ff83609b2b24fc73196aac3d3dfb874f" SecretKey: "ff83609b2b24fc73196aac3d3dfb874f"
WestConfig: WestConfig:

View File

@@ -11,6 +11,7 @@ type Config struct {
CacheRedis cache.CacheConf CacheRedis cache.CacheConf
JwtAuth JwtAuth // JWT 鉴权相关配置 JwtAuth JwtAuth // JWT 鉴权相关配置
VerifyCode VerifyCode VerifyCode VerifyCode
Captcha CaptchaConfig
Encrypt Encrypt Encrypt Encrypt
Alipay AlipayConfig Alipay AlipayConfig
Wxpay WxpayConfig Wxpay WxpayConfig
@@ -42,6 +43,13 @@ type VerifyCode struct {
TemplateCode string TemplateCode string
ValidTime int ValidTime int
} }
type CaptchaConfig struct {
AccessKeyID string
AccessKeySecret string
EndpointURL string
SceneID string
EKey string
}
type Encrypt struct { type Encrypt struct {
SecretKey string SecretKey string
} }

View File

@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"net/http" "net/http"
"tyass-server/app/main/api/internal/logic/auth" "tyass-server/app/main/api/internal/logic/auth"
@@ -23,7 +24,10 @@ func SendSmsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
result.ParamValidateErrorResult(r, w, err) result.ParamValidateErrorResult(r, w, err)
return return
} }
l := auth.NewSendSmsLogic(r.Context(), svcCtx)
// 将 User-Agent 添加到上下文中
ctx := context.WithValue(r.Context(), "user-agent", r.Header.Get("User-Agent"))
l := auth.NewSendSmsLogic(ctx, svcCtx)
err := l.SendSms(&req) err := l.SendSms(&req)
result.HttpResult(r, w, nil, err) result.HttpResult(r, w, nil, err)
} }

View File

@@ -0,0 +1,17 @@
package captcha
import (
"net/http"
"tyass-server/app/main/api/internal/logic/captcha"
"tyass-server/app/main/api/internal/svc"
"tyass-server/common/result"
)
func GetEncryptedSceneIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := captcha.NewGetEncryptedSceneIdLogic(r.Context(), svcCtx)
resp, err := l.GetEncryptedSceneId()
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -25,6 +25,7 @@ import (
notification "tyass-server/app/main/api/internal/handler/notification" notification "tyass-server/app/main/api/internal/handler/notification"
pay "tyass-server/app/main/api/internal/handler/pay" pay "tyass-server/app/main/api/internal/handler/pay"
product "tyass-server/app/main/api/internal/handler/product" product "tyass-server/app/main/api/internal/handler/product"
captchaHandler "tyass-server/app/main/api/internal/handler/captcha"
query "tyass-server/app/main/api/internal/handler/query" query "tyass-server/app/main/api/internal/handler/query"
user "tyass-server/app/main/api/internal/handler/user" user "tyass-server/app/main/api/internal/handler/user"
"tyass-server/app/main/api/internal/svc" "tyass-server/app/main/api/internal/svc"
@@ -914,6 +915,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
rest.WithPrefix("/api/v1"), rest.WithPrefix("/api/v1"),
) )
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodPost,
Path: "/captcha/encryptedSceneId",
Handler: captchaHandler.GetEncryptedSceneIdHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1"),
)
server.AddRoutes( server.AddRoutes(
[]rest.Route{ []rest.Route{
{ {

View File

@@ -65,6 +65,11 @@ func (l *AdminGetAgentWithdrawalListLogic) AdminGetAgentWithdrawalList(req *type
item.PayeeName = v.PayeeName.String item.PayeeName = v.PayeeName.String
} }
// 从扣税记录中取扣税比例
taxModel, taxErr := l.svcCtx.AgentWithdrawalTaxModel.FindOneByWithdrawalId(l.ctx, v.Id)
if taxErr == nil {
item.TaxRate = taxModel.TaxRate
}
items = append(items, item) items = append(items, item)
} }
resp = &types.AdminGetAgentWithdrawalListResp{ resp = &types.AdminGetAgentWithdrawalListResp{

View File

@@ -3,6 +3,7 @@ package admin_agent
import ( import (
"context" "context"
"database/sql" "database/sql"
"math"
"time" "time"
"tyass-server/app/main/model" "tyass-server/app/main/model"
"tyass-server/common/xerr" "tyass-server/common/xerr"
@@ -48,7 +49,6 @@ func NewAdminReviewBankCardWithdrawalLogic(ctx context.Context, svcCtx *svc.Serv
svcCtx: svcCtx, svcCtx: svcCtx,
} }
} }
func (l *AdminReviewBankCardWithdrawalLogic) AdminReviewBankCardWithdrawal(req *types.AdminReviewBankCardWithdrawalReq) (resp *types.AdminReviewBankCardWithdrawalResp, err error) { func (l *AdminReviewBankCardWithdrawalLogic) AdminReviewBankCardWithdrawal(req *types.AdminReviewBankCardWithdrawalReq) (resp *types.AdminReviewBankCardWithdrawalResp, err error) {
// 验证操作类型 // 验证操作类型
if req.Action != ReviewActionApprove && req.Action != ReviewActionReject { if req.Action != ReviewActionApprove && req.Action != ReviewActionReject {
@@ -85,9 +85,18 @@ func (l *AdminReviewBankCardWithdrawalLogic) AdminReviewBankCardWithdrawal(req *
return errors.Wrapf(xerr.NewErrMsg("提现类型不正确"), "提现类型验证失败") return errors.Wrapf(xerr.NewErrMsg("提现类型不正确"), "提现类型验证失败")
} }
// 确认时使用的扣税比例:请求中传入则用传入值,否则默认 6%
taxRate := 0.06
if req.Action == ReviewActionApprove && req.TaxRate != nil {
taxRate = *req.TaxRate
if taxRate < 0 || taxRate > 1 {
return errors.Wrapf(xerr.NewErrMsg("扣税比例必须在 0100% 之间"), "扣税比例验证失败")
}
}
if req.Action == ReviewActionApprove { if req.Action == ReviewActionApprove {
// 确认提现 // 确认提现(可带自定义扣税比例)
return l.approveWithdrawal(ctx, session, record) return l.approveWithdrawal(ctx, session, record, taxRate)
} else { } else {
// 拒绝提现 // 拒绝提现
return l.rejectWithdrawal(ctx, session, record, req.Remark) return l.rejectWithdrawal(ctx, session, record, req.Remark)
@@ -102,20 +111,53 @@ func (l *AdminReviewBankCardWithdrawalLogic) AdminReviewBankCardWithdrawal(req *
return resp, nil return resp, nil
} }
// 确认提现 // 确认提现taxRate 为扣税比例,如 0.06 表示 6%
func (l *AdminReviewBankCardWithdrawalLogic) approveWithdrawal(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal) error { func (l *AdminReviewBankCardWithdrawalLogic) approveWithdrawal(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal, taxRate float64) error {
// 按审核时选择的扣税比例重新计算并更新提现记录与扣税记录
taxModel, err := l.applyReviewTaxRate(ctx, session, record, taxRate)
if err != nil {
return err
}
// 根据提现类型执行不同的操作 // 根据提现类型执行不同的操作
if record.WithdrawType == WithdrawTypeAlipay { if record.WithdrawType == WithdrawTypeAlipay {
// 支付宝提现:调用支付宝转账接口 // 支付宝提现:按更新后的实际到账金额调用支付宝转账
return l.approveAlipayWithdrawal(ctx, session, record) return l.approveAlipayWithdrawal(ctx, session, record, taxModel)
} else { } else {
// 银行卡提现:直接更新状态为成功(线下转账) // 银行卡提现:直接更新状态为成功(线下转账)
return l.approveBankCardWithdrawal(ctx, session, record) return l.approveBankCardWithdrawal(ctx, session, record, taxModel)
} }
} }
// applyReviewTaxRate 按审核时选择的扣税比例更新提现记录与扣税记录
// 返回更新后的扣税记录,避免重复查询导致的版本冲突
func (l *AdminReviewBankCardWithdrawalLogic) applyReviewTaxRate(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal, taxRate float64) (*model.AgentWithdrawalTax, error) {
// 金额保留两位小数,避免浮点误差并与前端/支付宝一致
newTaxAmount := math.Round(record.Amount*taxRate*100) / 100
newActualAmount := math.Round((record.Amount-newTaxAmount)*100) / 100
record.TaxAmount = newTaxAmount
record.ActualAmount = newActualAmount
if _, err := l.svcCtx.AgentWithdrawalModel.Update(ctx, session, record); err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "更新提现记录扣税金额失败: %v", err)
}
taxModel, err := l.svcCtx.AgentWithdrawalTaxModel.FindOneByWithdrawalId(ctx, record.Id)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "查询扣税记录失败: %v", err)
}
taxModel.TaxRate = taxRate
taxModel.TaxAmount = newTaxAmount
taxModel.ActualAmount = newActualAmount
taxModel.TaxableAmount = record.Amount
if err := l.svcCtx.AgentWithdrawalTaxModel.UpdateWithVersion(ctx, session, taxModel); err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "更新扣税记录失败: %v", err)
}
// 返回更新后的 taxModelversion 已经自动加1
return taxModel, nil
}
// 确认支付宝提现 // 确认支付宝提现
func (l *AdminReviewBankCardWithdrawalLogic) approveAlipayWithdrawal(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal) error { func (l *AdminReviewBankCardWithdrawalLogic) approveAlipayWithdrawal(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal, taxModel *model.AgentWithdrawalTax) error {
// 同步调用支付宝转账 // 同步调用支付宝转账
transferResp, err := l.svcCtx.AlipayService.AliTransfer(ctx, record.PayeeAccount, record.PayeeName.String, record.ActualAmount, "公司提现", record.WithdrawNo) transferResp, err := l.svcCtx.AlipayService.AliTransfer(ctx, record.PayeeAccount, record.PayeeName.String, record.ActualAmount, "公司提现", record.WithdrawNo)
if err != nil { if err != nil {
@@ -126,11 +168,11 @@ func (l *AdminReviewBankCardWithdrawalLogic) approveAlipayWithdrawal(ctx context
switch { switch {
case transferResp.Status == "SUCCESS": case transferResp.Status == "SUCCESS":
// 立即处理成功状态 // 立即处理成功状态
return l.completeWithdrawalSuccess(ctx, session, record) return l.completeWithdrawalSuccess(ctx, session, record, taxModel)
case transferResp.Status == "FAIL" || transferResp.SubCode != "": case transferResp.Status == "FAIL" || transferResp.SubCode != "":
// 处理明确失败 // 处理明确失败
errorMsg := l.mapAlipayError(transferResp.SubCode) errorMsg := l.mapAlipayError(transferResp.SubCode)
return l.completeWithdrawalFailure(ctx, session, record, errorMsg) return l.completeWithdrawalFailure(ctx, session, record, taxModel, errorMsg)
case transferResp.Status == "DEALING": case transferResp.Status == "DEALING":
// 处理中状态,更新为处理中但不标记为最终状态 // 处理中状态,更新为处理中但不标记为最终状态
record.Remark = sql.NullString{String: "支付宝转账处理中", Valid: true} record.Remark = sql.NullString{String: "支付宝转账处理中", Valid: true}
@@ -141,12 +183,12 @@ func (l *AdminReviewBankCardWithdrawalLogic) approveAlipayWithdrawal(ctx context
return nil return nil
default: default:
// 未知状态按失败处理 // 未知状态按失败处理
return l.completeWithdrawalFailure(ctx, session, record, "支付宝返回未知状态") return l.completeWithdrawalFailure(ctx, session, record, taxModel, "支付宝返回未知状态")
} }
} }
// 确认银行卡提现 // 确认银行卡提现
func (l *AdminReviewBankCardWithdrawalLogic) approveBankCardWithdrawal(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal) error { func (l *AdminReviewBankCardWithdrawalLogic) approveBankCardWithdrawal(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal, taxModel *model.AgentWithdrawalTax) error {
// 更新提现记录状态为成功 // 更新提现记录状态为成功
record.Status = StatusSuccess record.Status = StatusSuccess
record.Remark = sql.NullString{String: "管理员确认提现", Valid: true} record.Remark = sql.NullString{String: "管理员确认提现", Valid: true}
@@ -188,11 +230,7 @@ func (l *AdminReviewBankCardWithdrawalLogic) approveBankCardWithdrawal(ctx conte
return err return err
} }
// 更新扣税记录状态为成功 // 更新扣税记录状态为成功(使用传入的 taxModel避免重复查询导致的版本冲突
taxModel, err := l.svcCtx.AgentWithdrawalTaxModel.FindOneByWithdrawalId(ctx, record.Id)
if err != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "查询扣税记录失败: %v", err)
}
if taxModel.TaxStatus == model.TaxStatusPending { if taxModel.TaxStatus == model.TaxStatusPending {
taxModel.TaxStatus = model.TaxStatusSuccess // 扣税状态 = 成功 taxModel.TaxStatus = model.TaxStatusSuccess // 扣税状态 = 成功
taxModel.TaxTime = sql.NullTime{Time: time.Now(), Valid: true} taxModel.TaxTime = sql.NullTime{Time: time.Now(), Valid: true}
@@ -277,7 +315,7 @@ func (l *AdminReviewBankCardWithdrawalLogic) rejectWithdrawal(ctx context.Contex
} }
// 完成提现成功(支付宝转账成功后调用) // 完成提现成功(支付宝转账成功后调用)
func (l *AdminReviewBankCardWithdrawalLogic) completeWithdrawalSuccess(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal) error { func (l *AdminReviewBankCardWithdrawalLogic) completeWithdrawalSuccess(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal, taxModel *model.AgentWithdrawalTax) error {
// 更新提现记录状态为成功 // 更新提现记录状态为成功
record.Status = StatusSuccess record.Status = StatusSuccess
record.Remark = sql.NullString{String: "支付宝转账成功", Valid: true} record.Remark = sql.NullString{String: "支付宝转账成功", Valid: true}
@@ -319,11 +357,7 @@ func (l *AdminReviewBankCardWithdrawalLogic) completeWithdrawalSuccess(ctx conte
return err return err
} }
// 更新扣税记录状态为成功 // 更新扣税记录状态为成功(使用传入的 taxModel避免重复查询导致的版本冲突
taxModel, err := l.svcCtx.AgentWithdrawalTaxModel.FindOneByWithdrawalId(ctx, record.Id)
if err != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "查询扣税记录失败: %v", err)
}
if taxModel.TaxStatus == model.TaxStatusPending { if taxModel.TaxStatus == model.TaxStatusPending {
taxModel.TaxStatus = model.TaxStatusSuccess // 扣税状态 = 成功 taxModel.TaxStatus = model.TaxStatusSuccess // 扣税状态 = 成功
taxModel.TaxTime = sql.NullTime{Time: time.Now(), Valid: true} taxModel.TaxTime = sql.NullTime{Time: time.Now(), Valid: true}
@@ -346,7 +380,7 @@ func (l *AdminReviewBankCardWithdrawalLogic) completeWithdrawalSuccess(ctx conte
} }
// 完成提现失败(支付宝转账失败后调用) // 完成提现失败(支付宝转账失败后调用)
func (l *AdminReviewBankCardWithdrawalLogic) completeWithdrawalFailure(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal, errorMsg string) error { func (l *AdminReviewBankCardWithdrawalLogic) completeWithdrawalFailure(ctx context.Context, session sqlx.Session, record *model.AgentWithdrawal, taxModel *model.AgentWithdrawalTax, errorMsg string) error {
// 更新提现记录状态为失败 // 更新提现记录状态为失败
record.Status = StatusFailed record.Status = StatusFailed
record.Remark = sql.NullString{String: errorMsg, Valid: true} record.Remark = sql.NullString{String: errorMsg, Valid: true}
@@ -390,11 +424,7 @@ func (l *AdminReviewBankCardWithdrawalLogic) completeWithdrawalFailure(ctx conte
return err return err
} }
// 更新扣税记录状态为失败 // 更新扣税记录状态为失败(使用传入的 taxModel避免重复查询导致的版本冲突
taxModel, err := l.svcCtx.AgentWithdrawalTaxModel.FindOneByWithdrawalId(ctx, record.Id)
if err != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "查询扣税记录失败: %v", err)
}
if taxModel.TaxStatus == model.TaxStatusPending { if taxModel.TaxStatus == model.TaxStatusPending {
taxModel.TaxStatus = model.TaxStatusFailed // 扣税状态 = 失败 taxModel.TaxStatus = model.TaxStatusFailed // 扣税状态 = 失败
taxModel.TaxTime = sql.NullTime{Time: time.Now(), Valid: true} taxModel.TaxTime = sql.NullTime{Time: time.Now(), Valid: true}

View File

@@ -56,6 +56,11 @@ func (l *GetAgentWithdrawalLogic) GetAgentWithdrawal(req *types.GetWithdrawalReq
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取代理提现列表, %v", err) return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取代理提现列表, %v", err)
} }
withdrawal.CreateTime = agentWithdrawalModel.CreateTime.Format("2006-01-02 15:04:05") withdrawal.CreateTime = agentWithdrawalModel.CreateTime.Format("2006-01-02 15:04:05")
// 从扣税记录中取扣税比例,供前端展示“扣了几个点”
taxModel, taxErr := l.svcCtx.AgentWithdrawalTaxModel.FindOneByWithdrawalId(l.ctx, agentWithdrawalModel.Id)
if taxErr == nil {
withdrawal.TaxRate = taxModel.TaxRate
}
list = append(list, withdrawal) list = append(list, withdrawal)
} }
} }

View File

@@ -12,6 +12,7 @@ import (
"tyass-server/app/main/api/internal/svc" "tyass-server/app/main/api/internal/svc"
"tyass-server/app/main/api/internal/types" "tyass-server/app/main/api/internal/types"
"tyass-server/pkg/captcha"
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
dysmsapi "github.com/alibabacloud-go/dysmsapi-20170525/v3/client" dysmsapi "github.com/alibabacloud-go/dysmsapi-20170525/v3/client"
@@ -35,6 +36,17 @@ func NewSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendSmsLo
} }
func (l *SendSmsLogic) SendSms(req *types.SendSmsReq) error { func (l *SendSmsLogic) SendSms(req *types.SendSmsReq) error {
// 图形验证码校验
captchaCfg := l.svcCtx.Config.Captcha
if err := captcha.VerifyWithContext(l.ctx, captcha.Config{
AccessKeyID: captchaCfg.AccessKeyID,
AccessKeySecret: captchaCfg.AccessKeySecret,
EndpointURL: captchaCfg.EndpointURL,
SceneID: captchaCfg.SceneID,
}, req.CaptchaVerifyParam); err != nil {
return err
}
secretKey := l.svcCtx.Config.Encrypt.SecretKey secretKey := l.svcCtx.Config.Encrypt.SecretKey
encryptedMobile, err := crypto.EncryptMobile(req.Mobile, secretKey) encryptedMobile, err := crypto.EncryptMobile(req.Mobile, secretKey)
if err != nil { if err != nil {

View File

@@ -0,0 +1,37 @@
package captcha
import (
"context"
"tyass-server/app/main/api/internal/svc"
"tyass-server/app/main/api/internal/types"
"tyass-server/pkg/captcha"
"github.com/zeromicro/go-zero/core/logx"
)
type GetEncryptedSceneIdLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetEncryptedSceneIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetEncryptedSceneIdLogic {
return &GetEncryptedSceneIdLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetEncryptedSceneIdLogic) GetEncryptedSceneId() (*types.GetEncryptedSceneIdResp, error) {
cfg := l.svcCtx.Config.Captcha
encrypted, err := captcha.GenerateEncryptedSceneID(cfg.SceneID, cfg.EKey, 3600)
if err != nil {
l.Errorf("generate encrypted scene id error: %+v", err)
return nil, err
}
return &types.GetEncryptedSceneIdResp{
EncryptedSceneId: encrypted,
}, nil
}

View File

@@ -808,9 +808,10 @@ type AdminRetryAgentProcessResp struct {
} }
type AdminReviewBankCardWithdrawalReq struct { type AdminReviewBankCardWithdrawalReq struct {
WithdrawalId int64 `json:"withdrawal_id"` // 提现记录ID WithdrawalId int64 `json:"withdrawal_id"` // 提现记录ID
Action int64 `json:"action"` // 操作:1-确认,2-拒绝 Action int64 `json:"action"` // 操作:1-确认,2-拒绝
Remark string `json:"remark"` // 备注(拒绝时必填) Remark string `json:"remark"` // 备注(拒绝时必填)
TaxRate *float64 `json:"tax_rate,optional"` // 扣税比例,如 0.06 表示 6%,不传则默认 6%
} }
type AdminReviewBankCardWithdrawalResp struct { type AdminReviewBankCardWithdrawalResp struct {
@@ -1300,6 +1301,7 @@ type AgentWithdrawalListItem struct {
Amount float64 `json:"amount"` // 金额 Amount float64 `json:"amount"` // 金额
ActualAmount float64 `json:"actual_amount"` // 实际到账金额(扣税后) ActualAmount float64 `json:"actual_amount"` // 实际到账金额(扣税后)
TaxAmount float64 `json:"tax_amount"` // 扣税金额 TaxAmount float64 `json:"tax_amount"` // 扣税金额
TaxRate float64 `json:"tax_rate"` // 扣税比例,如 0.06 表示 6%
Status int64 `json:"status"` // 状态 Status int64 `json:"status"` // 状态
PayeeAccount string `json:"payee_account"` // 收款账户 PayeeAccount string `json:"payee_account"` // 收款账户
Remark string `json:"remark"` // 备注 Remark string `json:"remark"` // 备注
@@ -2053,6 +2055,10 @@ type QueryServiceResp struct {
RefreshAfter int64 `json:"refreshAfter"` RefreshAfter int64 `json:"refreshAfter"`
} }
type GetEncryptedSceneIdResp struct {
EncryptedSceneId string `json:"encryptedSceneId"`
}
type QueryShareDetailReq struct { type QueryShareDetailReq struct {
Id string `path:"id"` Id string `path:"id"`
} }
@@ -2198,6 +2204,7 @@ type Withdrawal struct {
Remark string `json:"remark"` Remark string `json:"remark"`
PayeeAccount string `json:"payee_account"` PayeeAccount string `json:"payee_account"`
CreateTime string `json:"create_time"` CreateTime string `json:"create_time"`
TaxRate float64 `json:"tax_rate"` // 扣税比例,如 0.06 表示 6%
} }
type WithdrawalReq struct { type WithdrawalReq struct {
@@ -2217,6 +2224,7 @@ type GetAppVersionResp struct {
} }
type SendSmsReq struct { type SendSmsReq struct {
Mobile string `json:"mobile" validate:"required,mobile"` Mobile string `json:"mobile" validate:"required,mobile"`
ActionType string `json:"actionType" validate:"required,oneof=login register query agentApply realName bindMobile"` ActionType string `json:"actionType" validate:"required,oneof=login register query agentApply realName bindMobile"`
CaptchaVerifyParam string `json:"captchaVerifyParam"`
} }

9
go.mod
View File

@@ -6,9 +6,9 @@ toolchain go1.23.4
require ( require (
github.com/Masterminds/squirrel v1.5.4 github.com/Masterminds/squirrel v1.5.4
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10 github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13
github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6 github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6
github.com/alibabacloud-go/tea v1.2.2 github.com/alibabacloud-go/tea v1.3.13
github.com/alibabacloud-go/tea-utils/v2 v2.0.7 github.com/alibabacloud-go/tea-utils/v2 v2.0.7
github.com/bytedance/sonic v1.13.0 github.com/bytedance/sonic v1.13.0
github.com/cenkalti/backoff/v4 v4.3.0 github.com/cenkalti/backoff/v4 v4.3.0
@@ -37,16 +37,17 @@ require (
require ( require (
filippo.io/edwards25519 v1.1.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect
github.com/alibabacloud-go/captcha-20230305 v1.1.3 // indirect
github.com/alibabacloud-go/debug v1.0.1 // indirect github.com/alibabacloud-go/debug v1.0.1 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
github.com/alibabacloud-go/openapi-util v0.1.0 // indirect github.com/alibabacloud-go/openapi-util v0.1.0 // indirect
github.com/alibabacloud-go/tea-utils v1.3.1 // indirect github.com/alibabacloud-go/tea-utils v1.3.1 // indirect
github.com/alibabacloud-go/tea-xml v1.1.3 // indirect github.com/alibabacloud-go/tea-xml v1.1.3 // indirect
github.com/aliyun/credentials-go v1.3.10 // indirect github.com/aliyun/credentials-go v1.4.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic/loader v0.2.2 // indirect github.com/bytedance/sonic/loader v0.2.2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clbanning/mxj/v2 v2.5.5 // indirect github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/cloudwego/base64x v0.1.5 // indirect github.com/cloudwego/base64x v0.1.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect

33
go.sum
View File

@@ -13,6 +13,8 @@ github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6/go.mod h1:4EUIoxs/do2
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc=
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 h1:zE8vH9C7JiZLNJJQ5OwjU9mSi4T9ef9u3BURT6LCLC8= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 h1:zE8vH9C7JiZLNJJQ5OwjU9mSi4T9ef9u3BURT6LCLC8=
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5/go.mod h1:tWnyE9AjF8J8qqLk645oUmVUnFybApTQWklQmi5tY6g= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5/go.mod h1:tWnyE9AjF8J8qqLk645oUmVUnFybApTQWklQmi5tY6g=
github.com/alibabacloud-go/captcha-20230305 v1.1.3 h1:0Aobw12m3x28aeDMPjwjXsfF8MuLvRjlQ4Hhoy5hFOY=
github.com/alibabacloud-go/captcha-20230305 v1.1.3/go.mod h1:ydzBIN2OiM7eeQPpAFyBrv1H5TY1MtUP2rQig44C4UQ=
github.com/alibabacloud-go/darabonba-array v0.1.0 h1:vR8s7b1fWAQIjEjWnuF0JiKsCvclSRTfDzZHTYqfufY= github.com/alibabacloud-go/darabonba-array v0.1.0 h1:vR8s7b1fWAQIjEjWnuF0JiKsCvclSRTfDzZHTYqfufY=
github.com/alibabacloud-go/darabonba-array v0.1.0/go.mod h1:BLKxr0brnggqOJPqT09DFJ8g3fsDshapUD3C3aOEFaI= github.com/alibabacloud-go/darabonba-array v0.1.0/go.mod h1:BLKxr0brnggqOJPqT09DFJ8g3fsDshapUD3C3aOEFaI=
github.com/alibabacloud-go/darabonba-encode-util v0.0.2 h1:1uJGrbsGEVqWcWxrS9MyC2NG0Ax+GpOM5gtupki31XE= github.com/alibabacloud-go/darabonba-encode-util v0.0.2 h1:1uJGrbsGEVqWcWxrS9MyC2NG0Ax+GpOM5gtupki31XE=
@@ -22,6 +24,8 @@ github.com/alibabacloud-go/darabonba-map v0.0.2/go.mod h1:28AJaX8FOE/ym8OUFWga+M
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ=
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10 h1:GEYkMApgpKEVDn6z12DcH1EGYpDYRB8JxsazM4Rywak= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10 h1:GEYkMApgpKEVDn6z12DcH1EGYpDYRB8JxsazM4Rywak=
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10/go.mod h1:26a14FGhZVELuz2cc2AolvW4RHmIO3/HRwsdHhaIPDE= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10/go.mod h1:26a14FGhZVELuz2cc2AolvW4RHmIO3/HRwsdHhaIPDE=
github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13 h1:Q00FU3H94Ts0ZIHDmY+fYGgB7dV9D/YX6FGsgorQPgw=
github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13/go.mod h1:lxFGfobinVsQ49ntjpgWghXmIF0/Sm4+wvBJ1h5RtaE=
github.com/alibabacloud-go/darabonba-signature-util v0.0.7 h1:UzCnKvsjPFzApvODDNEYqBHMFt1w98wC7FOo0InLyxg= github.com/alibabacloud-go/darabonba-signature-util v0.0.7 h1:UzCnKvsjPFzApvODDNEYqBHMFt1w98wC7FOo0InLyxg=
github.com/alibabacloud-go/darabonba-signature-util v0.0.7/go.mod h1:oUzCYV2fcCH797xKdL6BDH8ADIHlzrtKVjeRtunBNTQ= github.com/alibabacloud-go/darabonba-signature-util v0.0.7/go.mod h1:oUzCYV2fcCH797xKdL6BDH8ADIHlzrtKVjeRtunBNTQ=
github.com/alibabacloud-go/darabonba-string v1.0.2 h1:E714wms5ibdzCqGeYJ9JCFywE5nDyvIXIIQbZVFkkqo= github.com/alibabacloud-go/darabonba-string v1.0.2 h1:E714wms5ibdzCqGeYJ9JCFywE5nDyvIXIIQbZVFkkqo=
@@ -46,6 +50,8 @@ github.com/alibabacloud-go/tea v1.1.19/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy
github.com/alibabacloud-go/tea v1.1.20/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= github.com/alibabacloud-go/tea v1.1.20/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A=
github.com/alibabacloud-go/tea v1.2.2 h1:aTsR6Rl3ANWPfqeQugPglfurloyBJY85eFy7Gc1+8oU= github.com/alibabacloud-go/tea v1.2.2 h1:aTsR6Rl3ANWPfqeQugPglfurloyBJY85eFy7Gc1+8oU=
github.com/alibabacloud-go/tea v1.2.2/go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk= github.com/alibabacloud-go/tea v1.2.2/go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk=
github.com/alibabacloud-go/tea v1.3.13 h1:WhGy6LIXaMbBM6VBYcsDCz6K/TPsT1Ri2hPmmZffZ94=
github.com/alibabacloud-go/tea v1.3.13/go.mod h1:A560v/JTQ1n5zklt2BEpurJzZTI8TUT+Psg2drWlxRg=
github.com/alibabacloud-go/tea-utils v1.3.1 h1:iWQeRzRheqCMuiF3+XkfybB3kTgUXkXX+JMrqfLeB2I= github.com/alibabacloud-go/tea-utils v1.3.1 h1:iWQeRzRheqCMuiF3+XkfybB3kTgUXkXX+JMrqfLeB2I=
github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE=
github.com/alibabacloud-go/tea-utils/v2 v2.0.0/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4= github.com/alibabacloud-go/tea-utils/v2 v2.0.0/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4=
@@ -64,6 +70,8 @@ github.com/aliyun/credentials-go v1.3.1/go.mod h1:8jKYhQuDawt8x2+fusqa1Y6mPxemTs
github.com/aliyun/credentials-go v1.3.6/go.mod h1:1LxUuX7L5YrZUWzBrRyk0SwSdH4OmPrib8NVePL3fxM= github.com/aliyun/credentials-go v1.3.6/go.mod h1:1LxUuX7L5YrZUWzBrRyk0SwSdH4OmPrib8NVePL3fxM=
github.com/aliyun/credentials-go v1.3.10 h1:45Xxrae/evfzQL9V10zL3xX31eqgLWEaIdCoPipOEQA= github.com/aliyun/credentials-go v1.3.10 h1:45Xxrae/evfzQL9V10zL3xX31eqgLWEaIdCoPipOEQA=
github.com/aliyun/credentials-go v1.3.10/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= github.com/aliyun/credentials-go v1.3.10/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U=
github.com/aliyun/credentials-go v1.4.5 h1:O76WYKgdy1oQYYiJkERjlA2dxGuvLRrzuO2ScrtGWSk=
github.com/aliyun/credentials-go v1.4.5/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
@@ -83,6 +91,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E= github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E=
github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4=
github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
@@ -326,10 +336,13 @@ golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -342,6 +355,9 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -356,10 +372,13 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -370,6 +389,9 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -384,20 +406,27 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -406,6 +435,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4= golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
@@ -420,6 +451,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

90
pkg/captcha/aliyun.go Normal file
View File

@@ -0,0 +1,90 @@
package captcha
import (
"context"
"os"
"strings"
"github.com/pkg/errors"
"tyass-server/common/xerr"
captcha20230305 "github.com/alibabacloud-go/captcha-20230305/client"
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
"github.com/alibabacloud-go/tea/tea"
)
type Config struct {
AccessKeyID string
AccessKeySecret string
EndpointURL string
SceneID string
}
// Verify 验证图形验证码,支持微信环境跳过验证
func Verify(cfg Config, captchaVerifyParam string) error {
return VerifyWithContext(context.Background(), cfg, captchaVerifyParam)
}
// VerifyWithContext 带上下文的验证函数
func VerifyWithContext(ctx context.Context, cfg Config, captchaVerifyParam string) error {
// 开发环境直接通过
if os.Getenv("ENV") == "development" {
return nil
}
// 检查是否为微信环境
if isWechatEnvironment(ctx) {
return nil
}
if captchaVerifyParam == "" {
return errors.Wrapf(xerr.NewErrMsg("图形验证码校验失败"), "empty captchaVerifyParam")
}
clientCfg := &openapi.Config{
AccessKeyId: tea.String(cfg.AccessKeyID),
AccessKeySecret: tea.String(cfg.AccessKeySecret),
}
clientCfg.Endpoint = tea.String(cfg.EndpointURL)
client, err := captcha20230305.NewClient(clientCfg)
if err != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "captcha client create error: %+v", err)
}
req := &captcha20230305.VerifyIntelligentCaptchaRequest{
SceneId: tea.String(cfg.SceneID),
CaptchaVerifyParam: tea.String(captchaVerifyParam),
}
resp, err := client.VerifyIntelligentCaptcha(req)
if err != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "captcha verify error: %+v", err)
}
if tea.BoolValue(resp.Body.Result.VerifyResult) {
return nil
}
return errors.Wrapf(xerr.NewErrMsg("图形验证码校验失败"), "verifyResult=false")
}
// isWechatEnvironment 检查是否为微信环境
func isWechatEnvironment(ctx context.Context) bool {
// 从上下文中获取请求头
userAgent := ""
if val := ctx.Value("user-agent"); val != nil {
if ua, ok := val.(string); ok {
userAgent = ua
}
}
if val := ctx.Value("User-Agent"); val != nil {
if ua, ok := val.(string); ok {
userAgent = ua
}
}
// 检查User-Agent是否包含微信标识
if strings.Contains(strings.ToLower(userAgent), "micromessenger") {
return true
}
return false
}

View File

@@ -0,0 +1,28 @@
package captcha
import (
"encoding/base64"
"fmt"
"time"
lzcrypto "tyass-server/pkg/lzkit/crypto"
)
func GenerateEncryptedSceneID(sceneId, ekey string, expireSeconds int) (string, error) {
if expireSeconds <= 0 || expireSeconds > 86400 {
expireSeconds = 3600
}
ts := time.Now().Unix()
plaintext := fmt.Sprintf("%s&%d&%d", sceneId, ts, expireSeconds)
keyBytes, err := base64.StdEncoding.DecodeString(ekey)
if err != nil {
return "", fmt.Errorf("decode ekey error: %w", err)
}
if len(keyBytes) != 32 {
return "", fmt.Errorf("invalid ekey length, need 32 bytes after base64 decode, got %d", len(keyBytes))
}
return lzcrypto.AesEncrypt([]byte(plaintext), keyBytes)
}