新增小店抢购报告导出并优化停止条件

This commit is contained in:
yml2213
2026-08-09 16:06:46 +08:00
parent 8b867709b2
commit 0c55da1e97
12 changed files with 884 additions and 19 deletions
+37
View File
@@ -0,0 +1,37 @@
package types
import "time"
// XiaodianRunReport 保存一次和平小店抢购的可导出快照,不包含 Cookie 等敏感凭据。
type XiaodianRunReport struct {
ReportID string `json:"reportId"`
StartedAt time.Time `json:"startedAt"`
FinishedAt time.Time `json:"finishedAt"`
Stopped bool `json:"stopped"`
Accounts []XiaodianRunReportAccount `json:"accounts"`
}
// XiaodianRunReportAccount 是单个账号在一次小店任务中的最终状态。
type XiaodianRunReportAccount struct {
AccountName string `json:"accountName"`
ProductID string `json:"productId"`
ProductName string `json:"productName"`
ProductPrice int `json:"productPrice"`
PayType int `json:"payType"`
PayLabel string `json:"payLabel"`
Attempts int `json:"attempts"`
Status string `json:"status"`
FailureReason string `json:"failureReason,omitempty"`
LastMessage string `json:"lastMessage,omitempty"`
RoleName string `json:"roleName,omitempty"`
}
// XiaodianReportExportResult 是最近一次小店任务报告的导出结果。
type XiaodianReportExportResult struct {
Success bool `json:"success"`
Cancelled bool `json:"cancelled"`
FilePath string `json:"filePath,omitempty"`
AccountCount int `json:"accountCount"`
RecordCount int `json:"recordCount"`
Error string `json:"error,omitempty"`
}