mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 08:14:55 +08:00
@@ -273,6 +273,58 @@ type TranslationTaskUpdateParams struct {
|
||||
ProviderRunID string `json:"provider_run_id,omitempty"`
|
||||
}
|
||||
|
||||
// TranslationTaskListParams filters the Rust-owned translation task queue.
|
||||
// The result shape is intentionally left as Rust JSON so Go does not duplicate
|
||||
// the translation task schema.
|
||||
type TranslationTaskListParams struct {
|
||||
Offset *uint64 `json:"offset,omitempty"`
|
||||
Limit *uint64 `json:"limit,omitempty"`
|
||||
TaskID string `json:"task_id,omitempty"`
|
||||
ReleaseID string `json:"release_id,omitempty"`
|
||||
Destination string `json:"destination,omitempty"`
|
||||
PathPattern string `json:"path_pattern,omitempty"`
|
||||
ArchiveEntry string `json:"archive_entry,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
WorkerStatus string `json:"worker_status,omitempty"`
|
||||
ParseStatus string `json:"parse_status,omitempty"`
|
||||
Format string `json:"format,omitempty"`
|
||||
HasReason *bool `json:"has_reason,omitempty"`
|
||||
HasFailureReason *bool `json:"has_failure_reason,omitempty"`
|
||||
}
|
||||
|
||||
// TranslationWorkerRunParams starts one Rust-owned provider worker task.
|
||||
// Pointer numeric fields preserve explicit zeroes so Rust can reject invalid
|
||||
// dashboard input instead of receiving omitted defaults.
|
||||
type TranslationWorkerRunParams struct {
|
||||
Provider string `json:"provider,omitempty"`
|
||||
FixturePath string `json:"fixture_path,omitempty"`
|
||||
Concurrency *uint64 `json:"concurrency,omitempty"`
|
||||
MaxAttempts *uint64 `json:"max_attempts,omitempty"`
|
||||
LeaseSeconds *uint64 `json:"lease_seconds,omitempty"`
|
||||
RetryBackoffSeconds *uint64 `json:"retry_backoff_seconds,omitempty"`
|
||||
MaxTasks *uint64 `json:"max_tasks,omitempty"`
|
||||
WorkerID string `json:"worker_id,omitempty"`
|
||||
}
|
||||
|
||||
// TranslationWorkerConfig mirrors the accepted worker config returned by Rust.
|
||||
type TranslationWorkerConfig struct {
|
||||
Provider string `json:"provider"`
|
||||
FixturePath string `json:"fixture_path,omitempty"`
|
||||
Concurrency uint64 `json:"concurrency"`
|
||||
MaxAttempts uint64 `json:"max_attempts"`
|
||||
LeaseSeconds uint64 `json:"lease_seconds"`
|
||||
RetryBackoffSeconds uint64 `json:"retry_backoff_seconds"`
|
||||
MaxTasks *uint64 `json:"max_tasks,omitempty"`
|
||||
WorkerID string `json:"worker_id"`
|
||||
}
|
||||
|
||||
// TranslationWorkerRunResult is returned when translation.worker.run is queued.
|
||||
type TranslationWorkerRunResult struct {
|
||||
TaskID string `json:"task_id"`
|
||||
Kind string `json:"kind"`
|
||||
Worker TranslationWorkerConfig `json:"worker"`
|
||||
}
|
||||
|
||||
// TranslationProofread marks the current localized workflow as manual
|
||||
// proofreading. Rust owns the persisted localized state.
|
||||
func (c *Client) TranslationProofread(ctx context.Context) (json.RawMessage, error) {
|
||||
@@ -502,6 +554,20 @@ func (c *Client) TranslationTaskUpdate(ctx context.Context, params TranslationTa
|
||||
return c.rawData(ctx, "translation.task.update", params)
|
||||
}
|
||||
|
||||
func (c *Client) TranslationTasks(ctx context.Context, params TranslationTaskListParams) (json.RawMessage, error) {
|
||||
return c.rawData(ctx, "translation.tasks", params)
|
||||
}
|
||||
|
||||
func (c *Client) TranslationHandoff(ctx context.Context) (json.RawMessage, error) {
|
||||
return c.rawData(ctx, "translation.handoff", nil)
|
||||
}
|
||||
|
||||
func (c *Client) TranslationWorkerRun(ctx context.Context, params TranslationWorkerRunParams) (*TranslationWorkerRunResult, error) {
|
||||
var out TranslationWorkerRunResult
|
||||
_, err := c.Call(ctx, "translation.worker.run", params, &out)
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *Client) CatalogStatus(ctx context.Context) (json.RawMessage, error) {
|
||||
return c.rawData(ctx, "catalog.status", nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user