优化开箱次数判断

This commit is contained in:
HibiKier
2022-07-23 14:09:17 +08:00
parent 62965fe1df
commit 1f01ba1d10
35 changed files with 511 additions and 507 deletions
+7 -7
View File
@@ -76,7 +76,7 @@ async def _(user: User = Depends(token_to_user)) -> Result:
async def get_system_data(user: User = Depends(token_to_user)):
"""
说明:
说明:
获取系统信息,资源文件大小,网络状态等
"""
baidu = 200
@@ -107,7 +107,7 @@ async def get_system_data(user: User = Depends(token_to_user)):
def _get_system_status(user: User = Depends(token_to_user)) -> SystemStatus:
"""
说明:
说明:
获取系统信息等
"""
cpu = psutil.cpu_percent()
@@ -126,7 +126,7 @@ def _get_system_disk(
type_: Optional[str], user: User = Depends(token_to_user)
) -> Union[SystemFolderSize, Dict[str, Union[float, datetime]]]:
"""
说明:
说明:
获取资源文件大小等
"""
if not type_:
@@ -171,9 +171,9 @@ def _get_system_disk(
def _get_dir_size(dir_path: Path) -> float:
"""
说明:
说明:
获取文件夹大小
参数:
参数:
:param dir_path: 文件夹路径
"""
size = 0
@@ -184,9 +184,9 @@ def _get_dir_size(dir_path: Path) -> float:
def save_system_data(cpu: float, memory: float, disk: float):
"""
说明:
说明:
保存一些系统信息
参数:
参数:
:param cpu: cpu
:param memory: memory
:param disk: disk