抢购控制台支持查看精英手册兑换记录,发布0.3.7
此前只有和平小店能在控制台查兑换记录,精英/电竞手册只能去别的页面或客户端看。 现在账号作战表直接带上"兑换记录"列:查询一次就能看到每个账号兑换了什么、什么时候、 花多少积分,点"记录"看该账号全部明细。 - 新增 QueryExchangeRecords 批量查询(手册类活动):复用既有的并发 lookupExchangeRecords, 记录不做任何过滤("看我的兑换记录"不该藏东西),记录自带商品名与积分 - 商品筛选为可选项:不选=看全部记录;选了则额外标记该账号是否兑换过它(已兑换/未兑换) - 手册的商品筛选用本地状态,不写回全局商品选择——免得只是想看记录却把抢购目标改掉; 和平小店沿用原来的全局商品选择 - 账号表"兑换记录"列对所有活动可见;手册侧展示条数与最近一条(商品名 + 时间), 小店的"已兑换/未兑换 + 订单状态"保持原样 - 每行"记录"弹窗:若已批量查询过就直接复用结果不再打接口;否则手册走 VerifyExchange, 小店走原有订单查询。弹窗表格按活动切换列(手册:商品/数量/兑换时间/积分/昵称) - 聚合逻辑抽成纯函数 buildExchangeRecordsResult 并补测试 (记录不过滤、命中按商品统计、空 Cookie 与查询失败分开计数、未选商品不做命中判断)
This commit is contained in:
@@ -89,6 +89,28 @@ type XiaodianAssetsResult struct {
|
||||
Results map[string]XiaodianAssets `json:"results"`
|
||||
}
|
||||
|
||||
// ExchangeRecordsBatchResult 手册类活动(精英手册/电竞手册)的兑换记录批量查询结果。
|
||||
// 与和平小店的批量查询对应,区别是手册记录自带商品名与积分,商品可以不选;
|
||||
// 选了商品就在每个账号上标记是否兑换过它(对应界面的"已兑换/未兑换")。
|
||||
type ExchangeRecordsBatchResult struct {
|
||||
Success bool `json:"success"`
|
||||
ProductID string `json:"productId,omitempty"`
|
||||
ProductName string `json:"productName,omitempty"`
|
||||
Results map[string]ExchangeAccountRecords `json:"results"`
|
||||
Total int `json:"total"`
|
||||
Matched int `json:"matched"`
|
||||
Failed int `json:"failed"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// ExchangeAccountRecords 单个账号的兑换记录。
|
||||
type ExchangeAccountRecords struct {
|
||||
Success bool `json:"success"`
|
||||
Records []ExchangeRecord `json:"records,omitempty"`
|
||||
Matched bool `json:"matched"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// ExchangeRecordsResult 兑换记录查询结果。
|
||||
type ExchangeRecordsResult struct {
|
||||
Success bool `json:"success"`
|
||||
|
||||
Reference in New Issue
Block a user