106 lines
4.5 KiB
Go
106 lines
4.5 KiB
Go
package invitation
|
|
|
|
import "time"
|
|
|
|
// InviteCodeInfoDTO 用于邀请注册落地页公开展示邀请人信息
|
|
type InviteCodeInfoDTO struct {
|
|
Valid bool `json:"valid"`
|
|
InviteCode string `json:"invite_code"`
|
|
InviterNickname string `json:"inviter_nickname"`
|
|
InviterAvatar string `json:"inviter_avatar"`
|
|
}
|
|
|
|
// UserInvitationSummaryDTO 个人中心邀请返利概览
|
|
type UserInvitationSummaryDTO struct {
|
|
HasInviteCode bool `json:"has_invite_code"`
|
|
InviteCode string `json:"invite_code"`
|
|
InviteLink string `json:"invite_link"`
|
|
IsRealnameVerified bool `json:"is_realname_verified"`
|
|
TotalInvitedCount int64 `json:"total_invited_count"`
|
|
ActiveInvitedCount int64 `json:"active_invited_count"`
|
|
PendingInvitedCount int64 `json:"pending_invited_count"`
|
|
TotalRebateCent int64 `json:"total_rebate_cent"`
|
|
CurrentMonthEstCent int64 `json:"current_month_est_cent"`
|
|
FirstMonthRate float64 `json:"first_month_rate"`
|
|
SecondMonthRate float64 `json:"second_month_rate"`
|
|
SubsequentRate float64 `json:"subsequent_rate"`
|
|
}
|
|
|
|
// InvitedUserRecordDTO 邀请好友记录
|
|
type InvitedUserRecordDTO struct {
|
|
ID uint64 `json:"id"`
|
|
InviteeID uint64 `json:"invitee_id"`
|
|
MaskedPhone string `json:"masked_phone"`
|
|
Nickname string `json:"nickname"`
|
|
AvatarURL string `json:"avatar_url"`
|
|
Status string `json:"status"` // pending=待实名, active=已实名生效
|
|
CycleStage string `json:"cycle_stage"` // first_month, second_month, subsequent, unverified
|
|
DaysSinceVerified int `json:"days_since_verified"`
|
|
VerifiedAt *time.Time `json:"verified_at,omitempty"`
|
|
RegisteredAt time.Time `json:"registered_at"`
|
|
TotalEarnedFromCent int64 `json:"total_earned_from_cent"`
|
|
}
|
|
|
|
// RebateLedgerDTO 返利明细记录
|
|
type RebateLedgerDTO struct {
|
|
ID uint64 `json:"id"`
|
|
OrderID uint64 `json:"order_id"`
|
|
OrderNo string `json:"order_no"`
|
|
InviteeMaskedPhone string `json:"invitee_masked_phone"`
|
|
InviteeNickname string `json:"invitee_nickname"`
|
|
TradeRole string `json:"trade_role"` // buyer / seller
|
|
SingleSideBasisCent int64 `json:"single_side_basis_cent"`
|
|
RateApplied float64 `json:"rate_applied"`
|
|
CycleStage string `json:"cycle_stage"`
|
|
RebateAmountCent int64 `json:"rebate_amount_cent"`
|
|
SettledAt time.Time `json:"settled_at"`
|
|
}
|
|
|
|
// ConfigDTO 返利比例配置 DTO
|
|
type ConfigDTO struct {
|
|
DistributionSiteID uint64 `json:"distribution_site_id"`
|
|
FirstMonthRate float64 `json:"first_month_rate"`
|
|
SecondMonthRate float64 `json:"second_month_rate"`
|
|
SubsequentRate float64 `json:"subsequent_rate"`
|
|
Enabled bool `json:"enabled"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// UpdateConfigRequest 更新返利比例请求
|
|
type UpdateConfigRequest struct {
|
|
FirstMonthRate float64 `json:"first_month_rate" binding:"min=0,max=1"`
|
|
SecondMonthRate float64 `json:"second_month_rate" binding:"min=0,max=1"`
|
|
SubsequentRate float64 `json:"subsequent_rate" binding:"min=0,max=1"`
|
|
Enabled *bool `json:"enabled"`
|
|
}
|
|
|
|
// AdminInvitationQuery 后台查询邀请关系
|
|
type AdminInvitationQuery struct {
|
|
Page int `form:"page,default=1"`
|
|
PageSize int `form:"page_size,default=20"`
|
|
// Phone 为通用手机号搜索:同时匹配邀请人/被邀请人,支持模糊查询。
|
|
Phone string `form:"phone"`
|
|
InviteCode string `form:"invite_code"`
|
|
InviterPhone string `form:"inviter_phone"`
|
|
InviteePhone string `form:"invitee_phone"`
|
|
Status string `form:"status"`
|
|
DistributionSiteID *uint64 `form:"distribution_site_id"`
|
|
// InviterID / InviteeID 供用户管理「明细」按用户精确筛选。
|
|
InviterID uint64 `form:"inviter_id"`
|
|
InviteeID uint64 `form:"invitee_id"`
|
|
}
|
|
|
|
// AdminRebateLedgerQuery 后台查询返利明细
|
|
type AdminRebateLedgerQuery struct {
|
|
Page int `form:"page,default=1"`
|
|
PageSize int `form:"page_size,default=20"`
|
|
OrderNo string `form:"order_no"`
|
|
InviterPhone string `form:"inviter_phone"`
|
|
InviteePhone string `form:"invitee_phone"`
|
|
TradeRole string `form:"trade_role"`
|
|
DistributionSiteID *uint64 `form:"distribution_site_id"`
|
|
// InviterID / InviteeID 供用户管理「明细」按用户精确筛选。
|
|
InviterID uint64 `form:"inviter_id"`
|
|
InviteeID uint64 `form:"invitee_id"`
|
|
}
|