From 2d46f0a1f7261ce73d8376677ec3c2fa4ea4df41 Mon Sep 17 00:00:00 2001 From: QSummerY <51444798+QSummerY@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:04:38 +0800 Subject: [PATCH] Update schemas.py (#158) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit params dict 中可能存在不同类型的数据,不约束其子类型 https://docs.pydantic.dev/latest/usage/types/dicts_mapping/ --- helpdesk/views/api/schemas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpdesk/views/api/schemas.py b/helpdesk/views/api/schemas.py index a51aa8f1..be321879 100644 --- a/helpdesk/views/api/schemas.py +++ b/helpdesk/views/api/schemas.py @@ -3,7 +3,7 @@ """ from enum import Enum from datetime import datetime -from typing import Dict, List, Optional +from typing import List, Optional from pydantic import BaseModel @@ -138,14 +138,14 @@ class NotifyMessage(BaseModel): status: str is_approved: bool submitter: str - params: Dict[str, str] + params: dict request_time: datetime reason: str = "" approval_flow: str = "" current_node: str = "" approvers: str = "" next_node: Optional[str] = "" - approval_log: List[Dict] = [] + approval_log: List[dict] = [] notify_type: str notify_people: str = "" comfirmed_by: str = ""