UNSTABLE:一大堆细节改进 警告:在测试稳定前可以先不要跟进此commit改动
This commit is contained in:
@@ -3,17 +3,18 @@ from loguru import logger
|
||||
import rapidjson as json
|
||||
from API_TitleServer import apiSDGB
|
||||
|
||||
def implGetUser_(thing:str, userId:int, noLog=False) -> dict:
|
||||
"""获取用户某些数据的 API 实现,返回 Dict"""
|
||||
# 获取 Json String
|
||||
result = apiGetUserThing(userId, thing, noLog)
|
||||
# 转换为 Dict
|
||||
userthingDict = json.loads(result)
|
||||
# 返回 Dict
|
||||
return userthingDict
|
||||
|
||||
def apiGetUserData(userId:int) -> str:
|
||||
"""已弃用,将逐步淘汰"""
|
||||
#logger.info("apiGetUserData 已弃用,将逐步淘汰。")
|
||||
# 构建 Payload
|
||||
data = json.dumps({
|
||||
"userId": userId
|
||||
})
|
||||
# 发送请求
|
||||
userdata_result = apiSDGB(data, "GetUserDataApi", userId)
|
||||
# 返回响应
|
||||
return userdata_result
|
||||
"""Now aka of implGetUser_(Data)"""
|
||||
return implGetUser_("Data", userId)
|
||||
|
||||
def apiGetUserThing(userId:int, thing:str, noLog=False) -> str:
|
||||
"""获取用户数据的 API 请求器,返回 Json String"""
|
||||
@@ -26,11 +27,3 @@ def apiGetUserThing(userId:int, thing:str, noLog=False) -> str:
|
||||
# 返回响应
|
||||
return userthing_result
|
||||
|
||||
def implGetUser_(thing:str, userId:int, noLog=False) -> dict:
|
||||
"""获取用户某些数据的 API 实现,返回 Dict"""
|
||||
# 获取 Json String
|
||||
userthing_result = apiGetUserThing(userId, thing, noLog)
|
||||
# 转换为 Dict
|
||||
userthing_dict = json.loads(userthing_result)
|
||||
# 返回 Dict
|
||||
return userthing_dict
|
||||
Reference in New Issue
Block a user