standardization KaleidxScope variable names

This commit is contained in:
SoulGateKey
2025-04-04 05:42:53 +08:00
parent cc7afa6b67
commit 9a7fc007bc
3 changed files with 18 additions and 19 deletions

View File

@@ -4,7 +4,6 @@ from core.config import CoreConfig
from titles.mai2.buddiesplus import Mai2BuddiesPlus
from titles.mai2.const import Mai2Constants
from titles.mai2.config import Mai2Config
from titles.mai2.schema.score import kaleidx_scope
class Mai2Prism(Mai2BuddiesPlus):
@@ -50,18 +49,18 @@ class Mai2Prism(Mai2BuddiesPlus):
}
async def handle_get_user_kaleidx_scope_api_request(self, data: Dict) -> Dict:
kaleidx_scope = await self.data.score.get_user_kaleidx_scope_list(data["userId"])
kaleidxscope = await self.data.score.get_user_kaleidxscope_list(data["userId"])
if kaleidx_scope is None:
if kaleidxscope is None:
return {"userId": data["userId"], "userKaleidxScopeList":[]}
kaleidx_scope_list = []
for kaleidx_scope_data in kaleidx_scope:
tmp = kaleidx_scope_data._asdict()
kaleidxscope_list = []
for kaleidxscope_data in kaleidxscope:
tmp = kaleidxscope_data._asdict()
tmp.pop("user")
tmp.pop("id")
kaleidx_scope_list.append(tmp)
kaleidxscope_list.append(tmp)
return {
"userId": data["userId"],
"userKaleidxScopeList": kaleidx_scope_list
"userKaleidxScopeList": kaleidxscope_list
}