chore(init): 初始化解忧商行项目并完成 Phase 0 基座
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
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"`
|
||||
Source string `form:"source"`
|
||||
StartDate string `form:"start_date"`
|
||||
EndDate string `form:"end_date"`
|
||||
DistributionSiteID *uint64 `form:"distribution_site_id"`
|
||||
// InviterID / InviteeID 供用户管理「明细」按用户精确筛选。
|
||||
InviterID uint64 `form:"inviter_id"`
|
||||
InviteeID uint64 `form:"invitee_id"`
|
||||
}
|
||||
|
||||
// AdminRebateSummaryDTO 返利统计页汇总数据,所有金额单位为分。
|
||||
type AdminRebateSummaryDTO struct {
|
||||
TotalRebateCent int64 `json:"total_rebate_cent"`
|
||||
LedgerCount int64 `json:"ledger_count"`
|
||||
InviterCount int64 `json:"inviter_count"`
|
||||
InviteeCount int64 `json:"invitee_count"`
|
||||
AvgRebateCent int64 `json:"avg_rebate_cent"`
|
||||
OrderRebateCent int64 `json:"order_rebate_cent"`
|
||||
OrderCount int64 `json:"order_count"`
|
||||
PickupRebateCent int64 `json:"pickup_rebate_cent"`
|
||||
PickupCount int64 `json:"pickup_count"`
|
||||
BuyerRebateCent int64 `json:"buyer_rebate_cent"`
|
||||
BuyerCount int64 `json:"buyer_count"`
|
||||
SellerRebateCent int64 `json:"seller_rebate_cent"`
|
||||
SellerCount int64 `json:"seller_count"`
|
||||
FirstMonthCent int64 `json:"first_month_cent"`
|
||||
SecondMonthCent int64 `json:"second_month_cent"`
|
||||
SubsequentCent int64 `json:"subsequent_cent"`
|
||||
Daily []AdminRebateDailyStat `json:"daily"`
|
||||
TopInviters []AdminRebateInviterStat `json:"top_inviters"`
|
||||
}
|
||||
|
||||
type AdminRebateDailyStat struct {
|
||||
Date string `json:"date"`
|
||||
LedgerCount int64 `json:"ledger_count"`
|
||||
RebateAmountCent int64 `json:"rebate_amount_cent"`
|
||||
OrderAmountCent int64 `json:"order_amount_cent"`
|
||||
PickupAmountCent int64 `json:"pickup_amount_cent"`
|
||||
}
|
||||
|
||||
type AdminRebateInviterStat struct {
|
||||
InviterID uint64 `json:"inviter_id"`
|
||||
InviterPhone string `json:"inviter_phone"`
|
||||
InviterNickname string `json:"inviter_nickname"`
|
||||
LedgerCount int64 `json:"ledger_count"`
|
||||
RebateAmountCent int64 `json:"rebate_amount_cent"`
|
||||
}
|
||||
Reference in New Issue
Block a user