2026-07-11 23:13:10 +08:00
|
|
|
# 代办事项类图
|
|
|
|
|
|
|
|
|
|
```mermaid
|
2026-07-07 21:52:11 +08:00
|
|
|
classDiagram
|
2026-07-11 23:13:10 +08:00
|
|
|
class TodoSourceService {
|
|
|
|
|
<<abstract>>
|
|
|
|
|
+agent_userid: str
|
|
|
|
|
+redis: aioredis.Redis
|
|
|
|
|
+get_todo_list() List~TodoItemData~*
|
|
|
|
|
+get_todo_detail(item_id: str) TodoItemData*
|
2026-07-07 21:52:11 +08:00
|
|
|
}
|
2026-07-09 11:50:19 +08:00
|
|
|
|
2026-07-11 23:13:10 +08:00
|
|
|
class ApprovalTodoService {
|
|
|
|
|
-redis: aioredis.Redis
|
|
|
|
|
-agent_userid: str
|
|
|
|
|
-semaphore: asyncio.Semaphore
|
|
|
|
|
+get_todo_list() List~TodoItemData~
|
|
|
|
|
+get_todo_detail(sp_no: str) TodoItemData
|
|
|
|
|
-_fetch_approval_sp_no_list() List~str~
|
|
|
|
|
-_fetch_approval_details(sp_no_list: List~str~) List~dict~
|
|
|
|
|
-_filter_by_current_approver(details: List~dict~) List~dict~
|
|
|
|
|
-_map_to_todo_item(detail: dict) TodoItemData
|
2026-07-09 11:50:19 +08:00
|
|
|
}
|
|
|
|
|
|
2026-07-11 23:13:10 +08:00
|
|
|
class ITSMService {
|
|
|
|
|
-base_url: str
|
|
|
|
|
-app_id: str
|
|
|
|
|
-app_secret: str
|
|
|
|
|
-redis: aioredis.Redis
|
|
|
|
|
-agent_userid: str
|
|
|
|
|
+get_todo_list() List~TodoItemData~
|
|
|
|
|
+get_todo_detail(workitem_id: str) TodoItemData
|
|
|
|
|
-_do_post(url: str, body: dict) dict
|
|
|
|
|
-_get_workitem_detail(process_instance_id: int, executor: str) dict
|
2026-07-07 21:52:11 +08:00
|
|
|
}
|
2026-07-09 11:50:19 +08:00
|
|
|
|
2026-07-11 23:13:10 +08:00
|
|
|
class ITSMSigner {
|
|
|
|
|
+compute_signature(app_id: str, timestamp: str, app_secret: str, biz_data: dict) str
|
|
|
|
|
-_get_signature_compatible(params: dict) str
|
2026-07-09 11:50:19 +08:00
|
|
|
}
|
|
|
|
|
|
2026-07-11 23:13:10 +08:00
|
|
|
class TodoAggregatorService {
|
|
|
|
|
-redis: aioredis.Redis
|
|
|
|
|
-cache_ttl: int
|
|
|
|
|
+get_todo_list(agent_userid: str, todo_type: Optional~str~) dict
|
|
|
|
|
+get_todo_detail(agent_userid: str, item_id: str, todo_type: str) dict
|
|
|
|
|
-_get_from_cache(agent_userid: str, todo_type: Optional~str~) Optional~dict~
|
|
|
|
|
-_set_to_cache(agent_userid: str, todo_type: Optional~str~, data: dict) void
|
|
|
|
|
-_invalidate_cache(agent_userid: str) void
|
2026-07-07 21:52:11 +08:00
|
|
|
}
|
2026-07-09 11:50:19 +08:00
|
|
|
|
2026-07-11 23:13:10 +08:00
|
|
|
class TodoItemData {
|
|
|
|
|
+id: str
|
|
|
|
|
+type: str
|
|
|
|
|
+title: str
|
|
|
|
|
+priority: str
|
|
|
|
|
+description: dict
|
|
|
|
|
+status: str
|
|
|
|
|
+assigned_agent_id: Optional~str~
|
|
|
|
|
+corp_id: str
|
|
|
|
|
+created_at: str
|
|
|
|
|
+updated_at: str
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TodoSourceService <|-- ApprovalTodoService
|
|
|
|
|
TodoSourceService <|-- ITSMService
|
|
|
|
|
TodoAggregatorService o-- ApprovalTodoService : creates
|
|
|
|
|
TodoAggregatorService o-- ITSMService : creates
|
|
|
|
|
ITSMService --> ITSMSigner : uses
|
|
|
|
|
TodoSourceService ..> TodoItemData : returns
|
|
|
|
|
```
|