- 修复 FindOrder 在收号站模式(two_party_distributor_receive / three_party)下的 403 权限判定,放行参与方站点成员并精准计算收益 - 串联 distribution_site_payment_channels 至 payment.Start 核心支付发起流程,分销订单优先使用绑定的专属商户通道 - 修复数据大盘 GetDashboardAnalytics 趋势中 ReceivedCount 恒为 0 的问题,并对齐今日订单与 GMV 统计 - 修复 dispute/arbitration.go 仲裁完成时向分销租客发放成长积分的泄漏风险 - 提现管理新增 distribution_site_name/distribution_site_code 字段并在后台列表与详情弹窗中区分展示分销站 - GetPublicSiteInfo 增加 X-Distribution-Site-Code 请求头兜底支持
97 lines
3.7 KiB
Go
97 lines
3.7 KiB
Go
package withdrawal
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// 用户端 DTO
|
|
type WithdrawalDTO struct {
|
|
ID uint64 `json:"id"`
|
|
WithdrawNo string `json:"withdraw_no"`
|
|
UserID uint64 `json:"user_id"`
|
|
DistributionSiteID uint64 `json:"distribution_site_id"`
|
|
AmountCent int64 `json:"amount_cent"`
|
|
FeeCent int64 `json:"fee_cent"`
|
|
ActualAmountCent int64 `json:"actual_amount_cent"`
|
|
AccountType string `json:"account_type"`
|
|
AccountName string `json:"account_name"`
|
|
AccountNo string `json:"account_no"` // 脱敏
|
|
BankName string `json:"bank_name"`
|
|
Status string `json:"status"`
|
|
ReviewRemark string `json:"review_remark"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
ReviewedAt *time.Time `json:"reviewed_at"`
|
|
PaidAt *time.Time `json:"paid_at"`
|
|
}
|
|
|
|
// 管理员端详细 DTO
|
|
type WithdrawalDetailDTO struct {
|
|
ID uint64 `json:"id"`
|
|
WithdrawNo string `json:"withdraw_no"`
|
|
UserID uint64 `json:"user_id"`
|
|
DistributionSiteID uint64 `json:"distribution_site_id"`
|
|
DistributionSiteName string `json:"distribution_site_name"`
|
|
DistributionSiteCode string `json:"distribution_site_code"`
|
|
UserNickname string `json:"user_nickname"`
|
|
UserPhone string `json:"user_phone"`
|
|
AmountCent int64 `json:"amount_cent"`
|
|
FeeCent int64 `json:"fee_cent"`
|
|
ActualAmountCent int64 `json:"actual_amount_cent"`
|
|
PaymentAccountID *uint64 `json:"payment_account_id"`
|
|
AccountType string `json:"account_type"`
|
|
AccountName string `json:"account_name"`
|
|
AccountNo string `json:"account_no"` // 管理员可见完整账号
|
|
BankName string `json:"bank_name"`
|
|
BankBranch string `json:"bank_branch"`
|
|
CertificateURLs []string `json:"certificate_urls"` // 收款二维码图片
|
|
Status string `json:"status"`
|
|
ReviewedBy *uint64 `json:"reviewed_by"`
|
|
ReviewedByName string `json:"reviewed_by_name"`
|
|
ReviewedAt *time.Time `json:"reviewed_at"`
|
|
ReviewRemark string `json:"review_remark"`
|
|
PaidBy *uint64 `json:"paid_by"`
|
|
PaidByName string `json:"paid_by_name"`
|
|
PaidAt *time.Time `json:"paid_at"`
|
|
PaymentProofURL string `json:"payment_proof_url"`
|
|
PaymentRemark string `json:"payment_remark"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type CreateWithdrawalRequest struct {
|
|
PaymentAccountID uint64 `json:"payment_account_id" binding:"required"`
|
|
AmountCent int64 `json:"amount_cent" binding:"required,gt=0"`
|
|
}
|
|
|
|
type ReviewWithdrawalRequest struct {
|
|
Approved *bool `json:"approved" binding:"required"`
|
|
Remark string `json:"remark"`
|
|
}
|
|
|
|
type ConfirmPaymentRequest struct {
|
|
PaymentProofURL string `json:"payment_proof_url"`
|
|
Remark string `json:"remark"`
|
|
}
|
|
|
|
type PaginatedResult struct {
|
|
Items []WithdrawalDTO `json:"items"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|
|
|
|
type AdminPaginatedResult struct {
|
|
Items []WithdrawalDetailDTO `json:"items"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|
|
|
|
type AdminListQuery struct {
|
|
Status string `form:"status"`
|
|
UserID uint64 `form:"user_id"`
|
|
Page int `form:"page"`
|
|
Size int `form:"page_size"`
|
|
}
|