mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-15 04:07:29 +08:00
add mai2 UserIntimateApi
This commit is contained in:
@@ -264,6 +264,11 @@ class Mai2DX(Mai2Base):
|
||||
if "user2pPlaylog" in upsert:
|
||||
await self.data.score.put_playlog_2p(user_id, upsert["user2pPlaylog"])
|
||||
|
||||
# added in BUDDiES+
|
||||
if "userIntimateList" in upsert and len(upsert["userIntimateList"]) > 0:
|
||||
for intimate in upsert["userIntimateList"]:
|
||||
await self.data.profile.put_intimacy(user_id, intimate["partnerId"], intimate["intimateLevel"], intimate["intimateCountRewarded"])
|
||||
|
||||
return {"returnCode": 1, "apiName": "UpsertUserAllApi"}
|
||||
|
||||
async def handle_get_user_data_api_request(self, data: Dict) -> Dict:
|
||||
@@ -713,6 +718,24 @@ class Mai2DX(Mai2Base):
|
||||
ret['loginId'] = ret.get('loginCount', 0)
|
||||
return ret
|
||||
|
||||
# Intimate api added in BUDDiES+
|
||||
async def handle_get_user_intimate_api_request(self, data: Dict) -> Dict:
|
||||
intimate = await self.data.profile.get_intimacy(data["userId"])
|
||||
if intimate is None:
|
||||
return {}
|
||||
|
||||
partner_list = [{
|
||||
"partnerId": i["partnerId"],
|
||||
"intimateLevel": i["intimateLevel"],
|
||||
"intimateCountRewarded": i["intimateCountRewarded"]
|
||||
} for i in intimate]
|
||||
|
||||
return {
|
||||
"userId": data["userId"],
|
||||
"length": len(partner_list),
|
||||
"userIntimateList": partner_list
|
||||
}
|
||||
|
||||
# CardMaker support added in Universe
|
||||
async def handle_cm_get_user_preview_api_request(self, data: Dict) -> Dict:
|
||||
p = await self.data.profile.get_profile_detail(data["userId"], self.version)
|
||||
|
||||
Reference in New Issue
Block a user