From 9d46299f8f07a66d7c2ab64d64d0775395532a45 Mon Sep 17 00:00:00 2001 From: Miyamizu-MitsuhaSang <2510681107@qq.com> Date: Sat, 8 Nov 2025 22:35:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=AF=AD=E7=BF=BB=E8=AF=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- app/schemas/trans_schemas.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 798ebc9..6909626 100644 --- a/README.md +++ b/README.md @@ -544,8 +544,8 @@ Authorization: Bearer - **请求参数说明**: - `query`: 待翻译的文本 - - `from_lang`: 源语言,支持值: `auto`(自动检测), `fr`(法语), `jp`(日语), `zh`(中文),默认为 `auto` - - `to_lang`: 目标语言,支持值: `fr`(法语), `jp`(日语), `zh`(中文),默认为 `zh`,不能为 `auto` + - `from_lang`: 源语言,支持值: `auto`(自动检测), `fra`(法语), `jp`(日语), `zh`(中文),默认为 `auto` + - `to_lang`: 目标语言,支持值: `fra`(法语), `jp`(日语), `zh`(中文),默认为 `zh`,不能为 `auto` - **响应**: diff --git a/app/schemas/trans_schemas.py b/app/schemas/trans_schemas.py index edec1b9..a345325 100644 --- a/app/schemas/trans_schemas.py +++ b/app/schemas/trans_schemas.py @@ -11,7 +11,7 @@ class TransRequest(BaseModel): @field_validator('from_lang', 'to_lang') @classmethod def validate_lang(cls, v): - allowed_langs = {'auto', 'fr', 'jp', 'zh', 'en'} + allowed_langs = {'auto', 'fra', 'jp', 'zh', 'en'} if v not in allowed_langs: raise ValueError(f'Unsupported language: {v}') return v