feat(i18n): 接入翻译 provider worker
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

Closes #44
This commit is contained in:
2026-08-30 21:13:31 +08:00
parent 7f465523e1
commit f441f1810e
29 changed files with 3815 additions and 130 deletions
+103 -1
View File
@@ -139,6 +139,80 @@ paths:
description: Missing or invalid admin token.
"503":
description: Rust bat schedule backend is unavailable.
/admin/translation/tasks:
get:
summary: List Rust-owned translation task worker status
parameters:
- name: offset
in: query
schema:
type: integer
minimum: 0
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 1000
- name: task_id
in: query
schema:
type: string
- name: release_id
in: query
schema:
type: string
- name: destination
in: query
schema:
type: string
- name: archive_entry
in: query
schema:
type: string
- name: status
in: query
schema:
type: string
- name: worker_status
in: query
schema:
type: string
- name: parse_status
in: query
schema:
type: string
- name: format
in: query
schema:
type: string
- name: has_reason
in: query
schema:
type: boolean
- name: has_failure_reason
in: query
schema:
type: boolean
responses:
"200":
description: Current translation task JSON report from Rust bat.
"400":
description: Invalid translation task query.
"401":
description: Missing or invalid admin token.
"503":
description: Rust bat translation backend is unavailable.
/admin/translation/handoff:
get:
summary: Read Rust-owned translation handoff state
responses:
"200":
description: Current translation handoff JSON report from Rust bat.
"401":
description: Missing or invalid admin token.
"503":
description: Rust bat translation backend is unavailable.
/admin/control/{action}:
post:
summary: Forward an allowlisted control or schedule action to Rust bat
@@ -148,7 +222,7 @@ paths:
required: true
schema:
type: string
enum: [reload, refresh, restart, sync, verify, repair, catalog-refresh, schedule-add, schedule-update, schedule-remove, schedule-run, translation-task-update, translation-proofread]
enum: [reload, refresh, restart, sync, verify, repair, catalog-refresh, schedule-add, schedule-update, schedule-remove, schedule-run, translation-task-update, translation-worker-run, translation-proofread]
requestBody:
required: false
content:
@@ -199,6 +273,34 @@ paths:
type: string
provider_run_id:
type: string
provider:
type: string
enum: [mock, crowdin]
fixture_path:
type: string
concurrency:
type: integer
format: int64
minimum: 1
maximum: 256
max_attempts:
type: integer
format: int64
minimum: 1
lease_seconds:
type: integer
format: int64
minimum: 1
retry_backoff_seconds:
type: integer
format: int64
minimum: 0
max_tasks:
type: integer
format: int64
minimum: 1
worker_id:
type: string
responses:
"202":
description: Rust bat accepted the control request.