e8e3a3a72b
- 分页列出 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>
91 lines
2.8 KiB
Plaintext
91 lines
2.8 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "Lottery Admin API"
|
|
desc: "Admin-facing lottery endpoints for HIF-3 Stage 1"
|
|
author: "hifast"
|
|
version: "0.1.0"
|
|
)
|
|
|
|
import "../types.api"
|
|
|
|
@server (
|
|
prefix: v1/admin/lottery
|
|
group: admin/lottery
|
|
middleware: AuthMiddleware
|
|
)
|
|
service ppanel {
|
|
@doc "Create a new activity (status=draft)"
|
|
@handler CreateLotteryActivity
|
|
post /activities (CreateAdminLotteryActivityRequest) returns (AdminLotteryActivity)
|
|
|
|
@doc "Update mutable activity fields"
|
|
@handler UpdateLotteryActivity
|
|
put /activities (UpdateAdminLotteryActivityRequest) returns (AdminLotteryActivity)
|
|
|
|
@doc "List activities (paginated)"
|
|
@handler ListLotteryActivities
|
|
get /activities (ListAdminLotteryActivitiesRequest) returns (ListAdminLotteryActivitiesResponse)
|
|
|
|
@doc "Get one activity"
|
|
@handler GetLotteryActivity
|
|
get /activities/detail (AdminActivityIdRequest) returns (AdminLotteryActivity)
|
|
|
|
@doc "Publish (draft/paused → running)"
|
|
@handler PublishLotteryActivity
|
|
post /activities/publish (AdminActivityIdRequest)
|
|
|
|
@doc "Pause (running → paused)"
|
|
@handler PauseLotteryActivity
|
|
post /activities/pause (AdminActivityIdRequest)
|
|
|
|
@doc "Update eligibility/chance_sources (rule-caps enforced)"
|
|
@handler UpdateLotteryRules
|
|
put /activities/rules (UpdateAdminLotteryRulesRequest)
|
|
|
|
@doc "Create prize"
|
|
@handler CreateLotteryPrize
|
|
post /prizes (CreateAdminLotteryPrizeRequest) returns (AdminLotteryPrize)
|
|
|
|
@doc "Update prize"
|
|
@handler UpdateLotteryPrize
|
|
put /prizes/:id (UpdateAdminLotteryPrizeRequest) returns (AdminLotteryPrize)
|
|
|
|
@doc "Delete prize"
|
|
@handler DeleteLotteryPrize
|
|
delete /prizes/:id (AdminPrizeIdRequest)
|
|
|
|
@doc "List prizes on an activity"
|
|
@handler ListLotteryPrizes
|
|
get /prizes (ListAdminLotteryPrizesRequest) returns (ListAdminLotteryPrizesResponse)
|
|
|
|
@doc "Manually grant N chances to a user (idempotent by source_ref)"
|
|
@handler GrantLotteryChance
|
|
post /chances/grant (GrantAdminLotteryChanceRequest)
|
|
|
|
// Stage 2 (HIF-4): 人工奖工单接口
|
|
@doc "List manual-claim work orders (filter by type/status/activity/user/time)"
|
|
@handler ListLotteryClaims
|
|
get /claims (ListAdminLotteryClaimsRequest) returns (ListAdminLotteryClaimsResponse)
|
|
|
|
@doc "Summary counts for claims workbench"
|
|
@handler LotteryClaimsSummary
|
|
get /claims/summary returns (AdminLotteryClaimsSummary)
|
|
|
|
@doc "Approve a claim (reviewing -> paying)"
|
|
@handler ApproveLotteryClaim
|
|
post /claims/approve (AdminApproveClaimRequest)
|
|
|
|
@doc "Reject a claim (reviewing/paying -> rejected; user may resubmit)"
|
|
@handler RejectLotteryClaim
|
|
post /claims/reject (AdminRejectClaimRequest)
|
|
|
|
@doc "Mark as paid (paying -> paid, records tx_hash/delivery_ref)"
|
|
@handler MarkPaidLotteryClaim
|
|
post /claims/mark-paid (AdminMarkPaidClaimRequest)
|
|
|
|
@doc "List lottery draws (grant records)"
|
|
@handler ListLotteryDraws
|
|
get /draws (ListAdminLotteryDrawsRequest) returns (ListAdminLotteryDrawsResponse)
|
|
}
|