60 lines
1.1 KiB
Python
60 lines
1.1 KiB
Python
from datetime import datetime
|
|
|
|
from ninja import Schema
|
|
|
|
|
|
class SolutionIn(Schema):
|
|
title: str
|
|
problem_signature: str
|
|
related_system: str = ""
|
|
environment_scope: str = ""
|
|
root_cause: str
|
|
solution: str
|
|
risk_note: str = ""
|
|
status: str = "draft"
|
|
|
|
|
|
class SolutionOut(Schema):
|
|
id: int
|
|
title: str
|
|
problem_signature: str
|
|
related_system: str
|
|
environment_scope: str
|
|
root_cause: str
|
|
solution: str
|
|
risk_note: str
|
|
status: str
|
|
usage_count: int
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
|
|
class TicketSolutionLinkIn(Schema):
|
|
ticket_id: int
|
|
link_type: str = "referenced"
|
|
agent_run_id: int | None = None
|
|
|
|
|
|
class AdoptSolutionIn(Schema):
|
|
ticket_id: int
|
|
remark: str = "采纳解决方案并关闭工单"
|
|
replied_to_customer: bool = True
|
|
|
|
|
|
class TicketSolutionLinkOut(Schema):
|
|
id: int
|
|
ticket_id: int
|
|
solution_id: int
|
|
link_type: str
|
|
solution_usage_count: int
|
|
created_at: datetime
|
|
|
|
|
|
class TicketSolutionOut(Schema):
|
|
id: int
|
|
ticket_id: int
|
|
solution_id: int
|
|
link_type: str
|
|
solution: SolutionOut
|
|
created_at: datetime
|