chore: 并入 iotlcm-worker-svr 历史到 worker-svr/(原提交 96f0f4e)

This commit is contained in:
MiFaZhan
2026-11-02 13:28:03 +08:00
422 changed files with 80993 additions and 0 deletions
@@ -0,0 +1,28 @@
package contract
import "net/url"
const (
ListRunsRoute = "/internal/v1/full-sync-runs"
GetRunRoute = "/internal/v1/full-sync-runs/{runId}"
GetFailuresRoute = "/internal/v1/full-sync-runs/{runId}/failures"
PostReplayRoute = "/internal/v1/full-sync-runs/{runId}/replay"
GetActionRoute = "/internal/v1/full-sync-actions/{actionId}"
IdempotencyHeader = "Idempotency-Key"
)
// ReplayAccepted is the 202 response from a successful ReplayRequester call.
// A repeated request returns the original action and its current status.
type ReplayAccepted struct {
ActionID string `json:"actionId"`
TargetRunID string `json:"targetRunId"`
Status ActionStatus `json:"status"`
StatusURL string `json:"statusUrl"`
}
func ActionStatusURL(actionID string) (string, error) {
if err := ValidateID(actionID); err != nil {
return "", err
}
return "/internal/v1/full-sync-actions/" + url.PathEscape(actionID), nil
}