Skip to content

Commit 72873d6

Browse files
committed
refactor(daemon): 调整DaemonSystemInfo和DaemonStatus类结构
重命名DaemonSystemInfo为DaemonStatus,原DaemonStatus类内容 移至新的DaemonSystemInfo中作为继承关系,优化类层次结构。
1 parent 5594f9e commit 72873d6

1 file changed

Lines changed: 16 additions & 26 deletions

File tree

mcsmapi/models/daemon.py

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,9 @@ class DaemonConfig(BaseModel):
135135
"""远程节点的apiKey"""
136136

137137

138-
class DaemonSystemInfo(DaemonOperation):
139-
"""节点信息"""
138+
class DaemonStatus(DaemonOperation):
139+
"""节点状态信息"""
140140

141-
version: str | None = None
142-
"""节点版本"""
143-
process: ProcessInfo | None = None
144-
"""节点进程信息"""
145-
instance: InstanceStat | None = None
146-
"""节点实例统计信息"""
147-
system: SystemInfo | None = None
148-
"""节点系统信息"""
149-
cpuMemChart: list[CpuMemChart] | None = None
150-
"""cpu和内存使用趋势"""
151-
config: DaemonSetting | None = None
152-
"""节点配置信息"""
153141
available: bool
154142
"""节点可用状态"""
155143
ip: str
@@ -162,19 +150,21 @@ class DaemonSystemInfo(DaemonOperation):
162150
"""节点备注"""
163151

164152

165-
class DaemonStatus(DaemonOperation):
166-
"""节点状态信息"""
153+
class DaemonSystemInfo(DaemonStatus):
154+
"""节点信息"""
167155

168-
ip: str = "localhost"
169-
"""远程节点的ip"""
170-
port: int = 24444
171-
"""远程节点的端口"""
172-
prefix: str = ""
173-
"""远程节点的路径前缀"""
174-
remarks: str = "Unnamed Node"
175-
"""远程节点的备注"""
176-
available: bool
177-
"""节点可用状态"""
156+
version: str | None = None
157+
"""节点版本"""
158+
process: ProcessInfo | None = None
159+
"""节点进程信息"""
160+
instance: InstanceStat | None = None
161+
"""节点实例统计信息"""
162+
system: SystemInfo | None = None
163+
"""节点系统信息"""
164+
cpuMemChart: list[CpuMemChart] | None = None
165+
"""cpu和内存使用趋势"""
166+
config: DaemonSetting | None = None
167+
"""节点配置信息"""
178168

179169

180170
class DaemonInfo(DaemonStatus):

0 commit comments

Comments
 (0)