feat(#4): 后台抽奖记录列表 GET /admin/lottery/draws
- 分页列出 lottery_draw,join 奖品快照 + 用户邮箱 + 发放账本(grant_ledger) - 支持 activity/user/win/dispatch_state/prize_type/时间窗过滤 - 展示中奖人/奖品/发放状态/发放结果(如"已新建订阅并加 30 天") Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -388,3 +388,56 @@ type AdminLotteryClaimsStatusCount struct {
|
||||
Reviewing int64 `json:"reviewing"`
|
||||
Paying int64 `json:"paying"`
|
||||
}
|
||||
|
||||
// ---- Stage 3 后台抽奖记录(发放流水)--------------------------------------
|
||||
|
||||
// ListAdminLotteryDrawsRequest 列出抽奖记录,支持活动/用户/中奖/发放状态/奖品类型/时间窗过滤。
|
||||
type ListAdminLotteryDrawsRequest struct {
|
||||
ActivityId int64 `form:"activity_id,omitempty"`
|
||||
UserId int64 `form:"user_id,omitempty"`
|
||||
PrizeType string `form:"prize_type,omitempty"`
|
||||
DispatchState string `form:"dispatch_state,omitempty"`
|
||||
Win string `form:"win,omitempty"` // "1"=只看中奖, "0"=只看未中奖, ""=全部
|
||||
From int64 `form:"from,omitempty"`
|
||||
To int64 `form:"to,omitempty"`
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
}
|
||||
|
||||
// AdminLotteryDrawUser 抽奖记录里附带的用户简况。
|
||||
type AdminLotteryDrawUser struct {
|
||||
Id int64 `json:"id"`
|
||||
Email string `json:"email,omitempty"`
|
||||
}
|
||||
|
||||
// AdminLotteryDrawPrize 抽奖记录里的奖品快照(抽奖时刻冻结)。
|
||||
type AdminLotteryDrawPrize struct {
|
||||
Slot int `json:"slot"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Config json.RawMessage `json:"config"`
|
||||
}
|
||||
|
||||
// AdminLotteryDraw 是后台抽奖记录视图:谁、何时、中了什么、发放状态与结果。
|
||||
type AdminLotteryDraw struct {
|
||||
DrawId int64 `json:"draw_id"`
|
||||
ActivityId int64 `json:"activity_id"`
|
||||
User AdminLotteryDrawUser `json:"user"`
|
||||
IsWin bool `json:"is_win"`
|
||||
Prize *AdminLotteryDrawPrize `json:"prize,omitempty"`
|
||||
DispatchState string `json:"dispatch_state"`
|
||||
DispatchError string `json:"dispatch_error,omitempty"`
|
||||
// GrantAmount / GrantMessage 来自 lottery_grant_ledger(自动奖发放结果):
|
||||
// vpn_duration=天数,commission=分;message 如"已新建订阅并加 30 天"。
|
||||
GrantAmount int64 `json:"grant_amount,omitempty"`
|
||||
GrantMessage string `json:"grant_message,omitempty"`
|
||||
DrawnAt int64 `json:"drawn_at"`
|
||||
DispatchedAt int64 `json:"dispatched_at,omitempty"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
|
||||
// ListAdminLotteryDrawsResponse 分页。
|
||||
type ListAdminLotteryDrawsResponse struct {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminLotteryDraw `json:"list"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user