package emailcli import ( "context" "fmt" ) // ListCheckLogs 分页查询发信账号的健康检查记录。 // // GET /api/v1/check-logs?page=&page_size=&sender_account_id=&start_date=&end_date= ServiceAuth func (c *Client) ListCheckLogs(ctx context.Context, q CheckLogQuery) (*PaginationResult[CheckLog], error) { params := mergeParams(paginationParams(q.PaginationQuery), map[string]interface{}{ "sender_account_id": q.SenderAccountID, "start_date": q.StartDate, "end_date": q.EndDate, }) return get[*PaginationResult[CheckLog]](c, ctx, "/api/v1/check-logs", buildQuery(params)) } // GetCheckSummary 获取全部发信账号的健康汇总(近期成功率、状态等)。 // // GET /api/v1/check-logs/summary ServiceAuth func (c *Client) GetCheckSummary(ctx context.Context) ([]SenderHealth, error) { return get[[]SenderHealth](c, ctx, "/api/v1/check-logs/summary", nil) } // TriggerCheck 手动触发一次指定发信账号的健康检查(同步返回结果)。 // // POST /api/v1/check-logs/trigger/{senderAccountID} ServiceAuth func (c *Client) TriggerCheck(ctx context.Context, senderAccountID uint) (*TriggerCheckResp, error) { return post[*TriggerCheckResp](c, ctx, fmt.Sprintf("/api/v1/check-logs/trigger/%d", senderAccountID), nil) }