- Python 后端 + 单页前端 + Android(Chaquopy) 壳 - 曲库 1343 首 / 称号 2800 个 - 机台身份与店铺信息已抹除,字段留空 - 打包脚本含 16KB 页对齐与自动脱敏
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""
|
||
GetUserRating.py —— 取用户 Rating 明细(GetUserRatingApi)
|
||
================================================================================
|
||
|
||
取玩家的 Rating 构成(旧谱 / 新谱 / 下一档候选 + 段位)。
|
||
|
||
对应接口:GetUserRatingApi
|
||
请求体 :UserIdRequestVO
|
||
响应 :{userId, userRating:{rating, ratingList, newRatingList, nextRatingList,
|
||
nextNewRatingList, udemae}}
|
||
依据 :source/Assembly-CSharp/Net.VO.Mai2/UserRatingRequestVO.cs
|
||
|
||
★ 回传 Upsert 时是**单元素数组** userRatingList:[{...}],不是对象。
|
||
|
||
调用示例:
|
||
from api import GetUserRating
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from typing import Any, Dict, Optional
|
||
|
||
from config import CLIENT_ID, TIMEOUT_MS
|
||
|
||
from .LogSetup import log_info
|
||
from .MaimaiNet import MaimaiNetClient
|
||
from .UserGetterCommon import _get, UserIdRequestVO
|
||
|
||
|
||
def GetUserRating(
|
||
user_id: int,
|
||
*,
|
||
client_id: str = CLIENT_ID,
|
||
timeout_ms: Optional[int] = None,
|
||
client: Optional[MaimaiNetClient] = None,
|
||
) -> Dict[str, Any]:
|
||
"""
|
||
取用户 Rating 明细(对应 GetUserRatingApi)。
|
||
|
||
返回:
|
||
原始响应 dict,含 userRating 子对象
|
||
"""
|
||
log_info("取用户 Rating 明细:user_id=" + str(user_id))
|
||
return _get("GetUserRatingApi", UserIdRequestVO(userId=user_id), user_id,
|
||
client_id=client_id, timeout_ms=timeout_ms, client=client)
|