forked from GuChen/maimaiDX-API-Web-Server
Initial commit: Add maimaiDX API web application with AimeDB scanning and logging features
This commit is contained in:
55
backend/_Special.py
Normal file
55
backend/_Special.py
Normal file
@@ -0,0 +1,55 @@
|
||||
# 纯纯测试用
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
|
||||
from HelperFullPlay import implFullPlayAction, generateMusicData
|
||||
|
||||
from MyConfig import testUid8
|
||||
|
||||
|
||||
def implChangeVersionNumber(
|
||||
userId: int,
|
||||
currentLoginTimestamp: int,
|
||||
currentLoginResult,
|
||||
dataVersion="1.40.09",
|
||||
romVersion="1.41.00",
|
||||
) -> str:
|
||||
musicData = generateMusicData()
|
||||
userAllPatches = {
|
||||
"upsertUserAll": {
|
||||
"userData": [
|
||||
{
|
||||
"lastRomVersion": romVersion,
|
||||
"lastDataVersion": dataVersion,
|
||||
"playerRating": 114514,
|
||||
}
|
||||
],
|
||||
"userMusicDetailList": [musicData],
|
||||
"isNewMusicDetailList": "1", # 1避免覆盖
|
||||
}
|
||||
}
|
||||
result = implFullPlayAction(
|
||||
userId, currentLoginTimestamp, currentLoginResult, musicData, userAllPatches
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
userId = testUid8
|
||||
currentLoginTimestamp = generateTimestamp()
|
||||
loginResult = apiLogin(currentLoginTimestamp, userId)
|
||||
|
||||
if loginResult["returnCode"] != 1:
|
||||
logger.info("登录失败")
|
||||
exit()
|
||||
try:
|
||||
logger.info(
|
||||
implChangeVersionNumber(
|
||||
userId, currentLoginTimestamp, loginResult, "1.00.00", "1.00.00"
|
||||
)
|
||||
)
|
||||
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||
finally:
|
||||
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||
# logger.warning("Error")
|
||||
Reference in New Issue
Block a user