Skip to content

Commit

Permalink
pydantic migration
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote committed Sep 14, 2023
1 parent 8f82c1f commit 752b0c8
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions helpdesk/views/api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ class QeuryKey(str, Enum):


class ParamRule(BaseModel):
id: Optional[int]
title: Optional[str]
provider_object: Optional[str]
rule: Optional[str]
is_auto_approval: Optional[bool]
approver: Optional[str]
id: Optional[int] = None
title: Optional[str] = None
provider_object: Optional[str] = None
rule: Optional[str] = None
is_auto_approval: Optional[bool] = None
approver: Optional[str] = None


class OperateTicket(BaseModel):
"""
操作工单的请求体
"""
reason: Optional[str]
reason: Optional[str] = None


class PolicyFlowResp(BaseModel):
Expand All @@ -48,12 +48,12 @@ class PolicyFlowResp(BaseModel):
id: int
name: str
display: str
definition: Optional[dict]
definition: Optional[dict] = None

created_at: datetime
created_by: Optional[str]
created_by: Optional[str] = None
updated_at: datetime
updated_by: Optional[str]
updated_by: Optional[str] = None

class Config:
orm_mode = True
Expand Down Expand Up @@ -120,9 +120,9 @@ class TicketPolicyResp(BaseModel):
工单和审批流关联的响应体
"""
id: int
ticket_name: Optional[str]
policy_id: Optional[int]
link_condition: Optional[str]
ticket_name: Optional[str] = None
policy_id: Optional[int] = None
link_condition: Optional[str] = None

class Config:
orm_mode = True
Expand Down

0 comments on commit 752b0c8

Please sign in to comment.