fix ObjectUtils

This commit is contained in:
jxxghp
2023-07-12 12:46:18 +08:00
parent df275c16ba
commit 880e0c4bd3
2 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,7 @@ def get_progress(process_type: str, token: str):
return StreamingResponse(event_generator(), media_type="text/event-stream")
@router.get("/setting/{key}", summary="查询系统设置")
@router.get("/setting/{key}", summary="查询系统设置", response_model=schemas.Response)
def get_setting(key: str, _: schemas.TokenPayload = Depends(verify_token)):
"""
查询系统设置
@ -47,7 +47,7 @@ def get_setting(key: str, _: schemas.TokenPayload = Depends(verify_token)):
})
@router.post("/setting/{key}", summary="更新系统设置")
@router.post("/setting/{key}", summary="更新系统设置", response_model=schemas.Response)
def set_setting(key: str, value: Union[list, dict, str, int],
_: schemas.TokenPayload = Depends(verify_token)):
"""

View File

@ -8,10 +8,10 @@ class ObjectUtils:
@staticmethod
def is_obj(obj: Any):
if isinstance(obj, list) \
or isinstance(obj, dict):
or isinstance(obj, dict) \
or isinstance(obj, tuple):
return True
elif isinstance(obj, str) \
or isinstance(obj, int) \
elif isinstance(obj, int) \
or isinstance(obj, float) \
or isinstance(obj, bool) \
or isinstance(obj, bytes):