feat: 添加事件类型中文名称翻译字典

This commit is contained in:
jxxghp
2025-07-23 15:35:04 +08:00
parent 8e4f12804b
commit d6d12c0335
2 changed files with 32 additions and 2 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ from app.db.user_oper import get_current_active_user
from app.db.workflow_oper import WorkflowOper
from app.helper.workflow import WorkflowHelper
from app.scheduler import Scheduler
from app.schemas.types import EventType
from app.schemas.types import EventType, EVENT_TYPE_NAMES
router = APIRouter()
@@ -74,7 +74,7 @@ def get_event_types(_: schemas.TokenPayload = Depends(get_current_active_user))
获取所有事件类型
"""
return [{
"title": event_type.name,
"title": EVENT_TYPE_NAMES.get(event_type, event_type.name),
"value": event_type.value
} for event_type in EventType]