@@ -58,19 +58,19 @@ async def get_character_info(request: Request, state: AltersDep, redis: RedisDep
|
||||
|
||||
|
||||
@router.get('/info/oath/{suitId}/{skillId}')
|
||||
async def get_oath_info(state: AltersDep, suitId: str, skillId: str, rarity: str, redis: RedisDep):
|
||||
async def get_oath_info(state: AltersDep, suitId: str, skillId: str, rarity: str, lv: int, redis: RedisDep):
|
||||
def get_info():
|
||||
skill = None
|
||||
version = state.equVersion
|
||||
equ = get_equipment(version)
|
||||
oath = next((x for x in equ.oath_suits if x.suitId == suitId and x.rarity == rarity), None)
|
||||
oath = next((x for x in equ.oath_suits if x.suitId == suitId and x.rarity == rarity and str(x.level) == str(lv)), None)
|
||||
if oath is not None:
|
||||
oathSkill = next((x for x in oath.skills if x.skillId == skillId), None)
|
||||
if oathSkill is not None:
|
||||
skill = {**oathSkill.__dict__, 'point': oath.points, 'imageUrl': oath.imageUrl}
|
||||
skill = {**oathSkill.__dict__, 'point': oath.points.split(',')[lv - 1], 'imageUrl': oath.imageUrl}
|
||||
return skill
|
||||
|
||||
info = get_redis_info(redis, f'dcalc:oath:{suitId}:{rarity}:{skillId}', get_info)
|
||||
info = get_redis_info(redis, f'dcalc:oath:{suitId}:{rarity}:{lv}:{skillId}', get_info)
|
||||
return response(data=info)
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user