feat: unlock multiple partners
This commit is contained in:
@@ -7,18 +7,22 @@ from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
|
||||
from HelperUnlockThing import implUnlockThing
|
||||
|
||||
|
||||
def implUnlockSingleItem(
|
||||
itemId: int,
|
||||
def implUnlockMultiItem(
|
||||
itemKind: int,
|
||||
userId: int,
|
||||
currentLoginTimestamp: int,
|
||||
currentLoginResult,
|
||||
*itemIds: int,
|
||||
) -> str:
|
||||
if not itemIds:
|
||||
logger.info("无操作,跳过处理!")
|
||||
return
|
||||
"""
|
||||
发单个东西,比如搭档 10
|
||||
"""
|
||||
userItemList = [
|
||||
{"itemKind": itemKind, "itemId": itemId, "stock": 1, "isValid": True}
|
||||
for itemId in itemIds
|
||||
]
|
||||
unlockThingResult = implUnlockThing(
|
||||
userItemList, userId, currentLoginTimestamp, currentLoginResult
|
||||
@@ -51,8 +55,15 @@ if __name__ == "__main__":
|
||||
logger.info("登录失败")
|
||||
exit()
|
||||
try:
|
||||
items = [23]
|
||||
logger.info(
|
||||
implUnlockSingleItem(14, 10, userId, currentLoginTimestamp, loginResult)
|
||||
implUnlockMultiItem(
|
||||
10,
|
||||
userId,
|
||||
currentLoginTimestamp,
|
||||
loginResult,
|
||||
*items,
|
||||
)
|
||||
)
|
||||
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user